cancel
Showing results for 
Search instead for 
Did you mean: 

WDWebResource is deprecated.

Former Member
0 Kudos

Hi,

I faced below issue and don't know how to resolved it. Please help.

The method getWebResource(byte[], WDWebResourceType) from the type WDWebResource is deprecated

The source code is as below:

byte[] pdfContent = wdContext.currentOutputElement().getBin_File();

IWDCachedWebResource pdfResource = WDWebResource.getWebResource(pdfContent,WDWebResourceType.PDF);

try {

wdContext.currentInternalElement().setUrl(pdfResource.getURL());

}catch (Exception e) {

wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);

}

Thanks.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Deprecated means old version and may not run a optimal performance but you can still use the code.

former_member185086
Active Contributor
0 Kudos

Exactly

It also mean that in future it will removed from library .

other point for your clarification is that

Java never delete or put old library in bin but it simply create a new wrapper which is based on old and provide some additional functionality with better performance and usability and scalability .

Hope this session help you much.

Good luck

Satish Kumar

Former Member
0 Kudos

Hi,

Following is the migrated code


	  byte[] pdfContent = wdContext.currentOutputElement().getBin_File();
	  IWDResource pdfResourceNew = WDResourceFactory.createCachedResource(pdfContent, "My Resource", WDWebResourceType.PDF);
	  try {
		  wdContext.currentInternalElement().setUrl(pdfResource.getURL());
		  }catch (Exception e) {
		  wdComponentAPI.getMessageManager().reportException(e.getMessage(),true);
		  }

Regards

Ayyapparaj

former_member185086
Active Contributor
0 Kudos

Hi

User this

com.sap.tc.webdynpro.progmodel.api.WDResourceFactory.createCachedResource(byte[], String, WDWebResourceType)}

Best Regards

Satish Kumar

Former Member
0 Kudos

Hi Satish,

I'm very new to java, please tell me how to admend the code. Thanks.