net.sf.statcvs.model
Class CvsFile

java.lang.Object
  extended bynet.sf.statcvs.model.CvsFile

public class CvsFile
extends java.lang.Object

Represents the information about one file in the source repository.

Version:
$Id: CvsFile.java,v 1.26 2003/03/18 10:33:54 lukasz Exp $
Author:
Manuel Schulze

Field Summary
static int CVS_BINARY
          Used for repository files in state binary
static int CVS_K
           
static int CVS_KVL
           
static int CVS_O
           
static int CVS_TEXT
          Used for repository text files.
static int CVS_UTF
          Used to indicate, the file is in utf format.
static int CVS_V
           
static java.lang.String EMPTY_PATH
          Empty path.
static java.lang.String PATH_DELIMITER
          The path delimiter.
 
Constructor Summary
CvsFile(java.lang.String fullname, java.lang.String workingname, java.util.List revisions, int keywordSubstitution, RepositoryFileManager fileManager)
          Creates a CvsFile object.
 
Method Summary
 int getCurrentLinesOfCode()
          Returns the number of code lines for this file.
 java.lang.String getFilename()
          Returns the filename.
 java.lang.String getFullname()
          Returns the fullname.
 CvsRevision getInitialRevision()
          Gets the earliest revision of this file.
 int getKeywordsubst()
          Returns the keywordsubst.
 CvsRevision getLatestRevision()
          Gets the latest revision of this file.
 java.lang.String getModuleName()
          Returns the packagename of this file.
 java.util.Iterator getRevisionIterator()
          Returns an iterator over of revisions in this file.
 java.util.List getRevisions()
          Returns the list of CvsRevisions of this file.
 java.util.Vector getRevisionsPerUser(java.lang.String user)
          Returns a list of the revisions of this file from a specific user.
 java.lang.String getWorkingname()
          Returns the workingname.
 boolean hasUser(java.lang.String user)
          Returns true, if user worked on this file.
 boolean isBinary()
          Returns true if the file is checked in as a binary file.
 boolean isDead()
          Returns true if the latest revision has state dead.
 java.lang.String toString()
          Returns a string representation of this objects content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PATH_DELIMITER

public static final java.lang.String PATH_DELIMITER
The path delimiter.

See Also:
Constant Field Values

EMPTY_PATH

public static final java.lang.String EMPTY_PATH
Empty path.

See Also:
Constant Field Values

CVS_BINARY

public static final int CVS_BINARY
Used for repository files in state binary

See Also:
Constant Field Values

CVS_TEXT

public static final int CVS_TEXT
Used for repository text files.

See Also:
Constant Field Values

CVS_K

public static final int CVS_K
See Also:
Constant Field Values

CVS_O

public static final int CVS_O
See Also:
Constant Field Values

CVS_V

public static final int CVS_V
See Also:
Constant Field Values

CVS_KVL

public static final int CVS_KVL
See Also:
Constant Field Values

CVS_UTF

public static final int CVS_UTF
Used to indicate, the file is in utf format.

See Also:
Constant Field Values
Constructor Detail

CvsFile

public CvsFile(java.lang.String fullname,
               java.lang.String workingname,
               java.util.List revisions,
               int keywordSubstitution,
               RepositoryFileManager fileManager)
Creates a CvsFile object.

Parameters:
fullname - The fullname of the file (path/filename,v)
workingname - The name of the file
revisions - the list of CvsRevisions of this file, from latest to oldest
keywordSubstitution - the keyword substitution mode of this file
fileManager - The filemanager to use if the filecontent is requested
Method Detail

getFullname

public java.lang.String getFullname()
Returns the fullname.

Returns:
String

getKeywordsubst

public int getKeywordsubst()
Returns the keywordsubst.

Returns:
int

getWorkingname

public java.lang.String getWorkingname()
Returns the workingname.

Returns:
String

getFilename

public java.lang.String getFilename()
Returns the filename.

Returns:
The filename.

getRevisionsPerUser

public java.util.Vector getRevisionsPerUser(java.lang.String user)
Returns a list of the revisions of this file from a specific user.

Parameters:
user - The user to get the revisions for.
Returns:
A list of revisions.

getLatestRevision

public CvsRevision getLatestRevision()
Gets the latest revision of this file.

Returns:
the latest revision of this file

getInitialRevision

public CvsRevision getInitialRevision()
Gets the earliest revision of this file.

Returns:
the latest revision of this file

getRevisions

public java.util.List getRevisions()
Returns the list of CvsRevisions of this file.

Returns:
A list which contains the revisions.

getModuleName

public java.lang.String getModuleName()
Returns the packagename of this file.

Returns:
The name of the package, this file is in

getCurrentLinesOfCode

public int getCurrentLinesOfCode()
Returns the number of code lines for this file. 0 will be returned for binary files and for files that are deleted.

Returns:
the number of code lines for this file.

getRevisionIterator

public java.util.Iterator getRevisionIterator()
Returns an iterator over of revisions in this file.

Returns:
An itertor over this files revisions

isDead

public boolean isDead()
Returns true if the latest revision has state dead.

Returns:
True, if this file is deleted in the repository

isBinary

public boolean isBinary()
Returns true if the file is checked in as a binary file.

Returns:
True, if this file is a binary file

hasUser

public boolean hasUser(java.lang.String user)
Returns true, if user worked on this file.

Parameters:
user - The user to search for
Returns:
True, if the user is listed in one of this files revisions

toString

public java.lang.String toString()
Returns a string representation of this objects content.

Returns:
String representation