Class Attachment
- java.lang.Object
-
- org.exoplatform.social.core.model.Attachment
-
- Direct Known Subclasses:
AvatarAttachment,BannerAttachment
public abstract class Attachment extends Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAttachment()protectedAttachment(String id, String fileName, String mimeType, InputStream inputStream, long lastModified)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringgetAttachmentType()StringgetFileName()Gets the file name.StringgetId()Gets the id.byte[]getImageBytes()longgetLastModified()Gets the last modified.StringgetMimeType()Gets the mime type.StringgetSize()Gets images size in MB/ KB/ Bytes.voidsetFileName(String s)Sets the file name.voidsetId(String s)Sets the id.voidsetInputStream(InputStream input)Read image bytes from input streamvoidsetLastModified(long lastModified)Sets the last modified.voidsetMimeType(String s)Sets the mime type.
-
-
-
Constructor Detail
-
Attachment
protected Attachment()
-
Attachment
protected Attachment(String id, String fileName, String mimeType, InputStream inputStream, long lastModified) throws IOException
- Throws:
IOException
-
-
Method Detail
-
getAttachmentType
public abstract String getAttachmentType()
-
getId
public String getId()
Gets the id.- Returns:
- the id
-
setId
public void setId(String s)
Sets the id.- Parameters:
s- the new id
-
getFileName
public String getFileName()
Gets the file name.- Returns:
- the file name
-
setFileName
public void setFileName(String s)
Sets the file name.- Parameters:
s- the new file name
-
getMimeType
public String getMimeType()
Gets the mime type.- Returns:
- the mime type
-
setMimeType
public void setMimeType(String s)
Sets the mime type.- Parameters:
s- the new mime type
-
getLastModified
public long getLastModified()
Gets the last modified.- Returns:
- the last modified
-
setLastModified
public void setLastModified(long lastModified)
Sets the last modified.- Parameters:
lastModified- the new last modified
-
getSize
public String getSize()
Gets images size in MB/ KB/ Bytes.- Returns:
- image size string
-
getImageBytes
public byte[] getImageBytes()
-
setInputStream
public void setInputStream(InputStream input) throws IOException
Read image bytes from input stream- Parameters:
input- the new input stream- Throws:
IOException- the exception
-
-