com.aspose.slides
Class HtmlExternalResolver

java.lang.Object
  extended by com.aspose.slides.HtmlExternalResolver
All Implemented Interfaces:
IHtmlExternalResolver

public class HtmlExternalResolver
extends java.lang.Object
implements IHtmlExternalResolver

Callback object used by HTML import routine to obtain referrenced objects such as images. Supports "data:" "file:" and "http:" url schemes.


Using this resolver could create a vulnurability when client provided HTML file will make server software to obtain local or network file. Use with caution. It is recommended not to specify HtmlExternalResolver at all (only embedded objects will be read) or create some subclass which checks if specified uri is valid.


Constructor Summary
HtmlExternalResolver()
           
 
Method Summary
 java.io.InputStream getEntity(java.lang.String absoluteUri)
           Fetches linked object.
 java.lang.String resolveUri(java.lang.String baseUri, java.lang.String relativeUri)
           Resolves URI.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlExternalResolver

public HtmlExternalResolver()
Method Detail

resolveUri

public java.lang.String resolveUri(java.lang.String baseUri,
                                   java.lang.String relativeUri)

Resolves URI.

Specified by:
resolveUri in interface IHtmlExternalResolver
Parameters:
baseUri - absolute URI of linking objects
relativeUri - URI to the linked object.
Returns:
absolute URI to the linked object. Returning null will prevent object from loading.

getEntity

public java.io.InputStream getEntity(java.lang.String absoluteUri)
Description copied from interface: IHtmlExternalResolver

Fetches linked object.

Specified by:
getEntity in interface IHtmlExternalResolver
Parameters:
absoluteUri - Absolute URI to the object (returned by ResolveUri(string, string) method.
Returns:
System.IO.Stream object with the linked object data or null if object can't or shouldn't be loaded.


Copyright © Copyright 2004-2016 Aspose Pty Ltd. All Rights Reserved.