com.partnersoft.io.vfs
Class FileVfs

java.lang.Object
  extended by com.partnersoft.io.vfs.FileVfs
All Implemented Interfaces:
Vfs

public class FileVfs
extends java.lang.Object
implements Vfs

A Vfs implementation based on local files and directories.

Copyright 2004-2007 Partner Software, Inc.

Version:
$Id: FileVfs.java 1946 2009-06-29 13:17:15Z paul $
Author:
Paul Reavis

Constructor Summary
FileVfs()
          Create a new FileVfsModule rooted at the current working directory (generally the Partner install directory).
FileVfs(java.io.File root)
          Create a new FileVfs rooted at the given directory.
FileVfs(java.lang.String root)
          Create a new FileVfs rooted at the given path.
 
Method Summary
 VfsDirectory directoryFor(Path path)
          Returns a VfsDirectory for the given path.
 VfsDirectory directoryFor(java.lang.String subPathString)
          Returns a VfsDirectory for the given path.
 VfsFile fileFor(Path path)
          Returns a VfsFile for the given path.
 VfsFile fileFor(java.lang.String subPathString)
          Returns a VfsFile for the given path string.
 Path getAbsolutePath()
          Absolute path to the root of this Vfs.
 boolean isWritable()
          True if this module supports writing.
 java.io.File javaFileFor(Path path)
           
 void move(Path oldPath, Path newPath)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileVfs

public FileVfs(java.io.File root)
Create a new FileVfs rooted at the given directory.

Parameters:
root - root directory for Vfs

FileVfs

public FileVfs(java.lang.String root)
Create a new FileVfs rooted at the given path.

Parameters:
root - root path for Vfs

FileVfs

public FileVfs()
Create a new FileVfsModule rooted at the current working directory (generally the Partner install directory).

Method Detail

getAbsolutePath

public Path getAbsolutePath()
Description copied from interface: Vfs
Absolute path to the root of this Vfs. Meaning depends on type of Vfs.

Specified by:
getAbsolutePath in interface Vfs

isWritable

public boolean isWritable()
Description copied from interface: Vfs
True if this module supports writing.

Specified by:
isWritable in interface Vfs
Returns:
true if module is writable

fileFor

public VfsFile fileFor(Path path)
Description copied from interface: Vfs
Returns a VfsFile for the given path. Note that this does not imply that the underlying file actually exists. You may use the methods provided by the VfsFile to read and write the file's contents.

Specified by:
fileFor in interface Vfs
Parameters:
path - to file
Returns:
file for given path

directoryFor

public VfsDirectory directoryFor(Path path)
Description copied from interface: Vfs
Returns a VfsDirectory for the given path. Note that this does not imply that the underlying file actually exists. You may use the methods provided by the VfsDirectory to list and modify the directory's contents.

Specified by:
directoryFor in interface Vfs
Parameters:
path - to directory
Returns:
directory for given path

directoryFor

public VfsDirectory directoryFor(java.lang.String subPathString)
Description copied from interface: Vfs
Returns a VfsDirectory for the given path. This is the same as directoryFor(new Path(pathString).

Specified by:
directoryFor in interface Vfs
Parameters:
subPathString - string-encoded path to directory
Returns:
directory for given path

fileFor

public VfsFile fileFor(java.lang.String subPathString)
Description copied from interface: Vfs
Returns a VfsFile for the given path string. This is the same as fileFor(new Path(pathString).

Specified by:
fileFor in interface Vfs
Parameters:
subPathString - string-encoded path to file
Returns:
file for given path

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

javaFileFor

public java.io.File javaFileFor(Path path)

move

public void move(Path oldPath,
                 Path newPath)
          throws java.io.IOException
Throws:
java.io.IOException