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

java.lang.Object
  extended by org.jboss.virtual.plugins.context.AbstractVFSContext
      extended by org.jboss.virtual.plugins.context.file.FileSystemContext
All Implemented Interfaces:
VFSContext
Direct Known Subclasses:
TempContext

public class FileSystemContext
extends AbstractVFSContext

FileSystemContext. Jar archives are processed through ZipEntryContext. To switch back to JarHandler set a system property jboss.vfs.forceVfsJar=true Explicit case sensitive path checking can be turned on by adding an option parameter ?caseSensitive=true to context URL. This may be desired when native filesystem is not case sensitive (i.e. if running on Windows). Case sesitivity can be turned on for all context URLs by setting system property jboss.vfs.forceCaseSensitive=true.

Version:
$Revision: 1.1 $
Author:
Adrian Brock, Ales Justin, Marko Strukelj

Field Summary
protected static org.jboss.logging.Logger staticLog
           
 
Fields inherited from class org.jboss.virtual.plugins.context.AbstractVFSContext
log
 
Constructor Summary
FileSystemContext(File file)
          Create a new FileSystemContext.
FileSystemContext(URI rootURI)
          Create a new FileSystemContext.
FileSystemContext(URL rootURL)
          Create a new FileSystemContext.
 
Method Summary
 VirtualFileHandler createVirtualFileHandler(VirtualFileHandler parent, File file)
          Create a new virtual file handler
 VirtualFileHandler createVirtualFileHandler(VirtualFileHandler parent, File file, URI uri)
          Create a new virtual file handler
protected  boolean exists(File file)
          Tests if file exists taking case sensitivity into account - if it's enabled
 Set<VFSContextConstraints> getConstraints()
          Get context's constraints.
 String getName()
          Get the name.
 VirtualFileHandler getRoot()
          Return the root virtual file
 boolean isForcedCaseSensitive()
          Is forceCaseSensitive enabled Only relevant for native filesystems that are not case sensitive
protected  DelegatingHandler mountZipFS(VirtualFileHandler parent, String name, File file)
          Create zip file system.
 
Methods inherited from class org.jboss.virtual.plugins.context.AbstractVFSContext
addTempInfo, cleanupTempInfo, createNewOptions, equals, getChild, getChildren, getChildURL, getExceptionHandler, getFurthestParentTemp, getOption, getOption, getOption, getOptions, getPeerContext, getRootPeer, getRootURI, getTempInfo, getTempInfos, getVFS, hashCode, setExceptionHandler, setOption, setOptionsToURL, setRootPeer, toString, visit, visit
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

staticLog

protected static final org.jboss.logging.Logger staticLog
Constructor Detail

FileSystemContext

public FileSystemContext(URL rootURL)
                  throws IOException,
                         URISyntaxException
Create a new FileSystemContext.

Parameters:
rootURL - the root url
Throws:
IOException - for an error accessing the file system
URISyntaxException - for an error parsing the uri

FileSystemContext

public FileSystemContext(URI rootURI)
                  throws IOException,
                         URISyntaxException
Create a new FileSystemContext.

Parameters:
rootURI - the root uri
Throws:
IOException - for an error accessing the file system
URISyntaxException - if cannot create URI

FileSystemContext

public FileSystemContext(File file)
                  throws IOException,
                         URISyntaxException
Create a new FileSystemContext.

Parameters:
file - the root file
Throws:
IOException - for an error accessing the file system
IllegalArgumentException - for a null file
URISyntaxException - for an error parsing the uri
Method Detail

getConstraints

public Set<VFSContextConstraints> getConstraints()
Description copied from interface: VFSContext
Get context's constraints.

Specified by:
getConstraints in interface VFSContext
Overrides:
getConstraints in class AbstractVFSContext
Returns:
the constraints

getName

public String getName()
Description copied from interface: VFSContext
Get the name.

Returns:
the name

getRoot

public VirtualFileHandler getRoot()
                           throws IOException
Description copied from interface: VFSContext
Return the root virtual file

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

createVirtualFileHandler

public VirtualFileHandler createVirtualFileHandler(VirtualFileHandler parent,
                                                   File file)
                                            throws IOException
Create a new virtual file handler

Parameters:
parent - the parent
file - the file
Returns:
the handler
Throws:
IOException - for any error accessing the file system
IllegalArgumentException - for a null file

mountZipFS

protected DelegatingHandler mountZipFS(VirtualFileHandler parent,
                                       String name,
                                       File file)
                                throws IOException,
                                       URISyntaxException
Create zip file system.

Parameters:
parent - the parent
name - the name
file - the file
Returns:
new zip fs delegating handler
Throws:
IOException - for any error
URISyntaxException - for any URI syntax error

createVirtualFileHandler

public VirtualFileHandler createVirtualFileHandler(VirtualFileHandler parent,
                                                   File file,
                                                   URI uri)
                                            throws IOException
Create a new virtual file handler

Parameters:
parent - the parent
file - the file
uri - the uri
Returns:
the handler
Throws:
IOException - for any error accessing the file system
IllegalArgumentException - for a null file

exists

protected boolean exists(File file)
                  throws IOException
Tests if file exists taking case sensitivity into account - if it's enabled

Parameters:
file - file to check
Returns:
true if file exists
Throws:
IOException - for any error

isForcedCaseSensitive

public boolean isForcedCaseSensitive()
Is forceCaseSensitive enabled Only relevant for native filesystems that are not case sensitive

Returns:
true if case sensitivity is enabled


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