Class AttachmentLink
- java.lang.Object
-
- org.silverpeas.core.util.Link
-
- org.silverpeas.core.util.FileLink
-
- org.silverpeas.core.notification.user.AttachmentLink
-
-
Field Summary
-
Fields inherited from class org.silverpeas.core.util.Link
EMPTY_LINK
-
-
Constructor Summary
Constructors Constructor Description AttachmentLink(String linkUrl, String linkLabel, long linkSize, String language)
Constructs a new link with the specified URL, labels and file size.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<AttachmentLink>
getForContribution(ResourceReference resource, String language)
Gets all the web links to all of the documents attached to the specified contribution in Silverpeas and for the given language.String
getFormattedLinkSize()
Gets the size of the file referred by this link in text format.-
Methods inherited from class org.silverpeas.core.util.FileLink
getLinkSize
-
Methods inherited from class org.silverpeas.core.util.Link
getLinkLabel, getLinkUrl
-
-
-
-
Constructor Detail
-
AttachmentLink
public AttachmentLink(String linkUrl, String linkLabel, long linkSize, String language)
Constructs a new link with the specified URL, labels and file size.- Parameters:
linkUrl
- the URL of the linked file.linkLabel
- the label to render for that link.linkSize
- the size in byte of the linked file.language
- the language of the attachment.
-
-
Method Detail
-
getForContribution
public static List<AttachmentLink> getForContribution(ResourceReference resource, String language)
Gets all the web links to all of the documents attached to the specified contribution in Silverpeas and for the given language.- Parameters:
resource
- a reference to the contribution in Silverpeas.language
- the ISO 631-1 code of the language in which the attachments have to be get.- Returns:
- a list of Web links to the attachments. If the contribution have no attachments, then an empty list is returned.
-
getFormattedLinkSize
public String getFormattedLinkSize()
Gets the size of the file referred by this link in text format. This method is used by templates to indicate the size of the attached document targeted by this link.- Returns:
- the size of the linked file expressed into the more suitable size unit.
-
-