org.jboss.virtual.plugins.context.jar
Class NestedJarFromStream.JarEntryContents

java.lang.Object
  extended by org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
      extended by org.jboss.virtual.plugins.context.jar.NestedJarFromStream.JarEntryContents
All Implemented Interfaces:
Serializable, VirtualFileHandler
Enclosing class:
NestedJarFromStream

public static class NestedJarFromStream.JarEntryContents
extends AbstractVirtualFileHandler

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
cachedLastModified, log, vfsUrl
 
Method Summary
 void close()
          Close the resources
 boolean exists()
          TODO: removing the entry/jar that resulted in this needs to be detected.
 VirtualFileHandler findChild(String path)
          Find a child
 List<VirtualFileHandler> getChildren(boolean ignoreErrors)
          Get the children
 byte[] getContents()
           
 ZipEntry getEntry()
           
 long getLastModified()
          When the file was last modified
 String getName()
          Get the simple VF name (X.java)
 String getPathName()
          Get the VFS relative path name (org/jboss/X.java)
 long getSize()
          Get the size
 boolean isHidden()
          Whether it is hidden
 boolean isLeaf()
          Whether it is a simple leaf of the VFS, i.e.
 InputStream openStream()
          Access the file contents.
 String toString()
           
 URI toURI()
          Get the VF URI (file://root/org/jboss/X.java)
 
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
checkClosed, decrement, doClose, equals, getParent, getVFSContext, getVirtualFile, hasBeenModified, hashCode, increment, setPathName, simpleFindChild, structuredFindChild, toURL, toVfsUrl
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

exists

public boolean exists()
               throws IOException
TODO: removing the entry/jar that resulted in this needs to be detected.

Returns:
true if the file exists, false otherwise.
Throws:
IOException - - thrown on failure to detect existence.

isHidden

public boolean isHidden()
                 throws IOException
Description copied from interface: VirtualFileHandler
Whether it is hidden

Returns:
true if hidden.
Throws:
IOException - for any problem accessing the virtual file system

getEntry

public ZipEntry getEntry()

getContents

public byte[] getContents()

getName

public String getName()
Description copied from interface: VirtualFileHandler
Get the simple VF name (X.java)

Specified by:
getName in interface VirtualFileHandler
Overrides:
getName in class AbstractVirtualFileHandler
Returns:
the simple file name

getPathName

public String getPathName()
Description copied from interface: VirtualFileHandler
Get the VFS relative path name (org/jboss/X.java)

Specified by:
getPathName in interface VirtualFileHandler
Overrides:
getPathName in class AbstractVirtualFileHandler
Returns:
the VFS relative path name

getChildren

public List<VirtualFileHandler> getChildren(boolean ignoreErrors)
                                     throws IOException
Description copied from interface: VirtualFileHandler
Get the children

Parameters:
ignoreErrors - whether to ignore errors
Returns:
the children
Throws:
IOException - for an error accessing the file system

findChild

public VirtualFileHandler findChild(String path)
                             throws IOException
Description copied from interface: VirtualFileHandler
Find a child

Parameters:
path - the path
Returns:
the child
Throws:
IOException - for an error accessing the file system (or the child doesn't exist)

getLastModified

public long getLastModified()
Description copied from interface: VirtualFileHandler
When the file was last modified

Returns:
the last modified time

getSize

public long getSize()
Description copied from interface: VirtualFileHandler
Get the size

Returns:
the size

isLeaf

public boolean isLeaf()
Description copied from interface: VirtualFileHandler
Whether it is a simple leaf of the VFS, i.e. whether it can contain other files

Returns:
true if a simple file.

openStream

public InputStream openStream()
                       throws IOException
Description copied from interface: VirtualFileHandler
Access the file contents.

Returns:
An InputStream for the file contents.
Throws:
IOException - for any problem accessing the virtual file system

close

public void close()
Description copied from interface: VirtualFileHandler
Close the resources

Specified by:
close in interface VirtualFileHandler
Overrides:
close in class AbstractVirtualFileHandler

toURI

public URI toURI()
          throws URISyntaxException
Description copied from interface: VirtualFileHandler
Get the VF URI (file://root/org/jboss/X.java)

Returns:
the full URI to the VF in the VFS.
Throws:
URISyntaxException - for an error parsing the URI

toString

public String toString()
Overrides:
toString in class AbstractVirtualFileHandler


Copyright © 2007 JBoss, A division of Red Hat, Inc. All Rights Reserved.