com.faunos.util.test
Class AbbreviatedFilepath

java.lang.Object
  extended by com.faunos.util.test.AbbreviatedFilepath

public class AbbreviatedFilepath
extends Object

Utility for creating an abbreviated string representation of a file path.

Author:
Babak Farhang
See Also:
toString()

Constructor Summary
AbbreviatedFilepath(File file)
          Creates a new instance with default depth of 3.
AbbreviatedFilepath(File file, int depth)
          Creates a new instance with the given (depth) number of subpath tokens.
 
Method Summary
 String toString()
          Returns the abbreviated file path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbbreviatedFilepath

public AbbreviatedFilepath(File file)
Creates a new instance with default depth of 3.

See Also:
AbbreviatedFilepath(File, int)

AbbreviatedFilepath

public AbbreviatedFilepath(File file,
                           int depth)
Creates a new instance with the given (depth) number of subpath tokens.

Throws:
IllegalArgumentException - if depth is < 1 or > 1024
Method Detail

toString

public String toString()
Returns the abbreviated file path. For an instance created with depth 3 (the default), this is of the form .../path1/path2/filename.

Overrides:
toString in class Object


SourceForge.net Logo