org.millscript.commons.vfs
Interface VFolder

All Superinterfaces:
VEntry
All Known Implementing Classes:
AbstractVFolder, ChrootFolder, FtpFolder, HttpFolder, LocalFolder, ReadOnlyZipFolder

public interface VFolder
extends VEntry

This interface describes a folder in the virutal filesystem.


Method Summary
 VEntry checkVEntry(java.lang.String segment)
          Returns the entry for the child with the specified name, but only if it exists and throws an exception otherwise.
 VFile checkVFile(java.lang.String segment)
          Returns the entry for the child file with the specified name, but only if it exists and throws an exception otherwise.
 VFolder checkVFolder(java.lang.String segment)
          Returns the entry for the child folder with the specified name, but only if it exists and throws an exception otherwise.
 VVolume chroot()
          Returns a new chroot'd volume with this virtual folder as its root.
 VFile getVFile(java.lang.String segment)
          Returns the entry for the child file with the specified name.
 VFolder getVFolder(java.lang.String segment)
          Returns the entry for the child folder with the specified name.
 java.util.List<VEntry> listEntries()
          Returns a list of all the child entries in this folder.
 java.util.List<VFile> listFiles()
          Returns a list of all the child files in this folder.
 java.util.List<VFolder> listFolders()
          Returns a list of all the child folders in this folder.
 VFolder make()
          Makes this folder in the volume.
 VFolder make(java.lang.String segment)
          Makes the specified folder in the volume, as a child of the current folder.
 VFile resolveAsFile(java.lang.String path)
          Resolves the specified path to a virtual file in this folder.
 VFolder resolveAsFolder(java.lang.String path)
          Resolves the specified path to a virtual folder in this folder.
 VVolume resolveAsVolume(java.lang.String path)
          Resolves the specified path to a new virtual volume, with its root at the specified resolved path.
 VFolder toLocal()
          Returns this virtual folder as a local folder, which may simply be this object.
 VVolume toVolume()
          Returns a new volume with this folder as it's root.
 
Methods inherited from interface org.millscript.commons.vfs.VEntry
appendAbsolutePath, appendAbsolutePathOnVolume, appendRelativePath, appendRelativePathOnVolume, appendURI, exists, getAbsolutePath, getAbsolutePathOnVolume, getMIMEType, getMIMETypeHandler, getName, getParent, getRelativePath, getRelativePathOnVolume, getURI, getVolume
 

Method Detail

checkVEntry

VEntry checkVEntry(java.lang.String segment)
Returns the entry for the child with the specified name, but only if it exists and throws an exception otherwise.

Parameters:
segment - the name of the required child
Returns:
the VEntry for the specified child

checkVFile

VFile checkVFile(java.lang.String segment)
Returns the entry for the child file with the specified name, but only if it exists and throws an exception otherwise.

Parameters:
segment - the name of the required child file
Returns:
the VFile for the specified child file

checkVFolder

VFolder checkVFolder(java.lang.String segment)
Returns the entry for the child folder with the specified name, but only if it exists and throws an exception otherwise.

Parameters:
segment - the name of the required child folder
Returns:
the VFolder for the specified child

chroot

VVolume chroot()
Returns a new chroot'd volume with this virtual folder as its root.

Returns:
a new ChrootVolume with this folder as its root

getVFile

VFile getVFile(java.lang.String segment)
Returns the entry for the child file with the specified name.

Parameters:
segment - the name of the required child file
Returns:
the VFile for the specified child file

getVFolder

VFolder getVFolder(java.lang.String segment)
Returns the entry for the child folder with the specified name.

Parameters:
segment - the name of the required child folder
Returns:
the VFolder for the specified child

listEntries

java.util.List<VEntry> listEntries()
Returns a list of all the child entries in this folder.

Returns:
a List of all the child entries in this folder

listFiles

java.util.List<VFile> listFiles()
Returns a list of all the child files in this folder.

Returns:
a List of all the child files in this folder.

listFolders

java.util.List<VFolder> listFolders()
Returns a list of all the child folders in this folder.

Returns:
a List of all the child folders in this folder.

make

VFolder make()
Makes this folder in the volume. This will also make any required parent folders. If this method succeeds you are guaranteed that the folder has been made.

Returns:
this folder if it was successfully made

make

VFolder make(java.lang.String segment)
Makes the specified folder in the volume, as a child of the current folder. This method will also make this folder and any required parent folders. If this method succeeds you are guaranteed that the folder has been made.

Parameters:
segment - the name for the new folder
Returns:
the VFolder for the specified folder, if it was successfully made

resolveAsFile

VFile resolveAsFile(java.lang.String path)
Resolves the specified path to a virtual file in this folder. The new file may have different parent folders.

Parameters:
path - the path to get a virtual file for
Returns:
a VFile for the specified relative URI

resolveAsFolder

VFolder resolveAsFolder(java.lang.String path)
Resolves the specified path to a virtual folder in this folder. The new folder may have different parent folders.

Parameters:
path - the path to get a virtual folder for
Returns:
a VFile for the specified relative URI

resolveAsVolume

VVolume resolveAsVolume(java.lang.String path)
Resolves the specified path to a new virtual volume, with its root at the specified resolved path. For this to work it must be possible to resolve the specified path as a folder.

Parameters:
path - the path to get a virtual volume for
Returns:
a VVolume for the specified relative URI

toLocal

VFolder toLocal()
Returns this virtual folder as a local folder, which may simply be this object. For example if this instance where a remote folder accessed over HTTP, this method should cache the folder and return a virtual folder for that local copy.

Specified by:
toLocal in interface VEntry
Returns:
a VEntry for a local copy of this entry

toVolume

VVolume toVolume()
Returns a new volume with this folder as it's root.

Returns:
a new VVolume with this folder as it's root


Copyright © 2005-2007 Open World Ltd. All Rights Reserved.