public final class JarStorage extends DirectoryStorage
Modifier and Type | Field and Description |
---|---|
protected java.io.File |
file |
Constructor and Description |
---|
JarStorage(oracle.ojc.storage.AbstractStorage storage,
java.lang.String name) |
JarStorage(java.io.File file) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes a Storage that previously opened for data access.
|
Storage |
create(java.lang.String name)
Creates a new Storage for data access if doesn't exists yet.
|
Storage |
createDir(java.lang.String name)
Creates a new directory Storage if doesn't exists yet.
|
protected void |
finalize() |
java.lang.String |
getCanonicalPath()
Returns the canonical path name of this Storage.
|
java.util.jar.Manifest |
getManifest() |
java.lang.String |
getName()
Returns the name of this Storage (without leading directories).
|
static int |
getOpenJarCount() |
java.lang.String |
getPath()
Returns the path name of this Storage.
|
java.lang.Object |
getProperty(java.lang.String property)
Queries custom property associated with this Storage.
|
boolean |
isInJar()
Indicates whether this Storage is contained in a zip/jar file.
|
boolean |
isOpen() |
java.lang.String[] |
list()
Lists all names of Storages within this directory Storage.
|
long |
modDate()
Returns date of last modification of this Storage.
|
void |
open()
Opens a Storage for access.
|
byte[] |
read()
Reads the entire contents of this data Storage.
|
int |
read(byte[] buf)
Tries to fill a buffer with data from contents of this Storage.
|
void |
setProperty(java.lang.String property,
java.lang.Object value)
Allows association of custom properties with this Storage.
|
int |
size()
Returns the size of contents of this data Storage.
|
java.lang.String |
toString() |
void |
write(byte[] buf,
int start,
int len)
Write the contents of a byte array into this Storage.
|
isDirectory, listStorage, open
public JarStorage(oracle.ojc.storage.AbstractStorage storage, java.lang.String name)
public JarStorage(java.io.File file)
public boolean isOpen()
public java.util.jar.Manifest getManifest()
public static int getOpenJarCount()
public void close()
Storage
protected void finalize() throws java.io.IOException
finalize
in class java.lang.Object
java.io.IOException
public Storage create(java.lang.String name) throws java.io.IOException
Storage
create
in interface Storage
create
in class DirectoryStorage
name
- of Storage to be createdjava.io.IOException
public Storage createDir(java.lang.String name) throws java.io.IOException
Storage
createDir
in interface Storage
createDir
in class DirectoryStorage
name
- of Storage to be createdjava.io.IOException
public java.lang.String getName()
Storage
public boolean isInJar()
Storage
public java.lang.String getPath()
Storage
public java.lang.String getCanonicalPath()
Storage
getCanonicalPath
in interface Storage
public long modDate()
Storage
public java.lang.Object getProperty(java.lang.String property)
Storage
getProperty
in interface Storage
property
- property keypublic void setProperty(java.lang.String property, java.lang.Object value)
Storage
setProperty
in interface Storage
property
- property keyvalue
- property valuepublic void open() throws java.io.IOException
Storage
public int size() throws java.io.IOException
Storage
public byte[] read() throws java.io.IOException
Storage
public int read(byte[] buf) throws java.io.IOException
Storage
public java.lang.String[] list()
Storage
public void write(byte[] buf, int start, int len) throws java.io.IOException
Storage
public java.lang.String toString()
toString
in class java.lang.Object