oscript.fs
Class JarFileSystem

java.lang.Object
  extended byoscript.fs.AbstractFileSystem
      extended byoscript.fs.JarFileSystem

public class JarFileSystem
extends AbstractFileSystem

A JarFileSystem implements a filesystem on top of a .jar or .zip file.

Version:
1.21
Author:
Rob Clark (rob@ti.com)

Nested Class Summary
 
Nested classes inherited from class oscript.fs.AbstractFileSystem
AbstractFileSystem.BogusFile, AbstractFileSystem.MountPointFile
 
Field Summary
 
Fields inherited from class oscript.fs.AbstractFileSystem
SEPERATOR_CHAR
 
Constructor Summary
JarFileSystem(java.io.File root)
          Class Constructor.
JarFileSystem(java.io.File root, boolean autoflush)
          Class Constructor.
JarFileSystem(java.lang.String root)
          Class Constructor.
 
Method Summary
protected  java.util.Collection childrenInFileSystem(java.lang.String mountPath, java.lang.String path)
          Return an iterator of children of the specified path.
protected  void finalize()
           
 void flush()
          If any changes have been made, flush them out to disk.
protected  AbstractFile resolveInFileSystem(java.lang.String mountPath, java.lang.String path)
          Try to resolve the specified path.
 
Methods inherited from class oscript.fs.AbstractFileSystem
basename, children, children, dirname, getCwd, lastModified, mount, normalize, normalize, resolve, setCwd, touchMountPoint
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarFileSystem

public JarFileSystem(java.io.File root)
              throws java.util.zip.ZipException,
                     java.io.IOException
Class Constructor.

Parameters:
root - the root of the local filesystem

JarFileSystem

public JarFileSystem(java.io.File root,
                     boolean autoflush)
              throws java.util.zip.ZipException,
                     java.io.IOException
Class Constructor.

Parameters:
root - the root of the local filesystem
autoflush - if true automatically flush the entire filesystem. Note that flushing entire filesystem to disk involves writing the entire jar file, and can be expensive

JarFileSystem

public JarFileSystem(java.lang.String root)
              throws java.util.zip.ZipException,
                     java.io.IOException
Class Constructor.

Parameters:
root - the root of the local filesystem
Method Detail

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

flush

public void flush()
           throws java.io.IOException
If any changes have been made, flush them out to disk.

Specified by:
flush in class AbstractFileSystem
Throws:
java.io.IOException

resolveInFileSystem

protected AbstractFile resolveInFileSystem(java.lang.String mountPath,
                                           java.lang.String path)
Try to resolve the specified path. If unresolved, return null.

Specified by:
resolveInFileSystem in class AbstractFileSystem
Parameters:
mountPath - the path this fs is mounted at to resolve the requested file
path - path to file
Returns:
file or null

childrenInFileSystem

protected java.util.Collection childrenInFileSystem(java.lang.String mountPath,
                                                    java.lang.String path)
                                             throws java.io.IOException
Return an iterator of children of the specified path.

Specified by:
childrenInFileSystem in class AbstractFileSystem
Parameters:
mountPath - the path this fs is mounted at to resolve the requested file
path - path to file, relative to mountPath
Returns:
a collection of AbstractFile
Throws:
java.io.IOException