org.netbeans.lib.cvsclient.admin
Class Entry

java.lang.Object
  extended by org.netbeans.lib.cvsclient.admin.Entry

public final class Entry
extends java.lang.Object

The class abstracts the CVS concept of an entry line. The entry line is textually of the form:

/ name / version / conflict / options / tag_or_date

These are explained in section 5.1 of the CVS protocol 1.10 document.


Field Summary
static java.lang.String DUMMY_TIMESTAMP
          The dummy timestamp set the conflict information for added or removed files.
static java.lang.String DUMMY_TIMESTAMP_NEW_ENTRY
           
static char HAD_CONFLICTS
          Indicates that the file had conflicts.
static java.lang.String HAD_CONFLICTS_AND_TIMESTAMP_MATCHES_FILE
          Indicates that the file had conflicts and timestamp matches.
static java.lang.String MERGE_TIMESTAMP
           
static char TIMESTAMP_MATCHES_FILE
          Indicates that the timestamp matches the file.
 
Constructor Summary
Entry()
          Construct a new blank Entry.
Entry(java.lang.String entryLine)
          Construct a new Entry from a given entry line.
 
Method Summary
 java.lang.String getConflict()
          Get the conflict information.
 java.util.Date getDate()
          Get sticky date information.
 java.lang.String getDateFormatted()
          Gets the sticky date information as a string in the appropriate format.
 java.util.Date getLastModified()
          Get the last modification time.
static java.text.SimpleDateFormat getLastModifiedDateFormatter()
          Returns the instance of the Last-Modified-Date-Formatter.
 java.lang.String getName()
          Get the name of the associated file.
 java.lang.String getOptions()
          Get the options information.
 java.lang.String getRevision()
          Get the revision.
 java.lang.String getStickyInformation()
          Get the sticky information.
 java.lang.String getTag()
          Get the sticky tag information.
static java.util.TimeZone getTimeZone()
          All entries times are by defaulf in Zulu/GMT0
 boolean hadConflicts()
          Determine whether there were any conflicts.
 boolean hasDate()
          Determines whether the entry has a date (as opposed to a tag).
 boolean hasTag()
          Determines whether the entry has a tag (as opposed to a date).
protected  void init(java.lang.String entryLine)
          Initialise the Entry by parsing an entry line.
 boolean isBinary()
          Determines whether the file is a binary file.
 boolean isDirectory()
          Determine whether the entry refers to a directory.
 boolean isNewUserFile()
          Determine whether there is a new user file of that name.
 boolean isNoUserFile()
          Determine whether there is no user file of that name.
 boolean isUserFileToBeRemoved()
          Determine whether the user file of that name is to be removed.
 boolean isValid()
          Determines whether the entry is valid.
 void setConflict(java.lang.String conflict)
          Set the conflict information.
 void setDate(java.util.Date date)
          Set the sticky date information.
 void setDirectory(boolean directory)
          Set whether the entry refers to a directory.
 void setName(java.lang.String name)
          Set the name.
 void setOptions(java.lang.String options)
          Set the options information.
 void setRevision(java.lang.String revision)
          Set the revision.
 void setTag(java.lang.String tag)
          Set the sticky tag information.
 boolean timestampMatchesFile()
          Determine whether the timestamp matches the file.
 java.lang.String toString()
          Create a string representation of the entry line.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DUMMY_TIMESTAMP

public static final java.lang.String DUMMY_TIMESTAMP
The dummy timestamp set the conflict information for added or removed files.

See Also:
Constant Field Values

DUMMY_TIMESTAMP_NEW_ENTRY

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

MERGE_TIMESTAMP

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

HAD_CONFLICTS

public static final char HAD_CONFLICTS
Indicates that the file had conflicts.

See Also:
Constant Field Values

TIMESTAMP_MATCHES_FILE

public static final char TIMESTAMP_MATCHES_FILE
Indicates that the timestamp matches the file.

See Also:
Constant Field Values

HAD_CONFLICTS_AND_TIMESTAMP_MATCHES_FILE

public static final java.lang.String HAD_CONFLICTS_AND_TIMESTAMP_MATCHES_FILE
Indicates that the file had conflicts and timestamp matches. It likely means unresolved conflict.

See Also:
Constant Field Values
Constructor Detail

Entry

public Entry(java.lang.String entryLine)
Construct a new Entry from a given entry line.


Entry

public Entry()
Construct a new blank Entry.

Method Detail

getLastModifiedDateFormatter

public static java.text.SimpleDateFormat getLastModifiedDateFormatter()
Returns the instance of the Last-Modified-Date-Formatter.


getTimeZone

public static java.util.TimeZone getTimeZone()
All entries times are by defaulf in Zulu/GMT0


init

protected void init(java.lang.String entryLine)
Initialise the Entry by parsing an entry line.

Parameters:
entryLine - the entry line in standard CVS format

getName

public java.lang.String getName()
Get the name of the associated file.

Returns:
the file name

setName

public void setName(java.lang.String name)
Set the name.

Parameters:
theName - the filename to set

getRevision

public java.lang.String getRevision()
Get the revision.

Returns:
the revision

setRevision

public void setRevision(java.lang.String revision)
Set the revision.

Parameters:
theVersion - the revision to set

getLastModified

public java.util.Date getLastModified()
Get the last modification time.

Returns:
date.getTime() compatible with File.lastModified()

getConflict

public java.lang.String getConflict()
Get the conflict information.

Returns:
the conflict String

setConflict

public void setConflict(java.lang.String conflict)
Set the conflict information.

Parameters:
theConflict - the conflict information

getOptions

public java.lang.String getOptions()
Get the options information.

Returns:
the options details

setOptions

public void setOptions(java.lang.String options)
Set the options information.

Parameters:
theOptions - the options

getStickyInformation

public java.lang.String getStickyInformation()
Get the sticky information. It's either a tag, a date or null.


getTag

public java.lang.String getTag()
Get the sticky tag information. May return null if no tag information was present. If so, you should check for date information. Note that tag and date information cannot both be present.

Returns:
the tag, or null if none is present

setTag

public void setTag(java.lang.String tag)
Set the sticky tag information. Setting this will remove any date information that is set.

Parameters:
theTag - the tag information

getDate

public java.util.Date getDate()
Get sticky date information. May return null if no date information is available. If so, you should check for tag informaton. Note that tag and date information cannot both be present.

Returns:
the date, or null if none is present

getDateFormatted

public java.lang.String getDateFormatted()
Gets the sticky date information as a string in the appropriate format. Returns null if there ain't a sticky date assigned.


setDate

public void setDate(java.util.Date date)
Set the sticky date information. Note that setting this will remove any tag information that is currently set.

Parameters:
theDate - the date to use.

hasDate

public boolean hasDate()
Determines whether the entry has a date (as opposed to a tag).

Returns:
true if the entry has a date, false otherwise

hasTag

public boolean hasTag()
Determines whether the entry has a tag (as opposed to a date).

Returns:
true if the entry has a tag, false otherwise

isBinary

public boolean isBinary()
Determines whether the file is a binary file.


isNoUserFile

public boolean isNoUserFile()
Determine whether there is no user file of that name.

Returns:
true if there is no user file of that name

isNewUserFile

public boolean isNewUserFile()
Determine whether there is a new user file of that name.

Returns:
true if there is a new user file with that name

isUserFileToBeRemoved

public boolean isUserFileToBeRemoved()
Determine whether the user file of that name is to be removed.

Returns:
true if the user file with this name is to be removed

isValid

public boolean isValid()
Determines whether the entry is valid. A valid entry has at least a name.


isDirectory

public boolean isDirectory()
Determine whether the entry refers to a directory.


setDirectory

public void setDirectory(boolean directory)
Set whether the entry refers to a directory.


hadConflicts

public boolean hadConflicts()
Determine whether there were any conflicts.

Returns:
true if there were conflicts, false otherwise

timestampMatchesFile

public boolean timestampMatchesFile()
Determine whether the timestamp matches the file.

Returns:
true if the timpestamp does match the file, false otherwise

toString

public java.lang.String toString()
Create a string representation of the entry line. Create the standard CVS 1.10 entry line format.

Th eline format is suitable for writing into CVS/Entries file. Conflict one must be transformed before sending to wire BasicCommand.sendEntryAndModifiedRequests(org.netbeans.lib.cvsclient.admin.Entry, java.io.File).

Overrides:
toString in class java.lang.Object

 

Built on August 7 2008.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.