Interface Attachment
-
- All Superinterfaces:
Contribution
,Instance<Contribution>
,Nameable
,Securable
,Serializable
,SilverpeasResource
- All Known Subinterfaces:
LocalizedAttachment
- All Known Implementing Classes:
Document
,HistorisedDocument
,HistorisedDocumentVersion
,SimpleDocument
,SimpleDocumentVersion
public interface Attachment extends Contribution
An attachment is a document file that is attached to a contribution in Silverpeas. The document file is also a user contribution.- Author:
- mmoquillon
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description String
getAttachmentPath()
Gets the absolute path of the document file in the filesystem.String
getContentType()
Gets the content type of this attached document file as a predefined MIME type.String
getDisplayIcon()
Gets the path of the icon representing either the attachment itself or its content type.String
getFilename()
Gets the name of the document file as stored in the filesystem.int
getMajorVersion()
Gets the major part of the document version.int
getMinorVersion()
Gets the minor part of the document version.long
getSize()
Gets the size of the document file in the filesystem.String
getTitle()
Gets the title of the document.default String
getVersion()
Gets the version of the document.boolean
isVersioned()
Is this attachment versioned?-
Methods inherited from interface org.silverpeas.core.contribution.model.Contribution
canBeAccessedBy, getContributionType, getDescription, getIdentifier, getModel, getName, getResourcePath, isIndexable
-
Methods inherited from interface org.silverpeas.core.security.Securable
canBeDeletedBy, canBeFiledInBy, canBeModifiedBy
-
Methods inherited from interface org.silverpeas.core.SilverpeasResource
getCreationDate, getCreator, getLastUpdateDate, getLastUpdater
-
-
-
-
Method Detail
-
getTitle
String getTitle()
Gets the title of the document. The title is either the name set explicitly by the user to the attachment or the title fetched from the document metadata itself or the filename whether the previous data weren't provided.- Specified by:
getTitle
in interfaceContribution
- Returns:
- the title of the document.
-
getContentType
String getContentType()
Gets the content type of this attached document file as a predefined MIME type.- Returns:
- the MIME type of the document.
-
getDisplayIcon
String getDisplayIcon()
Gets the path of the icon representing either the attachment itself or its content type.- Returns:
- the path of the icon representing this attachment.
-
getFilename
String getFilename()
Gets the name of the document file as stored in the filesystem. The filename can differ from the contribution name that is the title of the document.- Returns:
- the name of the document file in the filesystem.
-
getSize
long getSize()
Gets the size of the document file in the filesystem.- Returns:
- the size in bytes.
-
getAttachmentPath
String getAttachmentPath()
Gets the absolute path of the document file in the filesystem.- Returns:
- the path of the attachment in the filesystem.
-
isVersioned
boolean isVersioned()
Is this attachment versioned? A document is versioned if each change is historized and comes to a new minor or major version.- Returns:
- true if this attachment is versioned, false otherwise.
-
getMinorVersion
int getMinorVersion()
Gets the minor part of the document version. If the attachment isn't versioned, then zero value is returned.- Returns:
- the minor version part of the document.
-
getMajorVersion
int getMajorVersion()
Gets the major part of the document version. If the attachment isn't versioned, then zero value is returned.- Returns:
- the major version part of the document.
-
getVersion
default String getVersion()
Gets the version of the document. It is a concatenation of the major and of the minor version with a dot as separator.- Returns:
- the version of the attachment or "0.0" if the document isn't versioned.
-
-