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 cleanup()
          Cleanup on cache eviction.
 void cleanupTempInfo(java.lang.String path)
          Cleanup all temp infos under path param.
 VirtualFileHandler getChild(VirtualFileHandler parent, java.lang.String path)
          Get a child
 java.util.List<VirtualFileHandler> getChildren(VirtualFileHandler parent, boolean ignoreErrors)
          Get the children
 java.util.Set<VFSContextConstraints> getConstraints()
          Get context's constraints.
 ExceptionHandler getExceptionHandler()
          Get the exception handler.
 TempInfo getFurthestParentTemp(java.lang.String path)
          Retrieve the furthest (outter most) temp which contains this path.
 java.lang.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.
 java.net.URI getRootURI()
          Get the root uri
 TempInfo getTempInfo(java.lang.String path)
          Get exact temp info match.
 java.lang.Iterable<TempInfo> getTempInfos()
          Deprecated.  
 TempStore getTempStore()
          Get temp store.
 VFS getVFS()
          Get the VFS for this context
 void setExceptionHandler(ExceptionHandler exceptionHandler)
          Set exception handler.
 void setTempStore(TempStore store)
          Set temp store.
 void visit(VirtualFileHandler handler, VirtualFileHandlerVisitor visitor)
          Visit the virtual file system
 

Method Detail

getConstraints

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

Returns:
the constraints

getName

java.lang.String getName()
Get the name.

Returns:
the name

getRootURI

java.net.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 java.io.IOException
Return the root virtual file

Returns:
the root
Throws:
java.io.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

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

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

getChild

VirtualFileHandler getChild(VirtualFileHandler parent,
                            java.lang.String path)
                            throws java.io.IOException
Get a child

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

visit

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

Parameters:
handler - the reference handler
visitor - the visitor
Throws:
java.io.IOException - for any error
java.lang.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(java.lang.String path)
Get exact temp info match.

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

getTempInfos

java.lang.Iterable<TempInfo> getTempInfos()
Deprecated. 

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

Returns:
ordered temp infos

getFurthestParentTemp

TempInfo getFurthestParentTemp(java.lang.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(java.lang.String path)
Cleanup all temp infos under path param.

Parameters:
path - the path to cleanup

setTempStore

void setTempStore(TempStore store)
Set temp store.

Parameters:
store - the store

getTempStore

TempStore getTempStore()
Get temp store.

Returns:
the temp store

cleanup

void cleanup()
Cleanup on cache eviction.