org.acm.seguin.version
Class SourceSafe

java.lang.Object
  extended by org.acm.seguin.version.SourceSafe
All Implemented Interfaces:
VersionControl

public class SourceSafe
extends java.lang.Object
implements VersionControl

Creates a process that checks out a file from source safe

Author:
Chris Seguin

Constructor Summary
SourceSafe()
          Constructor for the source safe object
 
Method Summary
 void add(java.lang.String fullFilename)
          Adds a file to version control
protected  void changeProject(java.lang.Runtime factory, java.lang.String project)
          Change to the project directory
protected  void checkin(java.lang.Runtime factory, java.lang.String file)
          Check in the file
 void checkIn(java.lang.String file)
          Check out the file from source safe
protected  void checkout(java.lang.Runtime factory, java.lang.String file)
          Check out the file
 void checkOut(java.lang.String file)
          Check out the file from source safe
protected  boolean compare(java.lang.String one, java.lang.String two)
          Compares two files
 boolean contains(java.lang.String fullFilename)
          Determines if a file is under version control
protected  java.lang.String getFilename(java.lang.String fullFilename)
          Get the filename
protected  java.lang.String getPath(java.lang.String fullFilename)
          Get the path
protected  java.lang.String getProject(java.lang.Runtime factory, java.lang.String file)
          Find the project
static void main(java.lang.String[] args)
          Main program
protected  int match(java.lang.String path, java.lang.String project)
          Matches the path to the projects
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SourceSafe

public SourceSafe()
Constructor for the source safe object

Method Detail

contains

public boolean contains(java.lang.String fullFilename)
Determines if a file is under version control

Specified by:
contains in interface VersionControl
Parameters:
fullFilename - The full path of the file
Returns:
Returns true if the files is under version control

add

public void add(java.lang.String fullFilename)
Adds a file to version control

Specified by:
add in interface VersionControl
Parameters:
fullFilename - the file to add

checkOut

public void checkOut(java.lang.String file)
Check out the file from source safe

Specified by:
checkOut in interface VersionControl
Parameters:
file - the name of the file

checkIn

public void checkIn(java.lang.String file)
Check out the file from source safe

Specified by:
checkIn in interface VersionControl
Parameters:
file - the name of the file

getProject

protected java.lang.String getProject(java.lang.Runtime factory,
                                      java.lang.String file)
                               throws java.io.IOException
Find the project

Parameters:
factory - the run time factory
file - the name of the file to find
Returns:
the name of the project or null if in no project
Throws:
java.io.IOException - is thrown if the command cannot be executed

getFilename

protected java.lang.String getFilename(java.lang.String fullFilename)
Get the filename

Parameters:
fullFilename - the fully qualified path
Returns:
the filename

getPath

protected java.lang.String getPath(java.lang.String fullFilename)
Get the path

Parameters:
fullFilename - the fully qualified path
Returns:
the path

changeProject

protected void changeProject(java.lang.Runtime factory,
                             java.lang.String project)
                      throws java.io.IOException
Change to the project directory

Parameters:
factory - the run time factory
project - the name of the project to change to
Throws:
java.io.IOException - is thrown if the command cannot be executed

checkout

protected void checkout(java.lang.Runtime factory,
                        java.lang.String file)
                 throws java.io.IOException
Check out the file

Parameters:
factory - the run time factory
file - the file that we are checking out
Throws:
java.io.IOException - is thrown if the command cannot be executed

checkin

protected void checkin(java.lang.Runtime factory,
                       java.lang.String file)
                throws java.io.IOException
Check in the file

Parameters:
factory - the run time factory
file - the file that we are checking out
Throws:
java.io.IOException - is thrown if the command cannot be executed

match

protected int match(java.lang.String path,
                    java.lang.String project)
Matches the path to the projects

Parameters:
path - the path
project - the project
Returns:
the index of the item in the roots, or -1 if not there

compare

protected boolean compare(java.lang.String one,
                          java.lang.String two)
Compares two files

Parameters:
one - the first name
two - the second name
Returns:
Description of the Returned Value

main

public static void main(java.lang.String[] args)
Main program

Parameters:
args - the command line arguments