LoadOptions.ResourceLoadingResult

Inheritance: java.lang.Object

public static class LoadOptions.ResourceLoadingResult

Result of custom loading of resource

Constructors

ConstructorDescription
ResourceLoadingResult(byte[] data)Creates instance of loading result

Methods

MethodDescription
getData()Binary data that loaded with custom loader - it must be set after loading
getEncodingIfKnown()Sometimes encoding of resource is known after or during loading.
setEncodingIfKnown(Charset encodingIfKnown)Sometimes encoding of resource is known after or during loading.
getExceptionOfLoadingIfAny()Sometimes it’s impossible to load requested resource for some reason.
setExceptionOfLoadingIfAny(System.Exception exceptionOfLoadingIfAny)Sometimes it’s impossible to load requested resource for some reason.
getMIMETypeIfKnown()Sometimes knowledge about MIME type of loaded resource is useful for converter You can provide MIME type(if it’d known after loading) in this parameter.
setMIMETypeIfKnown(String MIMETypeIfKnown)Sometimes knowledge about MIME type of loaded resource is usefull for converter You can provide MIME type(if it’d known after loading) in this parameter.
isLoadingCancelled()Sometimes for some reasons loading should not occur custom code.
setLoadingCancelled(boolean loadingCancelled)Sometimes for some reasons loading should not occur custom code.

ResourceLoadingResult(byte[] data)

public ResourceLoadingResult(byte[] data)

Creates instance of loading result

Parameters:

ParameterTypeDescription
databyte[]result of custom loading must be always provided, it can be zero-length array if it’s impossible to get any result

getData()

public byte[] getData()

Binary data that loaded with custom loader - it must be set after loading

Returns: byte[] - array of byte values

getEncodingIfKnown()

public Charset getEncodingIfKnown()

Sometimes encoding of resource is known after or during loading. In such case custom code can provide converter with that knowledge via this parameter. You can leave null in this parameter if encoding is unknown or does not matter.

Returns: java.nio.charset.Charset - Charset instance

setEncodingIfKnown(Charset encodingIfKnown)

public void setEncodingIfKnown(Charset encodingIfKnown)

Sometimes encoding of resource is known after or during loading. In such case custom code can provide converter with that knowledge via this parameter. You can leave null in this parameter if encoding is unknown or does not matter.

Parameters:

ParameterTypeDescription
encodingIfKnownjava.nio.charset.CharsetCharset instance

getExceptionOfLoadingIfAny()

public System.Exception getExceptionOfLoadingIfAny()

Sometimes it’s impossible to load requested resource for some reason. Unavailability of resource often does not lead to crash of conversions and result document can be created anyway(but maybe in a bit worse quality, without images etc.). If exception occurred during loading, just catch it and put in this parameter - sometimes that information is useful for converter for rendering of result.

Returns: com.aspose.ms.System.Exception - Exception

setExceptionOfLoadingIfAny(System.Exception exceptionOfLoadingIfAny)

public void setExceptionOfLoadingIfAny(System.Exception exceptionOfLoadingIfAny)

Sometimes it’s impossible to load requested resource for some reason. Unavailability of resource often does not lead to crash of conversions and result document can be created anyway(but maybe in a bit worse quality, without images etc.). If exception occurred during loading, just catch it and put in this parameter - sometimes that information is useful for converter for rendering of result.

Parameters:

ParameterTypeDescription
exceptionOfLoadingIfAnycom.aspose.ms.System.ExceptionException

getMIMETypeIfKnown()

public String getMIMETypeIfKnown()

Sometimes knowledge about MIME type of loaded resource is useful for converter You can provide MIME type(if it’d known after loading) in this parameter. Please leave parameter equal to null when MIME type unknown or it’s not necessary to supply it.

Returns: java.lang.String - String value

setMIMETypeIfKnown(String MIMETypeIfKnown)

public void setMIMETypeIfKnown(String MIMETypeIfKnown)

Sometimes knowledge about MIME type of loaded resource is usefull for converter You can provide MIME type(if it’d known after loading) in this parameter. Please leave parameter equal to null when MIME type unknown or it’s not necessary to supply it.

Parameters:

ParameterTypeDescription
MIMETypeIfKnownjava.lang.StringString value

isLoadingCancelled()

public boolean isLoadingCancelled()

Sometimes for some reasons loading should not occur custom code. In such case please set this flag as True. In such case converter will try use internal default resource loader to get that result(as it behave in situation when custom strategy not supplied).

Returns: boolean - boolean value

setLoadingCancelled(boolean loadingCancelled)

public void setLoadingCancelled(boolean loadingCancelled)

Sometimes for some reasons loading should not occur custom code. In such case please set this flag as True. In such case converter will try use internal default resource loader to get that result(as it behave in situation when custom strategy not supplied).

Parameters:

ParameterTypeDescription
loadingCancelledbooleanboolean value