站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc 4.1.0

FileProperties (NetBeans VCS API) - NetBeans API Javadoc 4.1.0

 

org.netbeans.modules.vcscore.turbo
Class FileProperties

java.lang.Object
  extended byorg.netbeans.modules.vcscore.turbo.FileProperties

public final class FileProperties
extends Object

Additional metadata for files in versioning system working directory. It defines a bunch of properties. All clients that create instance must fill it consistently, setting values or null-ing them if the client does not have current value. Clients can also use clone constructor and update just changed values (inlucing null-ing them.)

e.g.

cvs up
U folder/file
command knows that the file was updated but it does not know recent revision. It updates status and nulls revision.

The object is treated as immutable for most of its lifetime, once initialized creator must invoke freeze() to assure it.

Note: FileAttributeProviders must report all statuses including local/non-versioned ones. It differs from FileReaderListener events sources (LIST) that must not report local/non-versioned statuses. Mentioning here because in typical setup FileProperties provider and LIST provider is implemented by one package. It puts extra:

requirement.


Field Summary
static String ID
          Attribute holding this object.
 
Constructor Summary
FileProperties()
           
FileProperties(FileProperties fprops)
          Clones FileProperties except retrieval time.
FileProperties(String[] elements)
          Constructs from StatusFormatElements.
 
Method Summary
static FileProperties createLocal(FileObject fileObject)
          Creates file properties with LOCAL or IGNORED status for given file.
static FileProperties createLocal(String name)
          Creates file properties with LOCAL status for given file.
 void freeze()
          Make object immutable, all setters throw exception.
 String getAttr()
          VCS specific additonal attributes (e.g CVS -kb) or null for unknown.
 String getDate()
          Returns recent VCS specifics date string or null for unknown.
 String getFileName()
          Gets file name.
 String getLocker()
          What VCS specifics user holds lock on the file.
 String getName()
          Gets file name.
 long getRetrieval()
          Keeps time when updated from repository.
 String getRevision()
          Returns recent VCS specifics revision string (e.g.
 long getSize()
          Returns recent file size or -1 for unknown.
 String getSizeAsString()
           
 String getStatus()
          Status as provided by VCS repository or LOCAL, IGNORED or UNKNOWN assigned by cache.
static String getStatus(FileProperties fprops)
          Get versioning system specifics status, "Yet-Unknown" for unknown and "Local" or "Ignored" for local files (defined in Statuses).
 String getSticky()
          Returns recent VCS specifics sticky string (branch/date) or null for unknown.
 String getTime()
          Returns recent VCS specifics time string or null for unknown.
 boolean isLocal()
          Determines whether reported status means that file is not versioned.
 void setAttr(String attr)
           
 void setDate(String date)
           
 void setLocker(String locker)
           
 void setName(String name)
          Sets file name.
 void setRetrieval(long retrieval)
           
 void setRevision(String revision)
           
 void setSize(long size)
           
 void setStatus(String status)
          Sets new status.
 void setSticky(String sticky)
           
 void setTime(String time)
           
 String[] toElements()
          Converts to format accepted by StatusFormat
 String toString()
          For debugging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final String ID
Attribute holding this object.

See Also:
Constant Field Values
Constructor Detail

FileProperties

public FileProperties()

FileProperties

public FileProperties(FileProperties fprops)
Clones FileProperties except retrieval time. Clone is not frozen.


FileProperties

public FileProperties(String[] elements)
Constructs from StatusFormatElements.

Method Detail

createLocal

public static FileProperties createLocal(String name)
Creates file properties with LOCAL status for given file. Callers that are not sure about local status should call createLocal(FileObject).

Parameters:
name - name of file (without path), trailing '/' denotes folder

createLocal

public static FileProperties createLocal(FileObject fileObject)
Creates file properties with LOCAL or IGNORED status for given file.

Parameters:
fileObject - target file

getStatus

public String getStatus()
Status as provided by VCS repository or LOCAL, IGNORED or UNKNOWN assigned by cache. It's not abstract repository neutral status as defined by FileStatusInfo.


setStatus

public void setStatus(String status)
Sets new status. Please read consistency note in class Javadoc.

Parameters:
status - updates status or null

getRetrieval

public long getRetrieval()
Keeps time when updated from repository. The longer time elapsed since that point the more unknown data this hold.


setRetrieval

public void setRetrieval(long retrieval)

getName

public String getName()
Gets file name. Trailing '/' denotes folder.


getFileName

public String getFileName()
Gets file name. Always without trailing '/' regardles folder.


setName

public void setName(String name)
Sets file name. Trailing '/' denotes folder otherwise must match name of associated file.


getRevision

public String getRevision()
Returns recent VCS specifics revision string (e.g. "1.1", "-1", "r45/hotfix3") or null for unknown.


setRevision

public void setRevision(String revision)

getSticky

public String getSticky()
Returns recent VCS specifics sticky string (branch/date) or null for unknown.


setSticky

public void setSticky(String sticky)

getAttr

public String getAttr()
VCS specific additonal attributes (e.g CVS -kb) or null for unknown.


setAttr

public void setAttr(String attr)

getDate

public String getDate()
Returns recent VCS specifics date string or null for unknown.


setDate

public void setDate(String date)

getTime

public String getTime()
Returns recent VCS specifics time string or null for unknown.


setTime

public void setTime(String time)

getSize

public long getSize()
Returns recent file size or -1 for unknown.


getSizeAsString

public String getSizeAsString()

setSize

public void setSize(long size)

isLocal

public boolean isLocal()
Determines whether reported status means that file is not versioned.

Returns:
true if for sure local, otherwise false (even if unknown)

freeze

public void freeze()
Make object immutable, all setters throw exception.


getLocker

public String getLocker()
What VCS specifics user holds lock on the file. null for unknown.


setLocker

public void setLocker(String locker)

getStatus

public static String getStatus(FileProperties fprops)
Get versioning system specifics status, "Yet-Unknown" for unknown and "Local" or "Ignored" for local files (defined in Statuses).

Parameters:
fprops - propeties or null
Returns:
status or UNKNOWN for null properties or status

toElements

public String[] toElements()
Converts to format accepted by StatusFormat


toString

public String toString()
For debugging purposes.


 

Built on May 4 2005.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.