net.sf.cotta
Class TEntry

java.lang.Object
  extended by net.sf.cotta.TEntry
All Implemented Interfaces:
java.lang.Comparable<TEntry>
Direct Known Subclasses:
TDirectory, TFile

public abstract class TEntry
extends java.lang.Object
implements java.lang.Comparable<TEntry>

Entry instance that represents either a file or a directory.


Field Summary
protected  TPath path
           
 
Constructor Summary
TEntry(FileSystem fileSystem, TPath path)
          Deprecated. use the other constructor for default encoding support through TFactory
TEntry(TFileFactory factory, TPath path)
           
 
Method Summary
 int compareTo(TEntry that)
           
 boolean equals(java.lang.Object o)
           
abstract  boolean exists()
           
 TFileFactory factory()
           
protected  FileSystem filesystem()
           
 int hashCode()
           
 boolean isChildOf(TDirectory directory)
           
 java.lang.String name()
           
 TDirectory parent()
           
 java.lang.String path()
          Ssystem specific path string For example, on physical system the path separator will be OS specific
 TPath pathFrom(TDirectory directory)
           
 java.lang.String toCanonicalPath()
           
 java.io.File toJavaFile()
          Converts the instance to java.io.File.
 TPath toPath()
           
 java.lang.String toPathString()
          Alias of path() which returns system specific path string For example, on physical system the path separator will be OS specific
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

path

protected TPath path
Constructor Detail

TEntry

public TEntry(FileSystem fileSystem,
              TPath path)
Deprecated. use the other constructor for default encoding support through TFactory

Create an instance of TEntry

Parameters:
fileSystem - file system backing the entry
path - path for the entry
See Also:
TEntry(TFileFactory, TPath)

TEntry

public TEntry(TFileFactory factory,
              TPath path)
Method Detail

isChildOf

public boolean isChildOf(TDirectory directory)

pathFrom

public TPath pathFrom(TDirectory directory)

name

public java.lang.String name()

parent

public TDirectory parent()

toCanonicalPath

public java.lang.String toCanonicalPath()

factory

public TFileFactory factory()

filesystem

protected FileSystem filesystem()

toPath

public TPath toPath()

toPathString

public java.lang.String toPathString()
Alias of path() which returns system specific path string For example, on physical system the path separator will be OS specific

Returns:
path string
See Also:
path()

toJavaFile

public java.io.File toJavaFile()
Converts the instance to java.io.File. This is used to integrate with the system that uses java.io.File

Returns:
The java.io.File instance of the current file
Throws:
java.lang.RuntimeException - if the underlying file system is not a normal file system.

path

public java.lang.String path()
Ssystem specific path string For example, on physical system the path separator will be OS specific

Returns:
path string
See Also:
toPathString()

toString

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

exists

public abstract boolean exists()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(TEntry that)
Specified by:
compareTo in interface java.lang.Comparable<TEntry>