allensoft.javacvs.client
Class CVSUtilities

java.lang.Object
  |
  +--allensoft.javacvs.client.CVSUtilities

public class CVSUtilities
extends java.lang.Object

A collection of useful utility functions.


Method Summary
static java.io.File getFileFromRelativePath(java.io.File currentDirectory, java.lang.String sRelativePath)
          Gets a file from a relative path received from the server (Unix notation).
static java.lang.String getRelativePath(java.io.File currentDirectory, java.io.File file)
          Gets the relative path from a current directory to the supplied file in Unix notation.
static boolean isUnderCVSControl(java.io.File file)
          Checks if the supplied file is under CVS control.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getRelativePath

public static java.lang.String getRelativePath(java.io.File currentDirectory,
                                               java.io.File file)
Gets the relative path from a current directory to the supplied file in Unix notation. As Unix notation is used for the CVS protocol (regardless of the client OS) this method mainly exists to get relative paths for use in the protocol. The relative path is not necessarily useful on the Client OS (unless of course it is Unix too).

getFileFromRelativePath

public static java.io.File getFileFromRelativePath(java.io.File currentDirectory,
                                                   java.lang.String sRelativePath)
Gets a file from a relative path received from the server (Unix notation).

isUnderCVSControl

public static boolean isUnderCVSControl(java.io.File file)
Checks if the supplied file is under CVS control. If the file is a directory it checks to see if the directory is a working directory. Otherwise it checks if there is an entry in an Entries file for the file.