com.ice.cvsc
Class CVSCUtilities

java.lang.Object
  |
  +--com.ice.cvsc.CVSCUtilities

public class CVSCUtilities
extends java.lang.Object

Implements several general utility methods used by the cvs client package.

Version:
$Revision: 2.11 $
Author:
Timothy Gerard Endres, time@ice.com.

Field Summary
static java.lang.String RCS_ID
           
static java.lang.String RCS_REV
           
 
Constructor Summary
CVSCUtilities()
           
 
Method Summary
static boolean caseSensitivePathNames()
           
static int computeTranslation(CVSEntry entry)
           
static boolean createEmptyFile(java.io.File f)
           
static void endRedirectOutput()
           
static java.lang.String ensureFinalSlash(java.lang.String path)
           
static java.lang.String exportPath(java.lang.String path)
           
static java.lang.String getLocalParent(java.lang.String localDir)
          Given a localDirectory from a CVSEntry, get the parent directory of the localDirectory.
static java.lang.String importPath(java.lang.String path)
           
static void integrateEntriesLog(java.io.File adminDir)
           
static boolean isSubpathInPath(java.lang.String rootPath, java.lang.String subPath)
          This class method determines if a path exists 'within' another path.
static java.lang.String readStringFile(java.io.File f)
           
static int slashCount(java.lang.String s)
           
static java.lang.String stripFinalSeparator(java.lang.String path)
           
static java.lang.String stripFinalSlash(java.lang.String path)
           
static void writeStringFile(java.io.File f, java.lang.String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

RCS_REV

public static final java.lang.String RCS_REV
See Also:
Constant Field Values
Constructor Detail

CVSCUtilities

public CVSCUtilities()
Method Detail

caseSensitivePathNames

public static boolean caseSensitivePathNames()

isSubpathInPath

public static boolean isSubpathInPath(java.lang.String rootPath,
                                      java.lang.String subPath)
This class method determines if a path exists 'within' another path. In the cvsc package, we are constantly checking to be sure that a directory is contained within a given tree, or that a file is in the correct path. The difficulty is that each platform has different path separators and 'case' requirements. Worse, on systems like Windoze, the user can type lower case, while the FileDialog returns what may be upper case on the file system. This method is an attempt to normalize all of this.

Returns:
True if subPath is a subdirectory of path.

computeTranslation

public static int computeTranslation(CVSEntry entry)

exportPath

public static java.lang.String exportPath(java.lang.String path)

importPath

public static java.lang.String importPath(java.lang.String path)

ensureFinalSlash

public static java.lang.String ensureFinalSlash(java.lang.String path)

stripFinalSlash

public static java.lang.String stripFinalSlash(java.lang.String path)

stripFinalSeparator

public static java.lang.String stripFinalSeparator(java.lang.String path)

getLocalParent

public static java.lang.String getLocalParent(java.lang.String localDir)
Given a localDirectory from a CVSEntry, get the parent directory of the localDirectory.


slashCount

public static int slashCount(java.lang.String s)

createEmptyFile

public static boolean createEmptyFile(java.io.File f)

writeStringFile

public static void writeStringFile(java.io.File f,
                                   java.lang.String str)
                            throws java.io.IOException
java.io.IOException

readStringFile

public static java.lang.String readStringFile(java.io.File f)
                                       throws java.io.IOException
java.io.IOException

endRedirectOutput

public static void endRedirectOutput()

integrateEntriesLog

public static void integrateEntriesLog(java.io.File adminDir)
                                throws java.io.IOException
java.io.IOException


Copyright © 1997-2003, Timothy G. Endres, All Rights Reserved.