public abstract class AbstractImageSessionContext extends java.lang.Object implements ImageSessionContext
Constructor and Description |
---|
AbstractImageSessionContext() |
Modifier and Type | Method and Description |
---|---|
protected javax.imageio.stream.ImageInputStream |
createImageInputStream(java.io.InputStream in) |
javax.xml.transform.Source |
getSource(java.lang.String uri)
Returns a Source object for a URI.
|
protected boolean |
isReusable(javax.xml.transform.Source src)
Indicates whether a Source is reusable.
|
javax.xml.transform.Source |
needSource(java.lang.String uri)
Returns a Source object for a URI.
|
javax.xml.transform.Source |
newSource(java.lang.String uri)
Attempts to create a Source object from the given URI.
|
protected abstract javax.xml.transform.Source |
resolveURI(java.lang.String uri)
Attempts to resolve the given URI.
|
void |
returnSource(java.lang.String uri,
javax.xml.transform.Source src)
Returns a Source object to a pool.
|
static java.io.File |
toFile(java.net.URL url)
Convert from a
URL to a File . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParentContext, getTargetResolution
protected abstract javax.xml.transform.Source resolveURI(java.lang.String uri)
uri
- URI to accessSource
object, or null if the URI
cannot be resolved.public javax.xml.transform.Source newSource(java.lang.String uri)
newSource
in interface ImageSessionContext
uri
- URI to accessSource
object, or null if the URI
cannot be resolved.protected javax.imageio.stream.ImageInputStream createImageInputStream(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.io.File toFile(java.net.URL url)
URL
to a File
.
This method will decode the URL.
Syntax such as file:///my%20docs/file.txt
will be
correctly decoded to /my docs/file.txt
.
Note: this method has been copied over from Apache Commons IO and enhanced to support UNC paths.
url
- the file URL to convert, null
returns null
File
object, or null
if the URL's protocol is not file
java.lang.IllegalArgumentException
- if the file is incorrectly encodedpublic javax.xml.transform.Source getSource(java.lang.String uri)
ImageSessionContext.returnSource(String, Source)
method).getSource
in interface ImageSessionContext
uri
- the URI of the imagepublic javax.xml.transform.Source needSource(java.lang.String uri) throws java.io.FileNotFoundException
FileNotFoundException
is thrown.needSource
in interface ImageSessionContext
uri
- the URI of the imagejava.io.FileNotFoundException
- if the image cannot be foundpublic void returnSource(java.lang.String uri, javax.xml.transform.Source src)
returnSource
in interface ImageSessionContext
uri
- the URI of the imagesrc
- the Source object belonging to the URIprotected boolean isReusable(javax.xml.transform.Source src)
ImageSource
(containing an ImageInputStream
) or a DOMSource
.src
- the Source objectCopyright 1999-2012 The Apache Software Foundation. All Rights Reserved.