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)
Deprecated.
As of Java API 2.2.1.
|
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 the file was checked out, if it is checked out.
|
String |
getComment()
Gets the comment that was provided when the content was created.
|
String |
getDigest()
Gets the digest value of the file based on the MD5 algorithm.
|
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.
|
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 of 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
- whether the file can be copied to the user's workspace.attributes
- the extended attributes defined on the repository file.size
- the size (in bytes) of the file.checkedOut
- whether the file is currently checked out or not.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
- whether the file is versioned or not.version
- the current version of the file (if it is versioned).comment
- the comment provided when this content was created.locked
- whether the file is locked or not.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.@Deprecated 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)
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 of 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
- whether the file can be copied to the user's workspace.attributes
- the extended attributes defined on the repository file.size
- the size (in bytes) of the file.checkedOut
- whether the file is currently checked out or not.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
- whether the file is versioned or not.version
- the current version of the file (if it is versioned).comment
- the comment provided when this content was created.locked
- whether the file is locked or not.signingStatus
- the signature status of the file.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 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
Copyright (c) 2019, SAS Institute Inc., Cary, NC, USA