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, 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".

<