public static class LoadOptions.ResourceLoadingResult extends Object
Result of custom loading of resource
Constructor and Description |
---|
ResourceLoadingResult(byte[] data)
Creates instance of loading result
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
Bynary data that loaded with custom loader - it must be set after loading
|
Charset |
getEncodingIfKnown()
Sometimes encoding of resource is known after or during loading.
|
com.aspose.ms.System.Exception |
getExceptionOfLoadingIfAny()
Sometimes it's impossible to load requested resource for some reason.
|
String |
getMIMETypeIfKnown()
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.
|
boolean |
isLoadingCancelled()
Sometimes for some reasons loading should not occure custom code.
|
void |
setEncodingIfKnown(Charset encodingIfKnown)
Sometimes encoding of resource is known after or during loading.
|
void |
setExceptionOfLoadingIfAny(com.aspose.ms.System.Exception exceptionOfLoadingIfAny)
Sometimes it's impossible to load requested resource for some reason.
|
void |
setLoadingCancelled(boolean loadingCancelled)
Sometimes for some reasons loading should not occure custom code.
|
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.
|
public ResourceLoadingResult(byte[] data)
Creates instance of loading result
data
- reult of custom loading must be allways provided, it can be zero-length array if it's
impossible to get any resultpublic byte[] getData()
Bynary data that loaded with custom loader - it must be set after loading
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.
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.
encodingIfKnown
- Charset instancepublic com.aspose.ms.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.
public void setExceptionOfLoadingIfAny(com.aspose.ms.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.
exceptionOfLoadingIfAny
- Exceptionpublic String getMIMETypeIfKnown()
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.
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.
MIMETypeIfKnown
- String valuepublic boolean isLoadingCancelled()
Sometimes for some reasons loading should not occure 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).
public void setLoadingCancelled(boolean loadingCancelled)
Sometimes for some reasons loading should not occure 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).
loadingCancelled
- boolean value