org.jboss.virtual.spi
Interface VFSContext

All Known Implementing Classes:
AbstractVFSContext, AssembledContext, FileSystemContext, JarContext, MemoryContext, TempContext, ZipEntryContext

public interface VFSContext

A virtual file context

Version:
$Revision: 55466 $
Author:
Scott.Stark@jboss.org, adrian@jboss.org, ales.justin@jboss.org

Method Summary
 void addTempInfo(TempInfo tempInfo)
          Add temp info.
 void cleanupTempInfo(String path)
          Cleanup all temp infos under path param.
 VirtualFileHandler getChild(VirtualFileHandler parent, String path)
          Get a child
 List<VirtualFileHandler> getChildren(VirtualFileHandler parent, boolean ignoreErrors)
          Get the children
 Set<VFSContextConstraints> getConstraints()
          Get context's constraints.
 ExceptionHandler getExceptionHandler()
          Get the exception handler.
 TempInfo getFurthestParentTemp(String path)
          Retrieve the furthest (outter most) temp which contains this path.
 String getName()
          Get the name.
 Options getOptions()
          Get options.
 VirtualFileHandler getRoot()
          Return the root virtual file
 VirtualFileHandler getRootPeer()
          Return the peer representing the root of this context within another context.
 URI getRootURI()
          Get the root uri
 TempInfo getTempInfo(String path)
          Get exact temp info match.
 Iterable<TempInfo> getTempInfos()
          Deprecated.  
 VFS getVFS()
          Get the VFS for this context
 void setExceptionHandler(ExceptionHandler exceptionHandler)
          Set exception handler.
 void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor)
          Visit the virtual file system
 

Method Detail

getConstraints

Set<VFSContextConstraints> getConstraints()
Get context's constraints.

Returns:
the constraints

getName

String getName()
Get the name.

Returns:
the name

getRootURI

URI getRootURI()
Get the root uri

Returns:
the root uri

getVFS

VFS getVFS()
Get the VFS for this context

Returns:
the vfs

getRoot

VirtualFileHandler getRoot()
                           throws IOException
Return the root virtual file

Returns:
the root
Throws:
IOException - for any problem accessing the VFS

getRootPeer

VirtualFileHandler getRootPeer()
Return the peer representing the root of this context within another context. Used when mounting contexts within other contexts

Returns:
the root peer

getOptions

Options getOptions()
Get options.

Returns:
the options

getChildren

List<VirtualFileHandler> getChildren(VirtualFileHandler parent,
                                     boolean ignoreErrors)
                                     throws IOException
Get the children

Parameters:
parent - the parent
ignoreErrors - whether to ignore errors
Returns:
the children
Throws:
IOException - for any problem accessing the VFS
IllegalArgumentException - for a null parent

getChild

VirtualFileHandler getChild(VirtualFileHandler parent,
                            String path)
                            throws IOException
Get a child

Parameters:
parent - the parent
path - the path
Returns:
the child or null if not found
Throws:
IOException - for any problem accessing the VFS
IllegalArgumentException - for a null parent or name

visit

void visit(VirtualFileHandler handler,
           VirtualFileHandlerVisitor visitor)
           throws IOException
Visit the virtual file system

Parameters:
handler - the reference handler
visitor - the visitor
Throws:
IOException - for any error
IllegalArgumentException - if the handler or visitor is null

getExceptionHandler

ExceptionHandler getExceptionHandler()
Get the exception handler.

Returns:
the exception handler

setExceptionHandler

void setExceptionHandler(ExceptionHandler exceptionHandler)
Set exception handler.

Parameters:
exceptionHandler - the exception handler.

addTempInfo

void addTempInfo(TempInfo tempInfo)
Add temp info.

Parameters:
tempInfo - the temp info

getTempInfo

TempInfo getTempInfo(String path)
Get exact temp info match.

Parameters:
path - the path to match
Returns:
temp info instance or null if not found

getTempInfos

Iterable<TempInfo> getTempInfos()
Deprecated. 

Iterate over all temp infos. This should return lexicographically ordered temp infos.

Returns:
ordered temp infos

getFurthestParentTemp

TempInfo getFurthestParentTemp(String path)
Retrieve the furthest (outter most) temp which contains this path. Ex. if there is /a/b, /a/b/c, and /a/b/c/d, you get /a/b.

Parameters:
path - the path to match
Returns:
the furthest parent

cleanupTempInfo

void cleanupTempInfo(String path)
Cleanup all temp infos under path param.

Parameters:
path - the path to cleanup


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