com.partnersoft.platform.webstart
Class WebstartVfs

java.lang.Object
  extended by com.partnersoft.platform.webstart.WebstartVfs
All Implemented Interfaces:
Vfs

public class WebstartVfs
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 1330 2008-05-08 19:17:43Z paul $
Author:
Paul Reavis

Constructor Summary
WebstartVfs(java.lang.String root)
          Create a new FileVfs rooted at the given path.
WebstartVfs(java.net.URL root)
          Create a new FileVfs rooted at the given directory.
 
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.
 void move(Path oldPath, Path newPath)
           
 java.lang.String toString()
           
 java.net.URL urlForDirectory(Path path)
           
 java.net.URL urlForFile(Path path)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WebstartVfs

public WebstartVfs(java.net.URL root)
Create a new FileVfs rooted at the given directory.

Parameters:
root - root directory for Vfs

WebstartVfs

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

Parameters:
root - root path for Vfs
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

urlForFile

public java.net.URL urlForFile(Path path)

urlForDirectory

public java.net.URL urlForDirectory(Path path)

move

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