Package com.atlassian.confluence.core
Class InputStreamAttachmentResource
- java.lang.Object
-
- com.atlassian.confluence.core.InputStreamAttachmentResource
-
- All Implemented Interfaces:
AttachmentResource,org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class InputStreamAttachmentResource extends Object implements AttachmentResource
Represents an attachment resource that is supported by an input stream.
-
-
Constructor Summary
Constructors Constructor Description InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength)Constructor.InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment)InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment, boolean minorEdit)InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment, boolean minorEdit, boolean hidden)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longcontentLength()org.springframework.core.io.ResourcecreateRelative(String relativePath)booleanexists()StringgetComment()longgetContentLength()StringgetContentType()StringgetDescription()FilegetFile()StringgetFilename()InputStreamgetInputStream()URIgetURI()URLgetURL()booleanisHidden()booleanisMinorEdit()booleanisOpen()booleanisReadable()longlastModified()StringtoString()
-
-
-
Constructor Detail
-
InputStreamAttachmentResource
public InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength)
Constructor.- Parameters:
inputStream- attachment streamfilename- name of attachment including extensioncontentType- attachment content/mime typecontentLength- length or size of the attachment stream
-
InputStreamAttachmentResource
public InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment)
-
InputStreamAttachmentResource
public InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment, boolean minorEdit)
-
InputStreamAttachmentResource
public InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment, boolean minorEdit, boolean hidden)
-
-
Method Detail
-
getDescription
public String getDescription()
- Specified by:
getDescriptionin interfaceorg.springframework.core.io.Resource
-
getFilename
public String getFilename()
- Specified by:
getFilenamein interfaceorg.springframework.core.io.Resource
-
getInputStream
public InputStream getInputStream()
- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource
-
getContentType
public String getContentType()
- Specified by:
getContentTypein interfaceAttachmentResource- Returns:
- the content/mime type of the attachment
-
getContentLength
public long getContentLength()
- Specified by:
getContentLengthin interfaceAttachmentResource- Returns:
- the content length (size of the attachment)
-
contentLength
public long contentLength()
- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource
-
isMinorEdit
public boolean isMinorEdit()
- Specified by:
isMinorEditin interfaceAttachmentResource- Returns:
- true if the attachment is a minor edit (see
Attachment.isMinorEdit())
-
isHidden
public boolean isHidden()
- Specified by:
isHiddenin interfaceAttachmentResource- Returns:
- true if the attachment is hidden (see
Attachment.isHidden())
-
exists
public boolean exists()
- Specified by:
existsin interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()
- Specified by:
isOpenin interfaceorg.springframework.core.io.Resource
-
getComment
public String getComment()
- Specified by:
getCommentin interfaceAttachmentResource- Returns:
- the comment associated with the attachment or null if there is no comment
-
getURL
public URL getURL() throws IOException
- Specified by:
getURLin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
getFile
public File getFile() throws IOException
- Specified by:
getFilein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
createRelative
public org.springframework.core.io.Resource createRelative(String relativePath) throws IOException
- Specified by:
createRelativein interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceorg.springframework.core.io.Resource
-
getURI
public URI getURI() throws IOException
- Specified by:
getURIin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
lastModified
public long lastModified() throws IOException- Specified by:
lastModifiedin interfaceorg.springframework.core.io.Resource- Throws:
IOException
-
-