uk.ac.ed.inf.ogsaconfig.garm
Class VFile

java.lang.Object
  |
  +--uk.ac.ed.inf.ogsaconfig.garm.VFile
Direct Known Subclasses:
ConcreteVFile, GeneratedVFile, LookupVFile, MetaVFile

public abstract class VFile
extends java.lang.Object

A VFile is an abstract representation of a file used by GARM. A VFile is always a member of a file collection. Each file has the properties of a normal filesystem file, with the addition of a type identifier showing its semantic classification (if the collection it forms part of is typed)


Constructor Summary
VFile()
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Returns true if the two VFiles have the same name, hierarchy and type
 int hashCode()
          Hashing is on name only to ensure HashSets behave as expected (not storing multiple equal files)
static boolean hierarchiesEqual(java.io.File hier1, java.io.File hier2)
          Returns true if the files have the same hierarchies
abstract  java.io.File hierarchy()
          Returns the hierarchy of the file in the filesystem
static boolean isEmptyHierarchy(java.io.File hier)
          Returns true if the hierarchy of the file is empty
abstract  java.lang.String name()
          Returns the name of the file
abstract  FileCollection source()
          Returns the file collection from which this file originates
abstract  java.io.InputStream stream()
          Returns an InputStream from which the file itself can be read
abstract  java.util.Date time()
          Returns the modification time of the file.
abstract  FileType type()
          Returns the semantic type of the file
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VFile

public VFile()
Method Detail

time

public abstract java.util.Date time()
Returns the modification time of the file. Used for freshness testing


stream

public abstract java.io.InputStream stream()
                                    throws java.io.IOException
Returns an InputStream from which the file itself can be read

java.io.IOException

name

public abstract java.lang.String name()
Returns the name of the file


hierarchy

public abstract java.io.File hierarchy()
Returns the hierarchy of the file in the filesystem


type

public abstract FileType type()
Returns the semantic type of the file


source

public abstract FileCollection source()
Returns the file collection from which this file originates


isEmptyHierarchy

public static boolean isEmptyHierarchy(java.io.File hier)
Returns true if the hierarchy of the file is empty


hierarchiesEqual

public static final boolean hierarchiesEqual(java.io.File hier1,
                                             java.io.File hier2)
Returns true if the files have the same hierarchies


equals

public final boolean equals(java.lang.Object o)
Returns true if the two VFiles have the same name, hierarchy and type

Overrides:
equals in class java.lang.Object

hashCode

public final int hashCode()
Hashing is on name only to ensure HashSets behave as expected (not storing multiple equal files)

Overrides:
hashCode in class java.lang.Object