net.sourceforge.cvsgrab
Class LocalRepository

java.lang.Object
  extended by net.sourceforge.cvsgrab.LocalRepository

public class LocalRepository
extends Object

The local repository where the files are stored on this computer.

Version:
1.0
Author:
Ludovic Claude
Created:
April 19, 2002

Field Summary
static int UPDATE_IMPOSSIBLE
           
static int UPDATE_LOCAL_CHANGE
           
static int UPDATE_MERGE_NEEDED
           
static int UPDATE_NEEDED
           
static int UPDATE_NO_CHANGES
           
 
Constructor Summary
LocalRepository(CVSGrab cvsGrab)
          Constructor for the LocalRepository object
 
Method Summary
 void add(RemoteDirectory remoteDir)
          Adds a remote directory in the local filesystem, and update the CVS admin entries for that directory.
 void backupFile(RemoteFile remoteFile)
          Backup a remote file that was locally modified
 int checkUpdateStatus(RemoteFile remoteFile)
          Return true if the file needs to be updated
 void cleanRemovedFiles(RemoteDirectory remoteDirectory)
          Remove the local copies of the files that have been deleted in the remote repository.
 int getFailedUpdateCount()
          Gets the failed update count
 File getLocalDir(RemoteDirectory remoteDir)
          Gets the local directory to use for storing the contents of the remote directory
 File getLocalFile(RemoteFile remoteFile)
          Gets the local file to use for storing the contents of the remote file
 File getLocalRootDir()
          Gets the root directory
 String getLocalVersion(RemoteFile remoteFile)
          Returns the local version of the remote file
 int getNewFileCount()
          Gets the new file count
 int getRemovedFileCount()
          Gets the removed file count
 int getUpdatedFileCount()
          Gets the updated file count
 boolean isCleanUpdate()
          Gets the cleanUpdate flag.
 void pruneEmptyDirectories()
          Remove any directory that doesn't contain any files
 void resetFileCounts()
          Resets the counters in this class
 void unregisterFile(RemoteFile remoteFile)
          Unregister a file from the CVS entries, forcing it to be reloaded next time the program is run
 void updateFileVersion(RemoteFile remoteFile)
          Update a file version in the local CVS entries
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_NEEDED

public static final int UPDATE_NEEDED
See Also:
Constant Field Values

UPDATE_NO_CHANGES

public static final int UPDATE_NO_CHANGES
See Also:
Constant Field Values

UPDATE_LOCAL_CHANGE

public static final int UPDATE_LOCAL_CHANGE
See Also:
Constant Field Values

UPDATE_MERGE_NEEDED

public static final int UPDATE_MERGE_NEEDED
See Also:
Constant Field Values

UPDATE_IMPOSSIBLE

public static final int UPDATE_IMPOSSIBLE
See Also:
Constant Field Values
Constructor Detail

LocalRepository

public LocalRepository(CVSGrab cvsGrab)
Constructor for the LocalRepository object

Parameters:
cvsGrab - The cvs grabber
Method Detail

getLocalRootDir

public File getLocalRootDir()
Gets the root directory

Returns:
The rootDirectory value

getLocalDir

public File getLocalDir(RemoteDirectory remoteDir)
Gets the local directory to use for storing the contents of the remote directory

Parameters:
remoteDir - The remote directory
Returns:
The local directory

getLocalFile

public File getLocalFile(RemoteFile remoteFile)
Gets the local file to use for storing the contents of the remote file

Parameters:
remoteFile - The remote file
Returns:
The local file

getNewFileCount

public int getNewFileCount()
Gets the new file count

Returns:
The newFileCount value

getUpdatedFileCount

public int getUpdatedFileCount()
Gets the updated file count

Returns:
The updatedFileCount value

getRemovedFileCount

public int getRemovedFileCount()
Gets the removed file count

Returns:
The deletedFileCount value

getFailedUpdateCount

public int getFailedUpdateCount()
Gets the failed update count

Returns:
The failedUpdates value

isCleanUpdate

public boolean isCleanUpdate()
Gets the cleanUpdate flag.

Returns:
the cleanUpdate.

resetFileCounts

public void resetFileCounts()
Resets the counters in this class


checkUpdateStatus

public int checkUpdateStatus(RemoteFile remoteFile)
Return true if the file needs to be updated

Parameters:
remoteFile - The remote file
Returns:
true if the file needs to be loaded from the server

getLocalVersion

public String getLocalVersion(RemoteFile remoteFile)
Returns the local version of the remote file

Parameters:
remoteFile - The remote file
Returns:
The version of the local file, or null if it doesn't exist

updateFileVersion

public void updateFileVersion(RemoteFile remoteFile)
Update a file version in the local CVS entries

Parameters:
remoteFile - The remote file

backupFile

public void backupFile(RemoteFile remoteFile)
Backup a remote file that was locally modified

Parameters:
remoteFile - The remote file

unregisterFile

public void unregisterFile(RemoteFile remoteFile)
Unregister a file from the CVS entries, forcing it to be reloaded next time the program is run

Parameters:
remoteFile - The remote file

cleanRemovedFiles

public void cleanRemovedFiles(RemoteDirectory remoteDirectory)
Remove the local copies of the files that have been deleted in the remote repository.

Parameters:
remoteDirectory - The remote directory to clean-up

pruneEmptyDirectories

public void pruneEmptyDirectories()
                           throws IOException
Remove any directory that doesn't contain any files

Throws:
IOException

add

public void add(RemoteDirectory remoteDir)
Adds a remote directory in the local filesystem, and update the CVS admin entries for that directory.

Parameters:
remoteDir - The remote directory


Copyright © 2002-2005 Ludovic Claude. All Rights Reserved.