public class ManifestPropertyIO extends AbstractPropertyIO
getServletContext().getResourceAsStream("META-INF/MANIFEST.MF"))
.(JarURLConnection)getUrl().openConnection()
.Modifier and Type | Class and Description |
---|---|
(package private) class |
ManifestPropertyIO.ArchiveFileFilter |
(package private) static class |
ManifestPropertyIO.INIT_METHOD |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_MANIFEST_PATH
The default manifest path "/META-INF/MANIFEST.MF"
|
Constructor and Description |
---|
ManifestPropertyIO()
Default constructor, read the "META-INF/MANIFEST.MF" found via the URLClassLoader.findResource(String).
|
ManifestPropertyIO(File file)
Constructor.
|
ManifestPropertyIO(JarFile jarFile)
Read the manifest file from a JarFile instance.
|
ManifestPropertyIO(Manifest manifest)
Constructor, using a instance of a Manifest.
|
ManifestPropertyIO(javax.servlet.ServletContext servletContext)
Finding the Manifest file via the ServletContext.
|
ManifestPropertyIO(String resourceName)
Constructor, read the resourceName found via the URLClassLoader.findResource.
|
ManifestPropertyIO(URL url)
Loads a manifest from jar file URL.
|
Modifier and Type | Method and Description |
---|---|
File |
getFile()
Either an archive file (".jar",".war",".ear" ,".zip") or a file directly to a manifest file.
|
JarFile |
getJarFile()
The jar file which the ManifestPropertyIO has been initialized with.
|
Manifest |
getManifest()
A manifest instance.
|
String |
getName()
A short descriptive name of the Property IO.
|
Properties |
getProperties()
Gets all the name,value pair in a Properties class instance.
|
String |
getResourceName()
The name of the resource a URLClassLoader will try to locate and load as a manifest file.
|
javax.servlet.ServletContext |
getServletContext()
The servletContext.
|
String |
getSource()
A detailed description of the source of the property data.
|
URL |
getUrl()
An archive file URL.
|
void |
reload()
Reloads the name,value pairs for the PropertyIO, or forces the values to reload when read next time.
|
void |
setValue(String propertyName,
String value)
Sets the name,value as String in the IO.
|
void |
validate()
Validates the PropertyIO.
|
backup, getCacheTime, getLastLoaded, getLastSaved, getLogger, getTypedProperties, getTypedValue, getValue, isCached, isReadonly, logPerformanceGetProperties, logPerformanceSetValue, setCacheTime, storeTypedValue, updateLastLoaded, updateLastSaved, validateWritable
public static final String DEFAULT_MANIFEST_PATH
public ManifestPropertyIO()
public ManifestPropertyIO(String resourceName)
resourceName
- the resource namepublic ManifestPropertyIO(JarFile jarFile)
jarFile
- public ManifestPropertyIO(File file)
file
- the filepublic ManifestPropertyIO(javax.servlet.ServletContext servletContext)
getServletContext().getResourceAsStream("META-INF/MANIFEST.MF")
.servletContext
- the servletContext.public ManifestPropertyIO(URL url)
url
- the url to a jar filepublic ManifestPropertyIO(Manifest manifest)
manifest
- the manifest instance.public void validate() throws PropertyIOException
PropertyIO
PropertyIOException
public final String getResourceName()
null
.public final JarFile getJarFile()
null
.public File getFile()
null
.public javax.servlet.ServletContext getServletContext()
null
.public Manifest getManifest()
null
.public URL getUrl()
null
.public String getName()
PropertyIO
public String getSource()
PropertyIO
public final void setValue(String propertyName, String value) throws PropertyIOException
PropertyIO
propertyName
- the name of the propertyvalue
- the string value of the property.PropertyIOException
- if the IO is readonly or failed to write the value.public Properties getProperties()
PropertyIO
Properties
public void reload()
PropertyIO
reload
in interface PropertyIO
reload
in class AbstractPropertyIO