classUtils.pack.util
Class PrefixPrintWriter.DirectoryPrefixProvider

java.lang.Object
  extended by classUtils.pack.util.PrefixPrintWriter.DirectoryPrefixProvider
All Implemented Interfaces:
PrefixProvider
Enclosing class:
PrefixPrintWriter

public static final class PrefixPrintWriter.DirectoryPrefixProvider
extends java.lang.Object
implements PrefixProvider

A prefix provider to showAndRegister the current directory as a prefix.

Optionally, a certain directory can be indicated to be substituted with a "tilde" (~) charachter in the prefix. The substitution occurs only when the current directory is the given one ora a subdirectory of the given one (i.e., the current directory path starts or equals the the given one's path).


Constructor Summary
PrefixPrintWriter.DirectoryPrefixProvider()
          Create a prefix provider which shows the absolute path name of the current directory
PrefixPrintWriter.DirectoryPrefixProvider(java.io.File tildeValue)
          Create a prefix provider which shows the absolute path name of the current directory, substituting the given directory with a 'tilde' (~) charachter.
 
Method Summary
 java.lang.String getPrefix()
          Return a string to prefix to the stream lines.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixPrintWriter.DirectoryPrefixProvider

public PrefixPrintWriter.DirectoryPrefixProvider()
Create a prefix provider which shows the absolute path name of the current directory


PrefixPrintWriter.DirectoryPrefixProvider

public PrefixPrintWriter.DirectoryPrefixProvider(java.io.File tildeValue)
Create a prefix provider which shows the absolute path name of the current directory, substituting the given directory with a 'tilde' (~) charachter.

Parameters:
tildeValue - the directory that must be substituted with a tilde
Throws:
java.lang.RuntimeException - if the given File is not a directory
Method Detail

getPrefix

public java.lang.String getPrefix()
Return a string to prefix to the stream lines.

Specified by:
getPrefix in interface PrefixProvider
Returns:
a string to prefix to the stream lines.