|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jmage.resource.DefaultImageFactory
public class DefaultImageFactory
DefaultImageFactory loads images as resources from system environment.
| Field Summary | |
|---|---|
protected ApplicationContext |
applicationContext
|
protected static DefaultImageFactory |
defaultImageFactory
|
protected java.util.List |
imageTypes
|
protected static org.apache.log4j.Logger |
log
|
protected java.util.List |
schemeTypes
|
protected javax.servlet.ServletContext |
servletContext
|
| Constructor Summary | |
|---|---|
DefaultImageFactory()
Create a DefaultimageFactory |
|
| Method Summary | |
|---|---|
boolean |
canHandle(java.net.URI resource)
Tests whether the ImageFactory can handle a particular resource URI. |
void |
configure(ApplicationContext context)
Configures the ImageFactory with ApplicationContext |
void |
configureRequestProperties(java.util.Properties properties)
Initialize the ResourceFactory with extra Properties needed |
java.lang.Object |
createFrom(java.net.URI resource)
Create an object resource from a resource URI |
protected javax.media.jai.PlanarImage |
getAbsoluteFile(java.io.File file)
Get the absolute file from the file system |
protected javax.media.jai.PlanarImage |
getClassPathResource(java.io.File file)
Get the file from the classpath as a system resource |
protected javax.media.jai.PlanarImage |
getCurrentDirFile(java.io.File file)
Get the file from the current application directory. |
protected javax.media.jai.PlanarImage |
getFile(java.io.File file)
Get the image resource from a file. |
protected javax.media.jai.PlanarImage |
getJMAGEResourceDirFile(java.io.File file)
Get the file from the dir specified trough the resourcedir property |
protected javax.media.jai.PlanarImage |
getServletContainerResource(java.io.File file)
Get the file from the ServletContainer as a system resource. |
protected javax.media.jai.PlanarImage |
getURL(java.net.URL url)
Get the image from an URL |
protected java.net.URL |
locateOnClassPath(java.lang.String path,
java.lang.ClassLoader classLoader)
|
protected java.io.ByteArrayOutputStream |
readFromUrl(java.net.URL url)
Read an image from a URL using http |
void |
removeRequestProperties(java.util.Properties properties)
Lifecycle method for removing per request properties |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected static DefaultImageFactory defaultImageFactory
protected static org.apache.log4j.Logger log
protected java.util.List imageTypes
protected java.util.List schemeTypes
protected ApplicationContext applicationContext
protected javax.servlet.ServletContext servletContext
| Constructor Detail |
|---|
public DefaultImageFactory()
| Method Detail |
|---|
public void configure(ApplicationContext context)
configure in interface Configurablecontext - the ApplicationContextpublic void configureRequestProperties(java.util.Properties properties)
ResourceFactory
configureRequestProperties in interface ResourceFactorypublic void removeRequestProperties(java.util.Properties properties)
ResourceFactory
removeRequestProperties in interface ResourceFactorypublic boolean canHandle(java.net.URI resource)
canHandle in interface ResourceFactoryresource -
public java.lang.Object createFrom(java.net.URI resource)
throws ResourceException
createFrom in interface ResourceFactoryresource - the resource URI
ResourceException
protected javax.media.jai.PlanarImage getFile(java.io.File file)
throws ResourceException
file - the file
ResourceException
protected javax.media.jai.PlanarImage getClassPathResource(java.io.File file)
throws ResourceException
file -
ResourceException
protected java.net.URL locateOnClassPath(java.lang.String path,
java.lang.ClassLoader classLoader)
protected javax.media.jai.PlanarImage getCurrentDirFile(java.io.File file)
file - the file
protected javax.media.jai.PlanarImage getJMAGEResourceDirFile(java.io.File file)
file - the file
protected javax.media.jai.PlanarImage getServletContainerResource(java.io.File file)
file - the file
protected javax.media.jai.PlanarImage getAbsoluteFile(java.io.File file)
file - the file
protected javax.media.jai.PlanarImage getURL(java.net.URL url)
throws ResourceException
url - the url
ResourceException
protected java.io.ByteArrayOutputStream readFromUrl(java.net.URL url)
throws java.io.IOException
url - the url
java.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||