public class RepositoryFile extends RepositoryItem
Modifier and Type | Class and Description |
---|---|
static class |
RepositoryFile.SigningStatus
Describes the overall signature status of the file.
|
RepositoryItem.State, RepositoryItem.Syncable
Constructor and Description |
---|
RepositoryFile(String typeId,
String id,
String name,
String path,
long revision,
RepositoryItem.State state,
String createdBy,
Date created,
String lastModifiedBy,
Date lastModified,
String propertiesLastModifiedBy,
Date propertiesLastModified,
String description,
RepositoryItem.Syncable syncable,
List<Attribute> attributes,
long size,
boolean checkedOut,
String checkedOutBy,
Date checkedOutDate,
boolean versioned,
String version,
String comment,
boolean locked,
RepositoryFile.SigningStatus signingStatus,
VersionLimits versionLimits,
String digest)
It is not intended or recommended that the consumer of the API construct these objects.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
String |
getCheckedOutBy()
Gets the user who has the file checked out, if it is checked out.
|
Date |
getCheckedOutDate()
Gets the date on which the file was checked out, if it is checked out.
|
String |
getComment()
Gets the comment that was specified when the content was created.
|
String |
getDigest()
Gets the digest value of the file based on the MD5 algorithm.
|
Integer |
getMajorLimit()
Gets the limit of major versions to retain for a file.
|
Integer |
getMinorLimit()
Gets the limit of minor versions to retain for a file.
|
RepositoryFile.SigningStatus |
getSigningStatus()
Gets the signature status of the file.
|
long |
getSize()
Gets the size (in bytes) of the repository file.
|
String |
getVersion()
Gets the current version of the file, if it is versioned.
|
VersionLimits |
getVersionLimits()
Gets the version retention limits of the file.
|
int |
hashCode() |
boolean |
isCheckedOut()
Indicates whether the file is checked out or not.
|
boolean |
isLocked()
Indicates whether the file is locked.
|
boolean |
isVersioned()
Indicates whether the file is versioned or not.
|
void |
setVersionLimits(VersionLimits versionLimits)
Sets the major and minor versions to retain for a versioned file.
|
String |
toString() |
getAttributes, getCreated, getCreatedBy, getDescription, getLastModified, getLastModifiedBy, getName, getPath, getPropertiesLastModified, getPropertiesLastModifiedBy, getRevision, getState, getSyncable, setAttributes, setDescription, setSyncable
getId, getTypeId
public RepositoryFile(String typeId, String id, String name, String path, long revision, RepositoryItem.State state, String createdBy, Date created, String lastModifiedBy, Date lastModified, String propertiesLastModifiedBy, Date propertiesLastModified, String description, RepositoryItem.Syncable syncable, List<Attribute> attributes, long size, boolean checkedOut, String checkedOutBy, Date checkedOutDate, boolean versioned, String version, String comment, boolean locked, RepositoryFile.SigningStatus signingStatus, VersionLimits versionLimits, String digest)
typeId
- The object type identifier of the repository file.id
- The unique identifier of the repository file.name
- The name of the file.path
- The full path to the file in the repository, which includes the name.revision
- The internally managed revision number of the repository file.state
- The current state of the repository file.createdBy
- The user who created the repository file.created
- The date on which the repository file was created.lastModifiedBy
- The user who last modified the repository file's content.lastModified
- The date on which the repository file's content was last modified.propertiesLastModifiedBy
- the user who last modified the repository file's properties.propertiesLastModified
- the date on which the repository file's properties were last modified.description
- The description of the file.syncable
- Indicates whether the file can be copied to the user's workspace.attributes
- The extended attributes that are defined on the repository file.size
- The size (in bytes) of the file.checkedOut
- Indicates whether the file is currently checked out.checkedOutBy
- The user who has the file checked out (if it is checked out).checkedOutDate
- The date on which the file was checked out (if it is checked out).versioned
- Indicates whether the file is versioned.version
- The current version of the file (if it is versioned).comment
- The comment specified when the content was created.locked
- Indicates whether the file is locked.signingStatus
- The signature status of the file.versionLimits
- The version retention limits of the file.digest
- The digest value of the file based on the MD5 algorithm.public long getSize()
public boolean isCheckedOut()
true
if the repository file is checked out, false
otherwise.public String getCheckedOutBy()
public Date getCheckedOutDate()
public boolean isVersioned()
true
if the repository file is versioned, false
otherwise.public String getVersion()
public String getComment()
public String getDigest()
Here is sample java code to generate the digest value for a local file. If the value from the code below is equal to the value returned from this method, the files are the same.
import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import java.security.MessageDigest; import org.apache.commons.codec.binary.Hex; private String getLocalFileDigest(InputStream in, MessageDigest md5) throws Exception { byte[] byteArray = new byte[1024]; int bytesCount = 0; //Read file data and update in message digest while ((bytesCount = in.read(byteArray)) != -1) { md5.update(byteArray, 0, bytesCount); } return new String(Hex.encodeHex(md5.digest())).toUpperCase(); }
public RepositoryFile.SigningStatus getSigningStatus()
public VersionLimits getVersionLimits()
public void setVersionLimits(VersionLimits versionLimits)
versionLimits
- The limit of major and minor versions to retain for a versioned file.public Integer getMajorLimit()
public Integer getMinorLimit()
public boolean isLocked()
true
if the repository file is locked, false
otherwise.public int hashCode()
hashCode
in class RepositoryItem
public boolean equals(Object obj)
equals
in class RepositoryItem
public String toString()
toString
in class RepositoryItem
<i>Copyright (c) 2021, SAS Institute Inc., Cary, NC, USA</i>