public final class FileStorage
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected java.io.File |
file |
| Constructor and Description |
|---|
FileStorage(oracle.ojc.storage.AbstractStorage storage,
java.lang.String name) |
FileStorage(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.
|
java.lang.String |
getCanonicalPath()
Returns the canonical path name of this Storage.
|
java.lang.String |
getName()
Returns the name of this Storage (without leading directories).
|
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 |
isDirectory()
Indicates whether this is a directory Storage.
|
boolean |
isInJar()
Indicates whether this Storage is contained in a zip/jar file.
|
java.lang.String[] |
list()
Lists all names of Storages within this directory Storage.
|
java.util.ArrayList |
listStorage()
Lists all Storages within this directory Storage.
|
long |
modDate()
Returns date of last modification of this Storage.
|
void |
open()
Opens a Storage for access.
|
Storage |
open(java.lang.String name)
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 |
setLastModified(long lastModified) |
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.
|
public FileStorage(oracle.ojc.storage.AbstractStorage storage,
java.lang.String name)
public FileStorage(java.io.File file)
public void open()
throws java.io.IOException
Storagepublic int size()
throws java.io.IOException
Storagepublic byte[] read()
throws java.io.IOException
Storagepublic int read(byte[] buf)
throws java.io.IOException
Storagepublic void write(byte[] buf,
int start,
int len)
throws java.io.IOException
Storagepublic void close()
Storagepublic void setLastModified(long lastModified)
public java.lang.String getName()
Storagepublic boolean isDirectory()
StorageisDirectory in interface Storagepublic boolean isInJar()
Storagepublic java.lang.String getPath()
Storagepublic java.lang.String getCanonicalPath()
StoragegetCanonicalPath in interface Storagepublic long modDate()
Storagepublic java.lang.Object getProperty(java.lang.String property)
StoragegetProperty in interface Storageproperty - property keypublic void setProperty(java.lang.String property,
java.lang.Object value)
StoragesetProperty in interface Storageproperty - property keyvalue - property valuepublic Storage open(java.lang.String name)
Storagepublic Storage create(java.lang.String name) throws java.io.IOException
Storagepublic Storage createDir(java.lang.String name) throws java.io.IOException
Storagepublic java.lang.String[] list()
Storagepublic java.util.ArrayList listStorage()
StoragelistStorage in interface Storagepublic java.lang.String toString()
toString in class java.lang.Object