Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.ojc.storage
Class JarStorage

java.lang.Object
  extended by oracle.ojc.storage.DirectoryStorage
      extended by oracle.ojc.storage.JarStorage
All Implemented Interfaces:
Storage

public final class JarStorage
extends DirectoryStorage


Field Summary
protected  java.io.File file
           
 
Constructor Summary
JarStorage(oracle.ojc.storage.AbstractStorage storage, java.lang.String name)
           
JarStorage(java.io.File file)
           
 
Method Summary
 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.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 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.
 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.
 
Methods inherited from class oracle.ojc.storage.DirectoryStorage
isDirectory, listStorage, open
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

file

protected final java.io.File file
Constructor Detail

JarStorage

public JarStorage(oracle.ojc.storage.AbstractStorage storage,
                  java.lang.String name)

JarStorage

public JarStorage(java.io.File file)
Method Detail

close

public void close()
Description copied from interface: Storage
Closes a Storage that previously opened for data access.

Specified by:
close in interface Storage

finalize

protected void finalize()
                 throws java.io.IOException
Overrides:
finalize in class java.lang.Object
Throws:
java.io.IOException

create

public Storage create(java.lang.String name)
               throws java.io.IOException
Description copied from interface: Storage
Creates a new Storage for data access if doesn't exists yet. Note that this must be a directory Storage and support write access.

Specified by:
create in interface Storage
Overrides:
create in class DirectoryStorage
Parameters:
name - of Storage to be created
Returns:
Storage created
Throws:
java.io.IOException

createDir

public Storage createDir(java.lang.String name)
                  throws java.io.IOException
Description copied from interface: Storage
Creates a new directory Storage if doesn't exists yet. Note that this must be a directory Storage and support write access.

Specified by:
createDir in interface Storage
Overrides:
createDir in class DirectoryStorage
Parameters:
name - of Storage to be created
Returns:
Storage created
Throws:
java.io.IOException

getName

public java.lang.String getName()
Description copied from interface: Storage
Returns the name of this Storage (without leading directories).

Specified by:
getName in interface Storage
Returns:
name

isInJar

public boolean isInJar()
Description copied from interface: Storage
Indicates whether this Storage is contained in a zip/jar file.

Specified by:
isInJar in interface Storage
Returns:
true if in jar/zip file else false

getPath

public java.lang.String getPath()
Description copied from interface: Storage
Returns the path name of this Storage.

Specified by:
getPath in interface Storage
Returns:
path

getCanonicalPath

public java.lang.String getCanonicalPath()
Description copied from interface: Storage
Returns the canonical path name of this Storage.

Specified by:
getCanonicalPath in interface Storage
Returns:
canonical path

modDate

public long modDate()
Description copied from interface: Storage
Returns date of last modification of this Storage.

Specified by:
modDate in interface Storage
Returns:
date of modification

getProperty

public java.lang.Object getProperty(java.lang.String property)
Description copied from interface: Storage
Queries custom property associated with this Storage.

Specified by:
getProperty in interface Storage
Parameters:
property - property key
Returns:
property value

setProperty

public void setProperty(java.lang.String property,
                        java.lang.Object value)
Description copied from interface: Storage
Allows association of custom properties with this Storage.

Specified by:
setProperty in interface Storage
Parameters:
property - property key
value - property value

open

public void open()
          throws java.io.IOException
Description copied from interface: Storage
Opens a Storage for access.

Specified by:
open in interface Storage
Throws:
java.io.IOException

size

public int size()
         throws java.io.IOException
Description copied from interface: Storage
Returns the size of contents of this data Storage. Note that this must not be a directory Storage.

Specified by:
size in interface Storage
Returns:
size of Storage data in bytes
Throws:
java.io.IOException

read

public byte[] read()
            throws java.io.IOException
Description copied from interface: Storage
Reads the entire contents of this data Storage. Note that this must not be a directory Storage.

Specified by:
read in interface Storage
Returns:
byte buffer containing all data of the Storage
Throws:
java.io.IOException

read

public int read(byte[] buf)
         throws java.io.IOException
Description copied from interface: Storage
Tries to fill a buffer with data from contents of this Storage. Note that this Storage must not be a directory Storage and must have been opened before attempting to read.

Specified by:
read in interface Storage
Parameters:
buf - buffer to be filled
Returns:
actual number of bytes read
Throws:
java.io.IOException

list

public java.lang.String[] list()
Description copied from interface: Storage
Lists all names of Storages within this directory Storage. Note that this must be a directory Storage.

Specified by:
list in interface Storage

write

public void write(byte[] buf,
                  int start,
                  int len)
           throws java.io.IOException
Description copied from interface: Storage
Write the contents of a byte array into this Storage. Note that this Storage must not be a directory Storage, support write access and been opened before attempting to write.

Specified by:
write in interface Storage
Parameters:
buf - buffer to be written
start - offset within buffer where data starts
len - amount of data from buffer to be written
Throws:
java.io.IOException

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.