com.starbase.starteam
Class File

java.lang.Object
  |
  +--com.starbase.starteam.CacheRef
        |
        +--com.starbase.starteam.NamedCacheRef
              |
              +--com.starbase.starteam.TypedResource
                    |
                    +--com.starbase.starteam.SimpleTypedResource
                          |
                          +--com.starbase.starteam.Item
                                |
                                +--com.starbase.starteam.File
All Implemented Interfaces:
java.lang.Cloneable, ISecurable, ISecurableObject

public class File
extends Item

Represents a StarTeam File item.


Nested Class Summary
 
Nested classes inherited from class com.starbase.starteam.Item
Item.LockType
 
Constructor Summary
File(Folder parentFolder)
          Creates a new file instance.
 
Method Summary
 void add(java.io.File file, java.lang.String name, java.lang.String desc, java.lang.String reason, int lockStatus, boolean eol, boolean updateStatus)
          Adds this (new) file to the project/view.
 AddResult addAndReturn(java.io.File file, java.lang.String name, java.lang.String desc, java.lang.String reason, int lockStatus, boolean eol, boolean updateStatus)
          Adds this (new) file to the project/view.
 void addFromStream(java.io.InputStream stream, java.lang.String fileName, java.lang.String description, java.lang.String comment, int lockStatus, boolean eol)
          Adds a new file to the repository using the provided stream's file contents.
 void checkin(CheckinOptions options)
          Check in this File using the specified options
 void checkin(java.lang.String reason, int lockStatus, boolean forceCheckin, boolean eol, boolean updateStatus)
          Check in a new version of this file.
 void checkinFrom(java.io.File file, java.lang.String reason, int lockStatus, boolean forceCheckin, boolean eol, boolean updateStatus)
          Adds this new version of the file to the repository.
 CheckInResult checkinFromAndReturn(java.io.File file, java.lang.String reason, int lockStatus, boolean forceCheckin, boolean eol, boolean updateStatus)
          Adds this new version of the file to the repository.
 void checkinFromStream(java.io.InputStream source, java.lang.String checkinReason, int lockStatus, boolean eol)
          Adds this new version of the file to the repository.
 void checkout(CheckoutOptions options)
          Check out this File using the specified options.
 void checkout(int lockStatus, boolean timeStampNow, boolean eol, boolean updateStatus)
          Checks out the tip version of this file.
 boolean checkoutByDate(java.io.File checkoutTo, OLEDate date, int lockStatus, boolean timeStampNow, boolean eol, boolean updateStatus)
          Check out by date, overriding the default working file location.
 boolean checkoutByLabelID(java.io.File checkoutTo, int labelID, int lockStatus, boolean timeStampNow, boolean eol, boolean updateStatus)
          Check out by label, overriding the default working file location.
 boolean checkoutByVersion(java.io.File checkoutTo, int viewVersion, int lockStatus, boolean timeStampNow, boolean eol, boolean updateStatus)
          Check out by view version, overriding the default working file location.
 void checkoutTo(java.io.File checkoutTo, int lockStatus, boolean timeStampNow, boolean eol, boolean updateStatus)
          Check out the tip version, overriding the working file location.
 CheckOutResult checkoutToAndReturn(java.io.File checkoutTo, int lockStatus, boolean timeStampNow, boolean eol, boolean updateStatus)
          Check out the tip version, obyverriding the working file location.
 void checkoutToStream(java.io.OutputStream destination, int lockStatus, boolean eol)
          Checks out the tip version of this file and write it to the specified stream.
 void convertArchive(boolean useDeltaStorage, int compressionLevel)
          This method causes the server to convert all versions stored in the archives associated with the file to the storage parameters specified.
 void convertToNativeIIArchive(boolean bDeleteOldArchives)
          Convert this File's archives to Native II format.
 boolean deleteLocalFile(java.io.File file)
          Deletes the specified local file and has the side effect of deleting sync information from the server about the file.
 void deleteSyncInfo(java.io.File file)
          Removes sync information from this File object's Server.
 boolean equals(java.lang.Object source)
          returns true if this object instance is equal to the source
 File findCommonAnscestor(File other)
          Deprecated.  
 File findMergeVersion()
          Returns a revision from this file's history that represents the most recent common ancestor of this file with the last known version on disk.
 int getArchiveFormat()
          The format of archive the server happens to be storing this file in -- Native-I, Native-II, or not applicable.
 java.lang.String getArchiveFormatDisplayName(int value)
          Returns a user-friendly display name for the given ArchiveFormat value.
 java.lang.String getArchiveName()
          The name of archive.
 int getArchiveType()
          The type of archive the server happens to be storing this file in--StarTeam native, PVCS, Visual SourceSafe, etc.
 java.lang.String getArchiveTypeDisplayName(int value)
          Returns a user-friendly display name for the given ArchiveType value.
 Keyword[] getBlankKeywords()
          Returns an array of the default StarTeam keywords.
 int getCharset()
          The character set this file appears to use.
 java.lang.String getCharsetDisplayName(int value)
          Returns a user-friendly display name for the given Charset value.
 int getCompression()
          Returns an int describing the compression level being used to store versions of this file in the repository.
 java.lang.String getCompressionDisplayName(int value)
          Returns a user-friendly display name for the given Compression value.
 OLEDate getContentModificationTime()
          Returns the "last modified" timestamp of the working file when it was checked in to create this version.
 int getContentVersion()
          Returns the content version number for this file.
static java.lang.String getDefaultEncoding()
          Deprecated.  
 java.lang.String getDescription()
          Returns the description of this file.
 java.lang.String getExtension()
          Returns the file name extension.
 FileSyncInfo getFileSyncInfo(MD5 compareMD5, int compareSize, MD5 syncMD5, int syncSize, OLEDate syncTime)
          Deprecated. Use getFileSyncInfoEx, which supports file sizes greater than 2GB.
 FileSyncInfo getFileSyncInfoEx(MD5 compareMD5, long compareSize, MD5 syncMD5, long syncSize, OLEDate syncTime)
          Attempts to determine what version of the file is actually on disk.
 java.lang.String getFullName()
          Returns the concatenation of this file's name with the working directory of the file's parent folder.
 int getLastKnownStatus()
          Returns the last known status of the default working file relative to the file in the repository, using only information provided by the client during the last status update operation.
 int getLastKnownVersionOnDisk()
          Returns the last known version of this file on disk.
 boolean getLocalFileExecutable()
          Returns true if the local file is executable.
 boolean getLocalFileExists()
          Returns true if the local file exists on disk.
 java.lang.String getLocalName()
          Returns the local file name, as recognized by the local file system.
 java.lang.String getLocalPath()
          Returns the local path, as recognized by the local file system.
 int getLocalSize()
          Deprecated. Use getLocalSizeEx, which supports file sizes greater than 2GB.
 long getLocalSizeEx()
          Returns the local file's size.
 OLEDate getLocalTimeStamp()
          Returns the local file's time stamp.
 byte[] getMD5()
          The MD5 hash bytes of the file contents for this version.
 java.lang.String getName()
          Returns the name of this file.
 int[] getPossibleArchiveFormat()
          Returns the possible enum codes that are valid values for the ArchiveFormat property.
 int[] getPossibleArchiveType()
          Returns the possible enum codes that are valid values for the ArchiveType property.
 int[] getPossibleCharset()
          Returns the possible enum codes that are valid values for the Charset property.
 int[] getPossibleCompression()
          Returns the possible enum codes that are valid values for the Compression property.
 int[] getPossibleStorageFormat()
          Returns the possible enum codes that are valid values for the StorageFormat property.
 int getSize()
          Deprecated. Use getSizeEx, which supports file sizes greater than 2GB.
 long getSizeEx()
          The size of this file in the repository.
 int getSmartStatus()
          Gets the status of the default working file relative to the latest version of this file in the repository.
 int getSmartStatus(java.io.File file)
          Gets the status of the given working file relative to the latest version of this file in the repository.
 int getStatus()
          Gets the status of the default working file relative to the latest version of this file in the repository.
 int getStatus(java.io.File file)
          Gets the status of the given working file relative to the latest version of this file in the repository.
 int getStatusByMD5(MD5 md5)
          Returns the status of the default working file relative to the file in the repository, using the given size MD5 signature of the file.
 int getStatusByTime(int size, OLEDate lastModified)
          Deprecated. Use getStatusByTimeEx, which supports file sizes greater than 2GB.
 int getStatusByTimeEx(long size, OLEDate lastModified)
          Returns the status of the default working file relative to the file in the repository, using the given size and last modified date of the file.
 boolean getStatusKnown()
          Returns true if status information is known for this file.
 int getStatusNow()
          Same as getStatus, but this method first goes to the server to refresh the status information.
 int getStorageFormat()
          Returns an enumerated value describing the storage format being used to store versions of this file--that is, delta or full version storage.
 java.lang.String getStorageFormatDisplayName(int value)
          Returns a user-friendly display name for the given StorageFormat value.
 int getVaultVersion()
          Returns the vault version number for this file.
 int hashCode()
          returns a unique hash for all instances of this type
 boolean isBinary()
          Tells whether this file (in the repository) has been determined to be a binary file.
static boolean isInSyncByMD5(java.io.File file, FileSyncInfo syncInfo)
          Determines whether or not the given file has the MD5 signature indicated in the given FileSyncInfo record.
static boolean isInSyncByTime(java.io.File file, FileSyncInfo syncInfo)
          Determines whether or not the given file has the size and last modified date indicated in the given FileSyncInfo record.
 void lock()
          Obtains an exclusive lock on this file without attempting to break an existing lock.
 java.io.File moveLocalFile(java.io.File fromFile, java.lang.String toFolderPath)
          Moves the local file to the specified folder and has the side effect of moving the status information from the original file to the newly created one Deletes the original file and it's status information at the end of the move
 void putLock(int lockType, boolean breakLock)
          Sets the current user's lock for this file.
 void removeAndDeleteLocal()
          Removes the file item from its parent folder.
 void rename(java.lang.String newName)
          Renames this file to a new name along with the side effect of changing the corresponding local file's name as well.
 void resyncStatus(MD5 compareMD5, int compareSize, MD5 syncMD5, int syncSize, OLEDate syncTime)
          Deprecated. Use resyncStatusEx, which supports file sizes greater than 2GB.
 void resyncStatusEx(MD5 compareMD5, long compareSize, MD5 syncMD5, long syncSize, OLEDate syncTime)
          Attempts to update the repository information about what version of the file is actually on disk.
 void setCompression(int compressionLevel)
          Sets this file's compression level being used to store versions of this file in the repository.
 void setContentModificationTime(OLEDate time)
          Sets this file's content modification time.
static void setDefaultEncoding(java.lang.String name)
          Deprecated.  
 void setDescription(java.lang.String description)
          Sets the description of this file.
 void setName(java.lang.String name)
          Sets a new name for this file.
 void setStorageFormat(int storageFormat)
          Set the storage format to be used for this filer.
 java.lang.String toString()
          Returns the name of this file.
 void unlock()
          Removes the current user's lock from this file.
 void update()
          Presists a new version of this file object in the repository.
 void updateStatus(boolean eolConversion, boolean useMD5)
          Attempts to update the repository information about what version of the file is actually on disk.
 void updateStatusAfterMerge()
          Updates the server's status information to reflect the fact that the local file's contents were derived from this file's contents.
 void updateStatusFromMD5(MD5 signature)
          Updates the server's status information to reflect the fact that the local file's content has the given MD5 signature.
 void updateStatusFromTime(int size, OLEDate lastModified)
          Deprecated. Use updateStatusFromTimeEx, which supports file sizes greater than 2GB.
 void updateStatusFromTimeEx(long size, OLEDate lastModified)
          Updates the server's status information to reflect the fact that the local file's content has the given size and last modified date.
 void updateStatusInformation(int fileSize, OLEDate lastModified, MD5 signature)
          Deprecated. Use updateStatusInformationEx, which supports file sizes greater than 2GB.
 void updateStatusInformationEx(long fileSize, OLEDate lastModified, MD5 signature)
          Updates the server's status information to reflect the fact that the local file's content has the given size, last modified date, and MD5 signature.
 boolean upgradeSyncInfo()
          Deprecated. All supported versions of the StarTeam server support client-managed status information. Upgrading to client-managed status is no longer necessary.
 boolean usesKeywords()
          Tells whether or not this file will use keyword expansion.
 
Methods inherited from class com.starbase.starteam.Item
acquireOwnership, addAttachment, copy, createAttachment, createAttachmentFromFile, createItem, deleteMergePoint, discard, get, getACL, getAllLabels, getAttachedLabels, getAttachment, getAttachmentIDs, getAttachmentNames, getAttachmentToFile, getBehavior, getBranchRevisionFromDotNotation, getByProperty, getByPropertyID, getByteArray, getCachedProperties, getComment, getCommonAncestor, getCreatedBy, getCreatedTime, getDeletedTime, getDeletedUserID, getDisplayValue, getDotNotation, getDouble, getEnumDisplayName, getFlag, getFlagDisplayName, getFromHistoryByDate, getFromHistoryByLabelID, getFromHistoryByVersion, getHistory, getID, getInt, getIntArray, getItemID, getItemRevisions, getLocker, getMergeHistory, getModifiedBy, getModifiedTime, getMyLock, getNewRevisionComment, getObjectID, getOLEDate, getOwner, getParentContainer, getParentFolder, getParentFolderHierarchy, getParentFolderName, getParentFolderPath, getParentFolderQualifiedName, getParentRevision, getPossibleFlag, getPossibleReadStatus, getPossibleValues, getPropertyNames, getReadStatus, getReadStatusDisplayName, getReference, getReferences, getRevisionNumber, getRootObjectID, getServer, getString, getType, getTypeNames, getView, getViewVersion, getViewVersionFromDotNotation, hasPermission, hasValues, isBranchable, isDeleted, isDirty, isDisembodied, isEqualTo, isFromHistory, isNew, isRefreshRequired, isRefreshRequired, isReverseShareRecommended, isRootShare, modifyFlagForUser, modifyReadStatusForUser, move, moveTo, populate, populate, put, putByPropertyID, recordMergePoint, refresh, refresh, remove, removeAttachment, resolveMergePoint, reverseShareTo, setACL, setBehavior, setBranchOnChange, setComment, setFixedConfig, setFloatingConfig, shareTo, smartShareTo, toDebugString, updateRevisionComment
 
Methods inherited from class com.starbase.starteam.TypedResource
addToIntArray, removeFromIntArray
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

File

public File(Folder parentFolder)
Creates a new file instance.

Parameters:
parentFolder - the folder that will contain this file
Method Detail

getDefaultEncoding

public static java.lang.String getDefaultEncoding()
Deprecated.  

Gets the default file encoding.

Returns:
The name of the default file encoding. Currently, this affects only keyword expansion.
See Also:
Encoding.getDefaultStarTeamEncoding()

setDefaultEncoding

public static void setDefaultEncoding(java.lang.String name)
Deprecated.  

Sets the default file encoding.

Parameters:
name - The name of the default file encoding. Currently, this affects only keyword expansion.
See Also:
Encoding.setDefaultStarTeamEncoding(com.borland.starteam.util.Encoding)

getFullName

public java.lang.String getFullName()
Returns the concatenation of this file's name with the working directory of the file's parent folder. This should return the full path to this file's working location on disk.

Returns:
the local file path to this file
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

getName

public java.lang.String getName()
Returns the name of this file. This is the name only--contrast with getFullName.

Returns:
the name of this file
See Also:
File.getFullName()

setName

public void setName(java.lang.String name)
Sets a new name for this file. To persist the change in the repository you must call update().

Parameters:
name - the new name of this file
See Also:
File.update()

getDescription

public java.lang.String getDescription()
Returns the description of this file.

Returns:
the description of this file
See Also:
PropertyNames.FILE_DESCRIPTION

setDescription

public void setDescription(java.lang.String description)
Sets the description of this file. To actually change the description in the repository you must call update() or one of the checkin methods.

Parameters:
description - the new description of this file
See Also:
PropertyNames.FILE_DESCRIPTION, File.update(), File.add(java.io.File, java.lang.String, java.lang.String, java.lang.String, int, boolean, boolean), File.checkin(com.starbase.starteam.CheckinOptions), File.checkinFrom(java.io.File, java.lang.String, int, boolean, boolean, boolean)

getVaultVersion

public int getVaultVersion()
Returns the vault version number for this file. The vault revision number is really an implementation detail of the StarTeam vault and the value of this property is not of much general use.

Returns:
the vault version number for this file
See Also:
PropertyNames.FILE_VAULT_BRANCH_VERSION

getContentVersion

public int getContentVersion()
Returns the content version number for this file. The first revision of any file item will have a value of 1 for this property. The value only changes when a new revision of the file is checked-in for which the file contents or the file name has changed. This value does not increment if only meta properties are modified (for example, the description). When a file item branches the value of this property does not revert to 1 but rather continues to increase as new revisions are added. This value is maintained in order to make status computation easier and more "accurate" (for example, a file should not need checkout if only its description changed).

Returns:
the content version number for this file
See Also:
PropertyNames.FILE_CONTENT_REVISION, File.getStatus()

getContentModificationTime

public OLEDate getContentModificationTime()
Returns the "last modified" timestamp of the working file when it was checked in to create this version. Note that this value comes from the local machine where the checkin occured.

Returns:
the "last modified" timestamp of the working file when this revision was checked in
See Also:
PropertyNames.FILE_FILE_TIME_AT_CHECKIN, File.setContentModificationTime(com.starbase.util.OLEDate)

setContentModificationTime

public void setContentModificationTime(OLEDate time)
Sets this file's content modification time. You need to call one of the "update" (update, checkin, add) methods to persist this information.

Parameters:
time - the content modification time for this file
See Also:
PropertyNames.FILE_FILE_TIME_AT_CHECKIN, File.getContentModificationTime()

getSize

public int getSize()
Deprecated. Use getSizeEx, which supports file sizes greater than 2GB.

The size of this file in the repository. Note that this may be different than the size of the local file if end-of-line conversion or keyword expansion is used.

Returns:
the size of this file in the repository
See Also:
PropertyNames.FILE_SIZE, File.getSizeEx()

getSizeEx

public long getSizeEx()
The size of this file in the repository. Note that this may be different than the size of the local file if end-of-line conversion or keyword expansion is used.

Returns:
the size of this file in the repository
See Also:
PropertyNames.FILE_SIZE

getArchiveType

public int getArchiveType()
The type of archive the server happens to be storing this file in--StarTeam native, PVCS, Visual SourceSafe, etc.

Returns:
the vault archive type for this file
See Also:
File.getPossibleArchiveType(), File.getArchiveTypeDisplayName(int), PropertyNames.FILE_ARCHIVE_TYPE

getPossibleArchiveType

public int[] getPossibleArchiveType()
Returns the possible enum codes that are valid values for the ArchiveType property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the ArchiveType property.
See Also:
File.getArchiveType(), File.getArchiveTypeDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.FILE_ARCHIVE_TYPE

getArchiveTypeDisplayName

public java.lang.String getArchiveTypeDisplayName(int value)
Returns a user-friendly display name for the given ArchiveType value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The ArchiveType value to be converted to a display name.
Returns:
A user-friendly display name for the given ArchiveType value.
See Also:
File.getArchiveType(), File.getPossibleArchiveType(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.FILE_ARCHIVE_TYPE

getArchiveFormat

public int getArchiveFormat()
The format of archive the server happens to be storing this file in -- Native-I, Native-II, or not applicable.

Returns:
the vault archive format for this file
See Also:
File.getPossibleArchiveFormat(), File.getArchiveTypeDisplayName(int), PropertyNames.FILE_ARCHIVE_FORMAT, SupportedFeatures.hasNativeIIVault()

getArchiveName

public java.lang.String getArchiveName()
The name of archive.

Returns:
the name of the archive for this file
See Also:
PropertyNames.FILE_ARCHIVE_NAME, SupportedFeatures.hasNativeIIVault()

getPossibleArchiveFormat

public int[] getPossibleArchiveFormat()
Returns the possible enum codes that are valid values for the ArchiveFormat property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the ArchiveFormat property.
See Also:
File.getArchiveFormat(), File.getArchiveFormatDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.FILE_ARCHIVE_FORMAT

getArchiveFormatDisplayName

public java.lang.String getArchiveFormatDisplayName(int value)
Returns a user-friendly display name for the given ArchiveFormat value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The ArchiveFormat value to be converted to a display name.
Returns:
A user-friendly display name for the given ArchiveFormat value.
See Also:
File.getArchiveFormat(), File.getPossibleArchiveFormat(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.FILE_ARCHIVE_FORMAT

getCharset

public int getCharset()
The character set this file appears to use. Text and binary are the only values currently supported.

Returns:
The character set enumerated value for this file.
See Also:
File.isBinary(), File.getPossibleCharset(), File.getCharsetDisplayName(int), PropertyNames.FILE_ENCODING

getPossibleCharset

public int[] getPossibleCharset()
Returns the possible enum codes that are valid values for the Charset property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the Charset property.
See Also:
File.getCharset(), File.getCharsetDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.FILE_ENCODING

getCharsetDisplayName

public java.lang.String getCharsetDisplayName(int value)
Returns a user-friendly display name for the given Charset value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The Charset value to be converted to a display name.
Returns:
A user-friendly display name for the given Charset value.
See Also:
File.getCharset(), File.getPossibleCharset(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.FILE_ENCODING

getMD5

public byte[] getMD5()
The MD5 hash bytes of the file contents for this version. This is the value for the file contents in the repository which may differ from that of the corresponding file on disk if end-of-line or keyword expasion has been applied.

Returns:
the MD5 has bytes of the repository contents of this file
See Also:
PropertyNames.FILE_MD5_CHECKSUM, MD5

getStorageFormat

public int getStorageFormat()
Returns an enumerated value describing the storage format being used to store versions of this file--that is, delta or full version storage.

Returns:
The storage format enumerated value for this file.
See Also:
File.getPossibleStorageFormat(), File.getStorageFormatDisplayName(int), PropertyNames.FILE_STORAGE_TYPE

setStorageFormat

public void setStorageFormat(int storageFormat)
Set the storage format to be used for this filer.

Parameters:
storageFormat - The new storage format enumerated value for this file.

getPossibleStorageFormat

public int[] getPossibleStorageFormat()
Returns the possible enum codes that are valid values for the StorageFormat property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the StorageFormat property.
See Also:
File.getStorageFormat(), File.getStorageFormatDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.FILE_STORAGE_TYPE

getStorageFormatDisplayName

public java.lang.String getStorageFormatDisplayName(int value)
Returns a user-friendly display name for the given StorageFormat value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The StorageFormat value to be converted to a display name.
Returns:
A user-friendly display name for the given StorageFormat value.
See Also:
File.getStorageFormat(), File.getPossibleStorageFormat(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.FILE_STORAGE_TYPE

getCompression

public int getCompression()
Returns an int describing the compression level being used to store versions of this file in the repository.

Returns:
The enumerated value for this file's compression level in the repository.
See Also:
File.getPossibleCompression(), File.getCompressionDisplayName(int), PropertyNames.FILE_COMPRESSION_LEVEL

setCompression

public void setCompression(int compressionLevel)
Sets this file's compression level being used to store versions of this file in the repository.

Parameters:
compressionLevel - The new value for this file's compression level in the repository

getPossibleCompression

public int[] getPossibleCompression()
Returns the possible enum codes that are valid values for the Compression property. This is really a convenience method for accessing Property.getEnumValues for this property.

Returns:
The possible values for the Compression property.
See Also:
File.getCompression(), File.getCompressionDisplayName(int), TypedResource.getPossibleValues(java.lang.String), PropertyNames.FILE_COMPRESSION_LEVEL

getCompressionDisplayName

public java.lang.String getCompressionDisplayName(int value)
Returns a user-friendly display name for the given Compression value. This is really a convenience method for accessing TypedResource.getEnumDisplayName for this property.

Parameters:
value - The Compression value to be converted to a display name.
Returns:
A user-friendly display name for the given Compression value.
See Also:
File.getCompression(), File.getPossibleCompression(), TypedResource.getEnumDisplayName(java.lang.String, int), PropertyNames.FILE_COMPRESSION_LEVEL

findCommonAnscestor

public File findCommonAnscestor(File other)
Deprecated.  

Returns the most recent common ancestor of this file with the specified file. The common version is taken from this file's history. It may return null if no common version was found.

Parameters:
other - the file for which a common ancestor of this file is to be found
Returns:
the most recent common ancestor of this file and the specified file.
See Also:
Item.getCommonAncestor(com.starbase.starteam.Item)

findMergeVersion

public File findMergeVersion()
Returns a revision from this file's history that represents the most recent common ancestor of this file with the last known version on disk. It may return null if the status is Unknown or if the sync version is not from the same version graph.

Returns:
the most recent common ancestor of this file and the last known version of this file on disk.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

isBinary

public boolean isBinary()
Tells whether this file (in the repository) has been determined to be a binary file. StarTeam flags a file as "binary" if any null (0x0) characters are found in the file.

Returns:
true if this repository file has been determined to be binary
See Also:
FileUtils.isBinary(java.io.File)

update

public void update()
Presists a new version of this file object in the repository. If this is a new file it will be added to the repository. If this file exists in the repository then a new version of this file will be added to reflect any local changes made to this file's properties (for example, the name or description). This method cannot be used to "checkin" new file contents. You must use one of the checkin methods for that.

Overrides:
update in class Item

rename

public void rename(java.lang.String newName)
Renames this file to a new name along with the side effect of changing the corresponding local file's name as well. This method does the same work as update() but also maintains the status information so that the newly renamed file will have the same status it did prior to the renaming. Simply using setName() and update() will not change the local file name consequently status information would be lost. NOTE: in the case where a file already exists with the new name, but it is not the same file as the old one [e.g., on Unix systems where only the case of the filenames differ], the local file will not be renamed, to avoid loss of data for users.

Parameters:
newName - the file's new name

convertArchive

public void convertArchive(boolean useDeltaStorage,
                           int compressionLevel)
This method causes the server to convert all versions stored in the archives associated with the file to the storage parameters specified. This can not be called for a not-in-view file (an exception will be thrown). A new file revision will be created. Note that archive conversion is irreversible in the sense that the archive cannot be restored to its original state if it contained versions using mixed storage options. Note also that the archive conversion may be a fairly long operation depending on the number and size of versions stored in the archive files.

Parameters:
useDeltaStorage - true if the archive should use delta storage
compressionLevel - desired compression level. This value must be one of the possible values for the FILE_COMPRESSION_LEVEL enumerated property.
See Also:
PropertyNames.FILE_COMPRESSION_LEVEL, PropertyEnums.FILE_COMPRESSION_LEVEL_NONE, PropertyEnums.FILE_COMPRESSION_LEVEL_MAXIMIZE_SPEED, PropertyEnums.FILE_COMPRESSION_LEVEL_DEFAULT, PropertyEnums.FILE_COMPRESSION_LEVEL_MAXIMIZE_COMPRESSION

convertToNativeIIArchive

public void convertToNativeIIArchive(boolean bDeleteOldArchives)
Convert this File's archives to Native II format. Available starting with server release 7.0; ignored for earlier releases.

Parameters:
bDeleteOldArchives - True if old archives should be deleted, otherwise false.

add

public void add(java.io.File file,
                java.lang.String name,
                java.lang.String desc,
                java.lang.String reason,
                int lockStatus,
                boolean eol,
                boolean updateStatus)
         throws java.io.IOException
Adds this (new) file to the project/view.

Parameters:
file - the local file whose contents are to be used for this new file
name - the repository name of the file.
desc - the file's decription
reason - the initial checkin reason
lockStatus - the file's lock status once it has been added
eol - if true will convert end-of-lines to CRLF
updateStatus - if true will have StarTeam remember what file is on disk
Throws:
java.io.IOException - if there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

addAndReturn

public AddResult addAndReturn(java.io.File file,
                              java.lang.String name,
                              java.lang.String desc,
                              java.lang.String reason,
                              int lockStatus,
                              boolean eol,
                              boolean updateStatus)
                       throws java.io.IOException
Adds this (new) file to the project/view.

Parameters:
file - the local file whose contents are to be used for this new file
name - the repository name of the file.
desc - the file's decription
reason - the initial checkin reason
lockStatus - the file's lock status once it has been added
eol - if true will convert end-of-lines to CRLF
updateStatus - if true will have StarTeam remember what file is on disk
Returns:
information specific to the result of the add operation
Throws:
java.io.IOException - if there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

addFromStream

public void addFromStream(java.io.InputStream stream,
                          java.lang.String fileName,
                          java.lang.String description,
                          java.lang.String comment,
                          int lockStatus,
                          boolean eol)
                   throws java.io.IOException
Adds a new file to the repository using the provided stream's file contents.

Parameters:
stream - the stream source whose contents are to be used for this new file
lockStatus - the file's lock status once it has been added
eol - if true will convert end-of-lines to CRLF
Throws:
java.io.IOException - if there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

checkin

public void checkin(CheckinOptions options)
             throws java.io.IOException
Check in this File using the specified options

Parameters:
options - the options to be used to check out this file.
java.io.IOException

checkin

public void checkin(java.lang.String reason,
                    int lockStatus,
                    boolean forceCheckin,
                    boolean eol,
                    boolean updateStatus)
             throws java.io.IOException
Check in a new version of this file.

Parameters:
reason - the checkin reason or comment for this revision
lockStatus - the new lock status for this file
forceCheckin - false if you want the server to throw an exception if the file's status is anything other than "Modified".
eol - if true will convert all end-of-lines to CRLF (for non-binary files)
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Throws:
java.io.IOException - is there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.LockType, File.getStatus()

checkinFrom

public void checkinFrom(java.io.File file,
                        java.lang.String reason,
                        int lockStatus,
                        boolean forceCheckin,
                        boolean eol,
                        boolean updateStatus)
                 throws java.io.IOException
Adds this new version of the file to the repository. The location of the file contents is explicitly specified, thereby overriding the default location.

Parameters:
file - the location of the file whose contents are used for the new revision of this file
reason - the checkin reason or comment for this revision
lockStatus - the new lock status for this file
forceCheckin - false if you want the server to throw an exception if the file's status is anything other than "Modified".
eol - if true will convert all end-of-lines to CRLF (for non-binary files)
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Throws:
java.io.IOException - is there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.LockType, File.getStatus()

checkinFromAndReturn

public CheckInResult checkinFromAndReturn(java.io.File file,
                                          java.lang.String reason,
                                          int lockStatus,
                                          boolean forceCheckin,
                                          boolean eol,
                                          boolean updateStatus)
                                   throws java.io.IOException
Adds this new version of the file to the repository. The location of the file contents is explicitly specified, thereby overriding the default location.

Parameters:
file - the location of the file whose contents are used for the new revision of this file
reason - the checkin reason or comment for this revision
lockStatus - the new lock status for this file
forceCheckin - false if you want the server to throw an exception if the file's status is anything other than "Modified".
eol - if true will convert all end-of-lines to CRLF (for non-binary files)
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Returns:
information specific to the checkin operation
Throws:
java.io.IOException - is there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.LockType, File.getStatus()

checkinFromStream

public void checkinFromStream(java.io.InputStream source,
                              java.lang.String checkinReason,
                              int lockStatus,
                              boolean eol)
                       throws java.io.IOException
Adds this new version of the file to the repository. The contents of the file revision are obtained from the provided input stream.

Parameters:
source - the source input stream providing the new contents of this file revision
lockStatus - the new lock status for this file
eol - if true will convert all end-of-lines to CRLF (for non-binary files)
Throws:
java.io.IOException - is there are problems reading the local file
See Also:
Item.LockType

checkout

public void checkout(CheckoutOptions options)
              throws java.io.IOException
Check out this File using the specified options.

Parameters:
options - the options to be used to check out this file.
java.io.IOException

checkout

public void checkout(int lockStatus,
                     boolean timeStampNow,
                     boolean eol,
                     boolean updateStatus)
              throws java.io.IOException
Checks out the tip version of this file.

Parameters:
lockStatus - the new lock status for this file
timeStampNow - if false the local file will be given the same "last modified" time stamp as this revision has when checked in
eol - if true will convert all end-of-lines to your local platforms's end of line convention
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Throws:
java.io.IOException - is there are problems writing to the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.LockType, File.getContentModificationTime(), File.getStatus()

checkoutTo

public void checkoutTo(java.io.File checkoutTo,
                       int lockStatus,
                       boolean timeStampNow,
                       boolean eol,
                       boolean updateStatus)
                throws java.io.IOException
Check out the tip version, overriding the working file location. You can pass null for file and it will check out to the default location.

Parameters:
checkoutTo - the location of where the contents should be checked out to
lockStatus - the new lock status for this file
timeStampNow - if false the local file will be given the same "last modified" time stamp as this revision has when checked in
eol - if true will convert all end-of-lines to your local platforms's end of line convention
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Throws:
java.io.IOException - is there are problems writing to the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.LockType, File.getContentModificationTime(), Platform#getEOL(), File.getStatus()

checkoutToAndReturn

public CheckOutResult checkoutToAndReturn(java.io.File checkoutTo,
                                          int lockStatus,
                                          boolean timeStampNow,
                                          boolean eol,
                                          boolean updateStatus)
                                   throws java.io.IOException
Check out the tip version, obyverriding the working file location. You can pass null for file and it will check out to the default location.

Parameters:
checkoutTo - the location of where the contents should be checked out to
lockStatus - the new lock status for this file
timeStampNow - if false the local file will be given the same "last modified" time stamp as this revision has when checked in
eol - if true will convert all end-of-lines to your local platforms's end of line convention
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Returns:
information specific to the checkin operation
Throws:
java.io.IOException - is there are problems writing to the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.LockType, File.getContentModificationTime(), Platform#getEOL(), File.getStatus()

checkoutByDate

public boolean checkoutByDate(java.io.File checkoutTo,
                              OLEDate date,
                              int lockStatus,
                              boolean timeStampNow,
                              boolean eol,
                              boolean updateStatus)
                       throws java.io.IOException
Check out by date, overriding the default working file location. You can pass null for file and it will check out to the default location.

Parameters:
checkoutTo - the file on disk where the contents will be placed
date - the date specifying which revision to checkout
lockStatus - the new lock status for this file
timeStampNow - if false the local file will be given the same "last modified" time stamp as this revision has when checked in
eol - if true will convert all end-of-lines to your local platforms's end of line convention
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Returns:
false if the date specified was prior to the creation of the file, true otherwise
Throws:
java.io.IOException - is there are problems writing to the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.getFromHistoryByDate(com.starbase.util.OLEDate), Item.LockType, File.getContentModificationTime(), Platform#getEOL(), File.getStatus()

checkoutByLabelID

public boolean checkoutByLabelID(java.io.File checkoutTo,
                                 int labelID,
                                 int lockStatus,
                                 boolean timeStampNow,
                                 boolean eol,
                                 boolean updateStatus)
                          throws java.io.IOException
Check out by label, overriding the default working file location. You can pass null for file and it will check out to the default location.

Parameters:
checkoutTo - the file on disk where the contents will be placed
labelID - the label ID specifying which revision to checkout
lockStatus - the new lock status for this file
timeStampNow - if false the local file will be given the same "last modified" time stamp as this revision has when checked in
eol - if true will convert all end-of-lines to your local platforms's end of line convention
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Returns:
false if no revision had the specified label attached, true otherwise
Throws:
java.io.IOException - is there are problems writing to the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.getFromHistoryByLabelID(int), Item.LockType, File.getContentModificationTime(), Platform#getEOL(), File.getStatus()

checkoutByVersion

public boolean checkoutByVersion(java.io.File checkoutTo,
                                 int viewVersion,
                                 int lockStatus,
                                 boolean timeStampNow,
                                 boolean eol,
                                 boolean updateStatus)
                          throws java.io.IOException
Check out by view version, overriding the default working file location. You can pass null for file and it will check out to the default location.

Parameters:
checkoutTo - the file on disk where the contents will be placed
viewVersion - the view version of the file to check out
lockStatus - the new lock status for this file
timeStampNow - if false the local file will be given the same "last modified" time stamp as this revision has when checked in
eol - if true will convert all end-of-lines to your local platforms's end of line convention
updateStatus - if true will have StarTeam remember what version of this file is on your local disk so getStatus() will return the correct value
Returns:
false if the file does not have the specified version, true otherwise
Throws:
java.io.IOException - is there are problems writing to the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.getFromHistoryByVersion(int), Item.LockType, File.getContentModificationTime(), Platform#getEOL(), File.getStatus()

checkoutToStream

public void checkoutToStream(java.io.OutputStream destination,
                             int lockStatus,
                             boolean eol)
                      throws java.io.IOException
Checks out the tip version of this file and write it to the specified stream.

Parameters:
destination - the output stream to which the file will be written
lockStatus - the new lock status for this file
eol - if true will convert all end-of-lines to your local platforms's end of line convention
Throws:
java.io.IOException - is there are problems writing to the local file
See Also:
Item.LockType

updateStatus

public void updateStatus(boolean eolConversion,
                         boolean useMD5)
                  throws java.io.IOException
Attempts to update the repository information about what version of the file is actually on disk. This method will send either the whole file or its MD5 checksum to the server to see if the contents exactly matche any known version of the file. If it does match then the StarTeam Server will use that information for status computation. If the contents do not match any known version then the server's status information will remain unchanged.

Example uses of this would be if you copied the file to its new location through the OS rather than StarTeam the file's status would be "Unknown" If the local file had the same contents as the tip version of the file in the repository then further status computations would report the file as "Current".

Parameters:
eolConversion - true if you want to apply end-of-line conversion to the file before sending it or its MD5 to the server.
useMD5 - true if you want to just send the file's MD5 checksum and false if you wish to send the entire file
Throws:
java.io.IOException - if an error occurs while reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.getStatus(), Status

resyncStatus

public void resyncStatus(MD5 compareMD5,
                         int compareSize,
                         MD5 syncMD5,
                         int syncSize,
                         OLEDate syncTime)
Deprecated. Use resyncStatusEx, which supports file sizes greater than 2GB.

Attempts to update the repository information about what version of the file is actually on disk.

This method is similar to updateStatus, except that information about the working file is provided explicitly by the caller. The working file itself is not used, and in fact does not need to be accessible. This is useful, for example, if the actual working file resides on a remote client workstation.

Parameters:
compareMD5 - The original MD5 signature of this file, as stored in the StarTeam repository. This is the signature that is compared against the signatures of the various revisions of this file, looking for a match. The compareMD5 signature may be different from the syncMD5 signature as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout. The compareMD5 signature is typically derived using FileStream.computeCompareMD5().
compareSize - The original size of this file, as stored in the StarTeam repository. This may be different from syncSize as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout.
syncMD5 - The MD5 signature of the actual working file on disk. Typically derived using FileStream.computeSyncMD5().
syncSize - The size of the actual working file on disk.
syncTime - The last modified date of the actual working file on disk.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.updateStatus(boolean, boolean), File.updateStatusFromMD5(com.starbase.util.MD5), File.getStatusByMD5(com.starbase.util.MD5), FileStream.computeCompareMD5(java.io.File, boolean, boolean, com.starbase.util.MD5), FileStream.computeSyncMD5(java.io.File, com.starbase.util.MD5), Status, File.resyncStatusEx(com.starbase.util.MD5, long, com.starbase.util.MD5, long, com.starbase.util.OLEDate)

resyncStatusEx

public void resyncStatusEx(MD5 compareMD5,
                           long compareSize,
                           MD5 syncMD5,
                           long syncSize,
                           OLEDate syncTime)
Attempts to update the repository information about what version of the file is actually on disk.

This method is similar to updateStatus, except that information about the working file is provided explicitly by the caller. The working file itself is not used, and in fact does not need to be accessible. This is useful, for example, if the actual working file resides on a remote client workstation.

Parameters:
compareMD5 - The original MD5 signature of this file, as stored in the StarTeam repository. This is the signature that is compared against the signatures of the various revisions of this file, looking for a match. The compareMD5 signature may be different from the syncMD5 signature as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout. The compareMD5 signature is typically derived using FileStream.computeCompareMD5().
compareSize - The original size of this file, as stored in the StarTeam repository. This may be different from syncSize as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout.
syncMD5 - The MD5 signature of the actual working file on disk. Typically derived using FileStream.computeSyncMD5().
syncSize - The size of the actual working file on disk.
syncTime - The last modified date of the actual working file on disk.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.updateStatus(boolean, boolean), File.updateStatusFromMD5(com.starbase.util.MD5), File.getStatusByMD5(com.starbase.util.MD5), FileStream.computeCompareMD5(java.io.File, boolean, boolean, com.starbase.util.MD5), FileStream.computeSyncMD5(java.io.File, com.starbase.util.MD5), Status

getFileSyncInfo

public FileSyncInfo getFileSyncInfo(MD5 compareMD5,
                                    int compareSize,
                                    MD5 syncMD5,
                                    int syncSize,
                                    OLEDate syncTime)
Deprecated. Use getFileSyncInfoEx, which supports file sizes greater than 2GB.

Attempts to determine what version of the file is actually on disk.

This method is similar to resyncStatus, except that the status information is returned to the caller, rather than being cached with the Server object. This is useful for server-based applications running on behalf of a remote client, when running against a StarTeam server that supports client-managed status.

Parameters:
compareMD5 - The original MD5 signature of this file, as stored in the StarTeam repository. This is the signature that is compared against the signatures of the various revisions of this file, looking for a match. The compareMD5 signature may be different from the syncMD5 signature as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout. The compareMD5 signature is typically derived using FileStream.computeCompareMD5().
compareSize - The original size of this file, as stored in the StarTeam repository. This may be different from syncSize as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout.
syncMD5 - The MD5 signature of the actual working file on disk. Typically derived using FileStream.computeSyncMD5().
syncSize - The size of the actual working file on disk.
syncTime - The last modified date of the actual working file on disk.
Returns:
The file status information describing which version of the file is actually on disk. Returns null if the status information could not be determined.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), FileStream.computeCompareMD5(java.io.File, boolean, boolean, com.starbase.util.MD5), FileStream.computeSyncMD5(java.io.File, com.starbase.util.MD5), Status, File.getFileSyncInfoEx(com.starbase.util.MD5, long, com.starbase.util.MD5, long, com.starbase.util.OLEDate)

getFileSyncInfoEx

public FileSyncInfo getFileSyncInfoEx(MD5 compareMD5,
                                      long compareSize,
                                      MD5 syncMD5,
                                      long syncSize,
                                      OLEDate syncTime)
Attempts to determine what version of the file is actually on disk.

This method is similar to resyncStatus, except that the status information is returned to the caller, rather than being cached with the Server object. This is useful for server-based applications running on behalf of a remote client, when running against a StarTeam server that supports client-managed status.

Parameters:
compareMD5 - The original MD5 signature of this file, as stored in the StarTeam repository. This is the signature that is compared against the signatures of the various revisions of this file, looking for a match. The compareMD5 signature may be different from the syncMD5 signature as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout. The compareMD5 signature is typically derived using FileStream.computeCompareMD5().
compareSize - The original size of this file, as stored in the StarTeam repository. This may be different from syncSize as a result of compensating for the effects of expanding keywords and performing end-of-line conversion on checkout.
syncMD5 - The MD5 signature of the actual working file on disk. Typically derived using FileStream.computeSyncMD5().
syncSize - The size of the actual working file on disk.
syncTime - The last modified date of the actual working file on disk.
Returns:
The file status information describing which version of the file is actually on disk. Returns null if the status information could not be determined.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), FileStream.computeCompareMD5(java.io.File, boolean, boolean, com.starbase.util.MD5), FileStream.computeSyncMD5(java.io.File, com.starbase.util.MD5), Status

removeAndDeleteLocal

public void removeAndDeleteLocal()
                          throws java.io.IOException
Removes the file item from its parent folder. Note that a file may be shared in another folder in the same or different view. This method will merely remove the one instance (or shared copy) that the method is called on. In addition, this method will delete the corresponding working file.

Throws:
java.io.IOException - if there is a problem deleting the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

deleteLocalFile

public boolean deleteLocalFile(java.io.File file)
                        throws java.io.IOException
Deletes the specified local file and has the side effect of deleting sync information from the server about the file.

Parameters:
file - the local file to delete
Returns:
true if the file was deleted and false otherwise
Throws:
java.io.IOException - if the file is a directory or other error occurs trying to delete the file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

moveLocalFile

public java.io.File moveLocalFile(java.io.File fromFile,
                                  java.lang.String toFolderPath)
                           throws java.io.IOException
Moves the local file to the specified folder and has the side effect of moving the status information from the original file to the newly created one Deletes the original file and it's status information at the end of the move

Parameters:
toFolderPath - String the folder to move it to.
Throws:
java.io.IOException - if an unexpected error occurs in the process

deleteSyncInfo

public void deleteSyncInfo(java.io.File file)
Removes sync information from this File object's Server. Once it has been called the Status for file will be unknown. Use with caution.

Parameters:
file - the local file for which to delete status information
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

lock

public void lock()
Obtains an exclusive lock on this file without attempting to break an existing lock. A server exception will be thrown if the lock cannot be obtained.

Overrides:
lock in class Item
See Also:
Item.LockType, File.putLock(int, boolean)

unlock

public void unlock()
Removes the current user's lock from this file. If another user has an exclusive lock on the file this method will not remove that lock.

Overrides:
unlock in class Item
See Also:
Item.LockType, File.putLock(int, boolean)

putLock

public void putLock(int lockType,
                    boolean breakLock)
Sets the current user's lock for this file. This method can be used to break another user's exclusive lock on the file. An exception will be thrown if a break is attempted for a user that does not have sufficient rights to break locks.

Overrides:
putLock in class Item
Parameters:
lockType - the type of lock to be obtained
breakLock - true if the server should break an exclusive lock
See Also:
Item.LockType

updateStatusFromTime

public void updateStatusFromTime(int size,
                                 OLEDate lastModified)
Deprecated. Use updateStatusFromTimeEx, which supports file sizes greater than 2GB.

Updates the server's status information to reflect the fact that the local file's content has the given size and last modified date.

The MD5 signature is assumed to be unknown, and any previously specified value will remain unchanged.

This is useful when the working file resides on a remote workstation, and the remote client is able to calculate the status parameters.

Parameters:
size - The size of the working file on disk.
lastModified - The last modified date of the working file.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.getStatusByTime(int, com.starbase.util.OLEDate), File.updateStatusFromMD5(com.starbase.util.MD5), File.updateStatusInformation(int, com.starbase.util.OLEDate, com.starbase.util.MD5), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status, File.updateStatusFromTimeEx(long, com.starbase.util.OLEDate)

updateStatusFromTimeEx

public void updateStatusFromTimeEx(long size,
                                   OLEDate lastModified)
Updates the server's status information to reflect the fact that the local file's content has the given size and last modified date.

The MD5 signature is assumed to be unknown, and any previously specified value will remain unchanged.

This is useful when the working file resides on a remote workstation, and the remote client is able to calculate the status parameters.

Parameters:
size - The size of the working file on disk.
lastModified - The last modified date of the working file.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.getStatusByTime(int, com.starbase.util.OLEDate), File.updateStatusFromMD5(com.starbase.util.MD5), File.updateStatusInformation(int, com.starbase.util.OLEDate, com.starbase.util.MD5), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status

updateStatusFromMD5

public void updateStatusFromMD5(MD5 signature)
Updates the server's status information to reflect the fact that the local file's content has the given MD5 signature.

The file size and last modified date are assumed to be unknown. Any previously specified values will remain unchanged.

This is useful when the working file resides on a remote workstation, and the remote client is able to calculate the status parameters.

Parameters:
signature - The MD5 signature of the working file.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.getStatusByMD5(com.starbase.util.MD5), File.updateStatusFromTime(int, com.starbase.util.OLEDate), File.updateStatusInformation(int, com.starbase.util.OLEDate, com.starbase.util.MD5), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status

updateStatusInformation

public void updateStatusInformation(int fileSize,
                                    OLEDate lastModified,
                                    MD5 signature)
Deprecated. Use updateStatusInformationEx, which supports file sizes greater than 2GB.

Updates the server's status information to reflect the fact that the local file's content has the given size, last modified date, and MD5 signature.

This is useful when the working file resides on a remote workstation, and the remote client is able to calculate the status parameters.

Parameters:
fileSize - The size of the working file on disk. A negative value indicates that the size is unknown.
lastModified - The last modified date of the working file. null indicates that the last modified date is unknown.
signature - The MD5 signature of the working file. null indicates that the signature is unknown.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.updateStatusFromTime(int, com.starbase.util.OLEDate), File.updateStatusFromMD5(com.starbase.util.MD5), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status, File.updateStatusInformationEx(long, com.starbase.util.OLEDate, com.starbase.util.MD5)

updateStatusInformationEx

public void updateStatusInformationEx(long fileSize,
                                      OLEDate lastModified,
                                      MD5 signature)
Updates the server's status information to reflect the fact that the local file's content has the given size, last modified date, and MD5 signature.

This is useful when the working file resides on a remote workstation, and the remote client is able to calculate the status parameters.

Parameters:
fileSize - The size of the working file on disk. A negative value indicates that the size is unknown.
lastModified - The last modified date of the working file. null indicates that the last modified date is unknown.
signature - The MD5 signature of the working file. null indicates that the signature is unknown.
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), File.updateStatusFromTime(int, com.starbase.util.OLEDate), File.updateStatusFromMD5(com.starbase.util.MD5), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status

updateStatusAfterMerge

public void updateStatusAfterMerge()
                            throws java.io.IOException
Updates the server's status information to reflect the fact that the local file's contents were derived from this file's contents. You would most commonly want to call this after merging in changes. This file's status will be "Modified" after a call to this method if this file is the tip version of the file.

Throws:
java.io.IOException - if there are problems reading the local file
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

getLastKnownVersionOnDisk

public int getLastKnownVersionOnDisk()
Returns the last known version of this file on disk. Returns -1 if the status information is unknown. The value returned is the view version of the last known revision on disk. This method will refresh the status information prior to determining the value and hence might be expensive to compute if called often.

Returns:
the view version of the last known version of this file on disk
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied(), Item.getViewVersion()

getStatus

public int getStatus()
              throws java.io.IOException
Gets the status of the default working file relative to the latest version of this file in the repository.

Status is determined by comparing the current size and last modified time with that of the last known version on disk.

Returns:
The current status of this file.
Throws:
java.io.IOException - if an error occurs while reading the local file
See Also:
Status, File.getStatus(java.io.File file), File.getSmartStatus()

getStatus

public int getStatus(java.io.File file)
              throws java.io.IOException
Gets the status of the given working file relative to the latest version of this file in the repository.

Status is determined by comparing the current size and last modified time with that of the last known version on disk.

Parameters:
file - The working file whose status is to be determined.
Returns:
The current status of this file.
Throws:
java.io.IOException - if an error occurs while reading the local file
See Also:
Status, File.getSmartStatus(java.io.File file)

getSmartStatus

public int getSmartStatus()
                   throws java.io.IOException
Gets the status of the default working file relative to the latest version of this file in the repository.

Status is determined by comparing the current size and last modified time with that of the last known version on disk. However, if the working file differs only in modified time, then the equivalent of an "Update Status" is performed. This gives a more accurate status in cases where the file content has not actually changed.

Returns:
The current status of this file.
Throws:
java.io.IOException - if an error occurs while reading the local file
See Also:
Status, File.getStatus()

getSmartStatus

public int getSmartStatus(java.io.File file)
                   throws java.io.IOException
Gets the status of the given working file relative to the latest version of this file in the repository.

Status is determined by comparing the current size and last modified time with that of the last known version on disk. However, if the working file differs only in modified time, then the equivalent of an "Update Status" is performed. This gives a more accurate status in cases where the file content has not actually changed.

Parameters:
file - The working file whose status is to be determined.
Returns:
The current status of this file.
Throws:
java.io.IOException - if an error occurs while reading the local file
See Also:
Status, File.getStatus(java.io.File file)

upgradeSyncInfo

public boolean upgradeSyncInfo()
                        throws java.io.IOException
Deprecated. All supported versions of the StarTeam server support client-managed status information. Upgrading to client-managed status is no longer necessary.

Move status records from an old server to the new client managed status information. Returns true if sync information was found and moved locally and false otherwise. This will return false and do nothing if the file is from a newer server that supports client managed status.

Throws:
DisembodiedItemException - if this File is disembodied
java.io.IOException
See Also:
Item.isDisembodied()

getStatusNow

public int getStatusNow()
                 throws java.io.IOException
Same as getStatus, but this method first goes to the server to refresh the status information.

Returns:
this file's status
Throws:
java.io.IOException - if there are any problems reading the local file
See Also:
Status

getLastKnownStatus

public int getLastKnownStatus()
Returns the last known status of the default working file relative to the file in the repository, using only information provided by the client during the last status update operation. Assumes the working file is not available locally (for example, it might reside on a remote client workstation).

Returns:
The status code for this file

getStatusByTime

public int getStatusByTime(int size,
                           OLEDate lastModified)
Deprecated. Use getStatusByTimeEx, which supports file sizes greater than 2GB.

Returns the status of the default working file relative to the file in the repository, using the given size and last modified date of the file. Assumes the working file is not available locally (for example, it might reside on a remote client workstation).

Parameters:
size - The size of the working file on disk.
lastModified - The last modified date of the working file.
Returns:
The status code for this file.
See Also:
File.getStatusByMD5(com.starbase.util.MD5), File.updateStatusFromTime(int, com.starbase.util.OLEDate), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status, File.getStatusByTimeEx(long, com.starbase.util.OLEDate)

getStatusByTimeEx

public int getStatusByTimeEx(long size,
                             OLEDate lastModified)
Returns the status of the default working file relative to the file in the repository, using the given size and last modified date of the file. Assumes the working file is not available locally (for example, it might reside on a remote client workstation).

Parameters:
size - The size of the working file on disk.
lastModified - The last modified date of the working file.
Returns:
The status code for this file.
See Also:
File.getStatusByMD5(com.starbase.util.MD5), File.updateStatusFromTime(int, com.starbase.util.OLEDate), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status

isInSyncByTime

public static boolean isInSyncByTime(java.io.File file,
                                     FileSyncInfo syncInfo)
                              throws java.io.IOException
Determines whether or not the given file has the size and last modified date indicated in the given FileSyncInfo record.

Parameters:
file - A working file.
syncInfo - File synchronization information.
Returns:
True if the given file is in sync with respect to size and last modified date; false otherwise.
Throws:
java.io.IOException

getStatusByMD5

public int getStatusByMD5(MD5 md5)
Returns the status of the default working file relative to the file in the repository, using the given size MD5 signature of the file. Assumes the working file is not available locally (for example, it might reside on a remote client workstation).

Parameters:
md5 - The MD5 signature of the working file, or null if the signature is unknown or unchanged.
Returns:
The status code for this file.
See Also:
File.getStatusByTime(int, com.starbase.util.OLEDate), File.updateStatusFromMD5(com.starbase.util.MD5), File.resyncStatus(com.starbase.util.MD5, int, com.starbase.util.MD5, int, com.starbase.util.OLEDate), Status

isInSyncByMD5

public static boolean isInSyncByMD5(java.io.File file,
                                    FileSyncInfo syncInfo)
                             throws java.io.IOException
Determines whether or not the given file has the MD5 signature indicated in the given FileSyncInfo record.

Parameters:
file - A working file.
syncInfo - File synchronization information.
Returns:
True if the given file is in sync with respect to MD5 signature; false otherwise.
Throws:
java.io.IOException

getBlankKeywords

public Keyword[] getBlankKeywords()
Returns an array of the default StarTeam keywords. All the keywords are "blank" meaning no values are filled in. This can be used to unexpand keywords in a file where the actual keyword values are not needed.

Returns:
an array of blank StarTeam keywords
See Also:
File.usesKeywords(), Keyword

usesKeywords

public boolean usesKeywords()
Tells whether or not this file will use keyword expansion. This is determined by looking at the project's keyword properties and this file's extension.

Returns:
true if this file uses keyword expansion
Throws:
DisembodiedItemException - if this File is disembodied
See Also:
Item.isDisembodied()

toString

public java.lang.String toString()
Returns the name of this file.

Overrides:
toString in class Item
Returns:
the name of this file

getExtension

public java.lang.String getExtension()
Returns the file name extension. E.g. for "foo.txt" this would return "txt", for "foo" it would return the empty string.

Returns:
the file name extension.
See Also:
PropertyNames.FILE_EXTENSION

getStatusKnown

public boolean getStatusKnown()
Returns true if status information is known for this file. Returns true if status information is known for this file.

See Also:
PropertyNames.FILE_SYNC_KNOWN

getLocalFileExists

public boolean getLocalFileExists()
Returns true if the local file exists on disk.

Returns:
true if the local file exists on disk.
See Also:
PropertyNames.FILE_LOCAL_FILE_EXISTS

getLocalFileExecutable

public boolean getLocalFileExecutable()
                               throws java.io.IOException
Returns true if the local file is executable.

Returns:
true if the local file is executable.
Throws:
java.io.IOException - if any file system error occurs.
See Also:
PropertyNames.FILE_LOCAL_EXECUTABLE

getLocalName

public java.lang.String getLocalName()
                              throws java.io.IOException
Returns the local file name, as recognized by the local file system.

Returns:
the local file name, as recognized by the local file system.
Throws:
java.io.IOException - if any file system error occurs.
See Also:
PropertyNames.FILE_LOCAL_NAME

getLocalPath

public java.lang.String getLocalPath()
                              throws java.io.IOException
Returns the local path, as recognized by the local file system.

Returns:
the local path, as recognized by the local file system.
Throws:
java.io.IOException - if any file system error occurs.
See Also:
PropertyNames.FILE_LOCAL_PATH

getLocalTimeStamp

public OLEDate getLocalTimeStamp()
                          throws java.io.IOException
Returns the local file's time stamp. If the local file does not exist this will return a time whose double value is 0.0.

Returns:
the local file's time stamp.
java.io.IOException
See Also:
PropertyNames.FILE_LOCAL_TIMESTAMP

getLocalSize

public int getLocalSize()
Deprecated. Use getLocalSizeEx, which supports file sizes greater than 2GB.

Returns the local file's size. If the file does not exist this returns -1.

Returns:
the local file's size.
See Also:
PropertyNames.FILE_LOCAL_SIZE, File.getLocalSizeEx()

getLocalSizeEx

public long getLocalSizeEx()
Returns the local file's size. If the file does not exist this returns -1.

Returns:
the local file's size.
See Also:
PropertyNames.FILE_LOCAL_SIZE

equals

public boolean equals(java.lang.Object source)
returns true if this object instance is equal to the source

Overrides:
equals in class Item
Parameters:
source - Object the source to comapre with
Returns:
boolean true if this object is equal to the source

hashCode

public int hashCode()
returns a unique hash for all instances of this type

Overrides:
hashCode in class Item
Returns:
int a unique hash for all instances of this type


StarTeam SDK 10.4, Build 36
Copyright © 2003-2008 Borland Software Corporation. All rights reserved.