net.sf.jfilesync.util
Class TPathWindows

java.lang.Object
  extended by net.sf.jfilesync.util.TPathControlBase
      extended by net.sf.jfilesync.util.TPathWindows
All Implemented Interfaces:
TPathControlInterface

public class TPathWindows
extends TPathControlBase


Field Summary
private  java.lang.String[] roots
           
 
Fields inherited from class net.sf.jfilesync.util.TPathControlBase
root_str
 
Constructor Summary
TPathWindows(java.lang.String[] roots, java.lang.String fileSep)
           
 
Method Summary
 java.lang.String appendDirectory(java.lang.String absolutePath, java.lang.String path)
           
 java.lang.String getNetPath(java.lang.String path)
           
 java.lang.String getPathLevelUp(java.lang.String path)
           
 java.lang.String getPrintablePath(java.lang.String currentPath)
           
 java.lang.String getRoot(java.lang.String path)
          returns the current root of a given path
 boolean isRoot(java.lang.String path)
           
 java.lang.String normalize(java.lang.String path)
          returns a valid path for a given system, if the path exists is not checked
 boolean pathEquals(java.lang.String path1, java.lang.String path2)
           
 boolean startsWithRoot(java.lang.String path)
           
 java.lang.String trimPathString(java.lang.String path)
           
 
Methods inherited from class net.sf.jfilesync.util.TPathControlBase
basename, basepath, getFileSeparator, netAppendDirectory, netPlainpath, plainpath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roots

private final java.lang.String[] roots
Constructor Detail

TPathWindows

public TPathWindows(java.lang.String[] roots,
                    java.lang.String fileSep)
Method Detail

isRoot

public boolean isRoot(java.lang.String path)
Specified by:
isRoot in interface TPathControlInterface
Overrides:
isRoot in class TPathControlBase

getPathLevelUp

public java.lang.String getPathLevelUp(java.lang.String path)
Specified by:
getPathLevelUp in interface TPathControlInterface
Overrides:
getPathLevelUp in class TPathControlBase

trimPathString

public java.lang.String trimPathString(java.lang.String path)
Specified by:
trimPathString in interface TPathControlInterface
Overrides:
trimPathString in class TPathControlBase

appendDirectory

public java.lang.String appendDirectory(java.lang.String absolutePath,
                                        java.lang.String path)
Specified by:
appendDirectory in interface TPathControlInterface
Overrides:
appendDirectory in class TPathControlBase

getNetPath

public java.lang.String getNetPath(java.lang.String path)
Specified by:
getNetPath in interface TPathControlInterface
Overrides:
getNetPath in class TPathControlBase

startsWithRoot

public boolean startsWithRoot(java.lang.String path)
Specified by:
startsWithRoot in interface TPathControlInterface
Overrides:
startsWithRoot in class TPathControlBase

pathEquals

public boolean pathEquals(java.lang.String path1,
                          java.lang.String path2)

getRoot

public java.lang.String getRoot(java.lang.String path)
Description copied from interface: TPathControlInterface
returns the current root of a given path

Specified by:
getRoot in interface TPathControlInterface
Overrides:
getRoot in class TPathControlBase
Returns:
the root of path or an empty string if path does not have a root

normalize

public java.lang.String normalize(java.lang.String path)
Description copied from interface: TPathControlInterface
returns a valid path for a given system, if the path exists is not checked

Specified by:
normalize in interface TPathControlInterface
Overrides:
normalize in class TPathControlBase

getPrintablePath

public java.lang.String getPrintablePath(java.lang.String currentPath)
Returns:
a path that can be printed on the current platform e.g. on Windows we need to substitute \ with \\