Package org.apache.fop.apps
Class FOURIResolver
- java.lang.Object
-
- org.apache.fop.apps.FOURIResolver
-
- All Implemented Interfaces:
URIResolver
@Deprecated(since="2021-03-01") public class FOURIResolver extends Object implements URIResolver
Deprecated.Avoid using this package provided OOTB and migrate code a newer version which you can deploy as part of your project.Provides FOP specific URI resolution. This is the default URIResolverFOUserAgentwill use unless overridden.- See Also:
URIResolver
-
-
Constructor Summary
Constructors Constructor Description FOURIResolver()Deprecated.Default constructorFOURIResolver(boolean throwExceptions)Deprecated.Additional constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description StringcheckBaseURL(String base)Deprecated.Checks if the given base URL is acceptable.URIResolvergetCustomURIResolver()Deprecated.Returns the custom URI Resolver.Sourceresolve(String href, String base)Deprecated.Called by the processor throughFOUserAgentwhen it encounters an uri in an external-graphic element.voidsetCustomURIResolver(URIResolver resolver)Deprecated.Sets the custom URI Resolver.voidsetThrowExceptions(boolean throwExceptions)Deprecated.
-
-
-
Method Detail
-
checkBaseURL
public String checkBaseURL(String base) throws MalformedURLException
Deprecated.Checks if the given base URL is acceptable. It also normalizes the URL.- Parameters:
base- the base URL to check- Returns:
- the normalized URL
- Throws:
MalformedURLException- if there's a problem with a file URL
-
resolve
public Source resolve(String href, String base) throws TransformerException
Deprecated.Called by the processor throughFOUserAgentwhen it encounters an uri in an external-graphic element. (see alsoURIResolver.resolve(String, String)This resolver will allow URLs without a scheme, i.e. it assumes 'file:' as the default scheme. It also allows relative URLs with scheme, e.g. file:../../abc.jpg which is not strictly RFC compliant as long as the scheme is the same as the scheme of the base URL. If the base URL is null a 'file:' URL referencing the current directory is used as the base URL. If the method is successful it will return a Source of typeStreamSourcewith its SystemID set to the resolved URL used to open the underlying InputStream.- Specified by:
resolvein interfaceURIResolver- Parameters:
href- An href attribute, which may be relative or absolute.base- The base URI against which the first argument will be made absolute if the absolute URI is required.- Returns:
- A
Sourceobject, or null if the href cannot be resolved. - Throws:
TransformerException- Never thrown by this implementation.- See Also:
URIResolver.resolve(String, String)
-
setCustomURIResolver
public void setCustomURIResolver(URIResolver resolver)
Deprecated.Sets the custom URI Resolver. It is used for resolving factory-level URIs like hyphenation patterns and as backup for URI resolution performed during a rendering run.- Parameters:
resolver- the new URI resolver
-
getCustomURIResolver
public URIResolver getCustomURIResolver()
Deprecated.Returns the custom URI Resolver.- Returns:
- the URI Resolver or null, if none is set
-
setThrowExceptions
public void setThrowExceptions(boolean throwExceptions)
Deprecated.- Parameters:
throwExceptions- Whether or not to throw exceptions on resolution error
-
-