Class SimpleAttachment.Builder
- java.lang.Object
-
- org.silverpeas.core.contribution.attachment.model.SimpleAttachment.Builder
-
- Enclosing class:
- SimpleAttachment
public static class SimpleAttachment.Builder extends Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SimpleAttachment
build()
Builds the attachment from the parameters previously set with the builder.SimpleAttachment.Builder
setContentType(String contentType)
Sets the type of the content in the file.SimpleAttachment.Builder
setCreationData(String creator, Date creationDate)
Sets the data of the creation of the attachment (and hence of the file under the hood).SimpleAttachment.Builder
setDescription(String description)
Sets a short description about the content of the attachment.SimpleAttachment.Builder
setFilename(String filename)
Sets the name of the file that contains the content.SimpleAttachment.Builder
setFormId(String formId)
In the case the content is a form stored in an XML file, sets its unique identifier.SimpleAttachment.Builder
setSize(long size)
Sets the size of the content of the attachment.SimpleAttachment.Builder
setTitle(String title)
Sets the title of the attachment.
-
-
-
Method Detail
-
setFilename
public SimpleAttachment.Builder setFilename(String filename)
Sets the name of the file that contains the content. The file represents in the physical storage the attachment.- Parameters:
filename
- the name of the file to which the attachment is related.- Returns:
- itself.
-
setTitle
public SimpleAttachment.Builder setTitle(String title)
Sets the title of the attachment.- Parameters:
title
- the attachment title.- Returns:
- itself.
-
setDescription
public SimpleAttachment.Builder setDescription(String description)
Sets a short description about the content of the attachment.- Parameters:
description
- a simple textual description.- Returns:
- itself.
-
setSize
public SimpleAttachment.Builder setSize(long size)
Sets the size of the content of the attachment.- Parameters:
size
- the size of the file in bytes.- Returns:
- itself.
-
setContentType
public SimpleAttachment.Builder setContentType(String contentType)
Sets the type of the content in the file.- Parameters:
contentType
- a MIME type code defining the type of the content of the attachment.- Returns:
- itself.
-
setCreationData
public SimpleAttachment.Builder setCreationData(String creator, Date creationDate)
Sets the data of the creation of the attachment (and hence of the file under the hood).- Parameters:
creator
- the unique identifier of a user in Silverpeas.creationDate
- the datetime at which the attachment was created.- Returns:
- itself.
-
setFormId
public SimpleAttachment.Builder setFormId(String formId)
In the case the content is a form stored in an XML file, sets its unique identifier.- Parameters:
formId
- the unique identifier of a XML form instance in Silverpeas.- Returns:
- itself.
-
build
public SimpleAttachment build()
Builds the attachment from the parameters previously set with the builder.- Returns:
- a
SimpleAttachment
instance.
-
-