public class PackageResourceStream extends AbstractResourceStream
IResourceStream that reads data from a resource in the classpath. It simply delegates
all operations to the IResourceStream returned by the application's
IResourceStreamLocator.| Constructor and Description |
|---|
PackageResourceStream(Class<?> scope,
String path)
Obtains an
IResourceStream from the application's
IResourceStreamLocator.locate(Class, String) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
getContentType() |
InputStream |
getInputStream() |
Time |
lastModifiedTime() |
Bytes |
length() |
getLocale, getStyle, getVariation, setLocale, setStyle, setVariationpublic PackageResourceStream(Class<?> scope, String path)
IResourceStream from the application's
IResourceStreamLocator.locate(Class, String)scope - This argument will be used to get the class loader for loading the package
resource, and to determine what package it is in.path - The path to the resourcepublic void close()
throws IOException
IOExceptionpublic String getContentType()
getContentType in interface IResourceStreamgetContentType in class AbstractResourceStreampublic InputStream getInputStream() throws ResourceStreamNotFoundException
ResourceStreamNotFoundExceptionpublic Bytes length()
length in interface IResourceStreamlength in class AbstractResourceStreampublic Time lastModifiedTime()
lastModifiedTime in interface IModifiablelastModifiedTime in class AbstractResourceStreamCopyright © 2006–2014 Apache Software Foundation. All rights reserved.