| java.lang.Object org.griphyn.vdl.euryale.FlatFileFactory
All known Subclasses: org.griphyn.vdl.euryale.HashedFileFactory, org.griphyn.vdl.euryale.VirtualFlatFileFactory,
FlatFileFactory | public class FlatFileFactory implements FileFactory(Code) | | This file factory generates a stream of submit files within the same
toplevel directory. There is no subdirectory structuring.
author: Kavitha Ranganathan author: Jens-S. Vöckler author: Yong Zhao version: $Revision: 289 $ See Also: DAX2DAG |
Constructor Summary | |
public | FlatFileFactory(File directory) Constructor: Creates the directory and employs sanity checks. | public | FlatFileFactory(String directory) Constructor: Creates the directory and employs sanity checks. |
Method Summary | |
public File | createFile(String basename) Virtual constructor: Creates the next file with the given basename.
Parameters: basename - is the filename to create. | public File | createFlatFile(String basename) Virtual constructor: Creates the next file with the given basename.
Parameters: basename - is the filename to create. | public File | getBaseDirectory() Returns base directory. | public int | getCount() Returns the number of times the virtual constructor for structured
files was called. | public int | getFlatCount() Returns the number of times the virtual constructor was called. | public String | getName(File file) Constructs a virtual basename by removing the directory from a
given file. | public void | reset() Resets the helper structures after changing layout parameters. | protected void | sanityCheck(File dir) Checks the destination location for existence, if it can
be created, if it is writable etc. | public void | setBaseDirectory(File base) Accessor to set a different base directory. |
FlatFileFactory | public FlatFileFactory(File directory) throws IOException(Code) | | Constructor: Creates the directory and employs sanity checks.
Parameters: directory - is the place where files should be placed. throws: IOException - if the location is not a writable directory,or cannot be created as such. |
FlatFileFactory | public FlatFileFactory(String directory) throws IOException(Code) | | Constructor: Creates the directory and employs sanity checks.
Parameters: directory - is the place where files should be placed. throws: IOException - if the location is not a writable directory,or cannot be created as such. |
createFile | public File createFile(String basename) throws IOException(Code) | | Virtual constructor: Creates the next file with the given basename.
Parameters: basename - is the filename to create. Don't specify dirs here. a File structure which points to the new file. Nothing iscreated through this method, and creation may still fail. See Also: FlatFileFactory.getCount() |
createFlatFile | public File createFlatFile(String basename) throws IOException(Code) | | Virtual constructor: Creates the next file with the given basename.
Parameters: basename - is the filename to create. Don't specify dirs here. a File structure which points to the new file. Nothing iscreated through this method, and creation may still fail. See Also: FlatFileFactory.getCount() |
getCount | public int getCount()(Code) | | Returns the number of times the virtual constructor for structured
files was called. Since this is a flat file class, it will be 0.
the count for createFile invocations. See Also: FlatFileFactory.createFile(String) |
getName | public String getName(File file)(Code) | | Constructs a virtual basename by removing the directory from a
given file. If the file's directory does not match our stored
directory prefix, nothing will be removed. This method is essential
in order to assemble relative pathnames to the base directory.
Parameters: file - is an arbitrary file, should have been constructed usingthe virtual constructor. a relative pathname with the base directory removed. Notethat may will still contain directories. In case of an arbitraryfile, the full filename may be returned. |
reset | public void reset()(Code) | | Resets the helper structures after changing layout parameters. You
will also need to call this function after you invoked the virtual
constructors, but want to change parameter pertaining to the
directory structure. The structured file count will also be reset!
|
sanityCheck | protected void sanityCheck(File dir) throws IOException(Code) | | Checks the destination location for existence, if it can
be created, if it is writable etc.
Parameters: dir - is the new base directory to optionally create |
|
|