org.jboss.virtual.plugins.context.jar
Class JarHandler

java.lang.Object
  extended by org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
      extended by org.jboss.virtual.plugins.context.AbstractURLHandler
          extended by org.jboss.virtual.plugins.context.jar.AbstractJarHandler
              extended by org.jboss.virtual.plugins.context.jar.AbstractStructuredJarHandler<Object>
                  extended by org.jboss.virtual.plugins.context.jar.JarHandler
All Implemented Interfaces:
Serializable, StructuredVirtualFileHandler, VirtualFileHandler

public class JarHandler
extends AbstractStructuredJarHandler<Object>

JarHandler.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Ales Justin
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
cachedLastModified, log
 
Constructor Summary
JarHandler(VFSContext context, VirtualFileHandler parent, File file, URL url, String name)
           
JarHandler(VFSContext context, VirtualFileHandler parent, URL url, String name)
          Create a new JarHandler.
 
Method Summary
 boolean delete(int gracePeriod)
          Delete the file represented by this handler.
 boolean isNested()
          Are we nested in some archive.
 boolean removeChild(String path)
          Remove a child
 
Methods inherited from class org.jboss.virtual.plugins.context.jar.AbstractStructuredJarHandler
buildParents, createChildHandler, createSynthenticParent, createVirtualFileHandler, extraWrapperInfo, getChild, getChildren, initJarFile, initJarFile, internalReplaceChild, isArchive
 
Methods inherited from class org.jboss.virtual.plugins.context.jar.AbstractJarHandler
fromURL, getEntry, getJar, getURL, handleJarFile, isLeaf
 
Methods inherited from class org.jboss.virtual.plugins.context.AbstractURLHandler
exists, getLastModified, getSize, getURL, initCacheLastModified, isHidden, openConnection, openConnection, openStream, toURI, toURL
 
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
checkClosed, checkParentExists, cleanup, close, decrement, doClose, equals, getChildPathName, getChildVfsUrl, getLocalPathName, getLocalVFSContext, getName, getParent, getPathName, getRealURL, getReferences, getVFSContext, getVfsUrl, getVirtualFile, hasBeenModified, hashCode, increment, isTemporary, replaceChild, setPathName, setVfsUrl, simpleFindChild, structuredFindChild, toInternalVfsUrl, toString, toStringLocal, toVfsUrl
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JarHandler

public JarHandler(VFSContext context,
                  VirtualFileHandler parent,
                  URL url,
                  String name)
           throws IOException
Create a new JarHandler.

Parameters:
context - the context
parent - the parent
url - the url
name - the name
Throws:
IOException - for an error accessing the file system
IllegalArgumentException - for a null context, url or vfsPath

JarHandler

public JarHandler(VFSContext context,
                  VirtualFileHandler parent,
                  File file,
                  URL url,
                  String name)
           throws IOException
Throws:
IOException
Method Detail

removeChild

public boolean removeChild(String path)
                    throws IOException
Description copied from interface: VirtualFileHandler
Remove a child

Parameters:
path - child name
Returns:
true if child was removed, false otherwise
Throws:
IOException - if an error occurs

delete

public boolean delete(int gracePeriod)
               throws IOException
Description copied from class: AbstractVirtualFileHandler
Delete the file represented by this handler. File deletion is comprised of two parts:
  1. physical file deletion - performed by this method or its override
  2. removal of any child references from the parent - performed by VirtualFileHandler.removeChild(String) of the parent
This method doesn't do any physical file removal because it has no concept of underlying physical file. An implementation that does physical file removal should override this method and call super.delete() at the end.

Specified by:
delete in interface VirtualFileHandler
Overrides:
delete in class AbstractVirtualFileHandler
Parameters:
gracePeriod - max time to wait for any locks
Returns:
true if file was deleted, false otherwise
Throws:
IOException - if an error occurs

isNested

public boolean isNested()
                 throws IOException
Description copied from interface: VirtualFileHandler
Are we nested in some archive.

Returns:
true if this is archive entry
Throws:
IOException - for any error


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