org.jboss.virtual.plugins.context.file
Class LinkHandler

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.file.LinkHandler
All Implemented Interfaces:
Serializable, StructuredVirtualFileHandler, VirtualFileHandler

public class LinkHandler
extends AbstractURLHandler
implements StructuredVirtualFileHandler

A handler for link directories.

Version:
$Revision: 1.1 $
Author:
Scott.Stark@jboss.org
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVirtualFileHandler
cachedLastModified, log
 
Constructor Summary
LinkHandler(FileSystemContext context, VirtualFileHandler parent, URI uri, String name, List<LinkInfo> links)
          Create a new LinkHandler.
 
Method Summary
 VirtualFileHandler createChildHandler(String name)
          Create a virtual file context
protected  VirtualFileHandler createLinkHandler(VirtualFileHandler parent, String name, URI linkURI)
           
protected  void doClose()
          The real close
 VirtualFileHandler getChild(String path)
          Get a child
 List<VirtualFileHandler> getChildren(boolean ignoreErrors)
          Get the children
 boolean isLeaf()
          Whether it is a simple leaf of the VFS, i.e.
 boolean isNested()
          Are we nested in some archive.
 boolean removeChild(String name)
          Remove a child
 
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, delete, equals, getChildPathName, getChildVfsUrl, getLocalPathName, getLocalVFSContext, getName, getParent, getPathName, getRealURL, getReferences, getVFSContext, getVfsUrl, getVirtualFile, hasBeenModified, hashCode, increment, internalReplaceChild, isArchive, 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

LinkHandler

public LinkHandler(FileSystemContext context,
                   VirtualFileHandler parent,
                   URI uri,
                   String name,
                   List<LinkInfo> links)
            throws IOException,
                   URISyntaxException
Create a new LinkHandler.

Parameters:
context - the context
parent - the parent
uri - the uri
name - the name
links - the links
Throws:
IOException - for an error accessing the file system
IllegalArgumentException - for a null context, url
URISyntaxException - if the uri cannot be parsed
Method Detail

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

Specified by:
isLeaf in interface VirtualFileHandler
Returns:
true if a simple file.

isNested

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

Specified by:
isNested in interface VirtualFileHandler
Returns:
true if this is archive entry
Throws:
IOException - for any error

getChildren

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

Specified by:
getChildren in interface VirtualFileHandler
Parameters:
ignoreErrors - whether to ignore errors
Returns:
the children
Throws:
IOException - for an error accessing the file system

createChildHandler

public VirtualFileHandler createChildHandler(String name)
                                      throws IOException
Description copied from interface: StructuredVirtualFileHandler
Create a virtual file context

Specified by:
createChildHandler in interface StructuredVirtualFileHandler
Parameters:
name - the name
Returns:
the handler
Throws:
IOException - for any error accessing the virtual file system

getChild

public VirtualFileHandler getChild(String path)
                            throws IOException
Description copied from interface: VirtualFileHandler
Get a child

Specified by:
getChild in interface VirtualFileHandler
Parameters:
path - the path
Returns:
the child or null if not found
Throws:
IOException - for an error accessing the file system

removeChild

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

Specified by:
removeChild in interface VirtualFileHandler
Parameters:
name - child name
Returns:
true if child was removed, false otherwise
Throws:
IOException - if an error occurs

doClose

protected void doClose()
Description copied from class: AbstractVirtualFileHandler
The real close

Overrides:
doClose in class AbstractVirtualFileHandler

createLinkHandler

protected VirtualFileHandler createLinkHandler(VirtualFileHandler parent,
                                               String name,
                                               URI linkURI)
                                        throws IOException
Throws:
IOException


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