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
Represents an attachment resource that is supported by an input stream.
-
Constructor Summary
ConstructorsConstructorDescriptionInputStreamAttachmentResource
(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
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.Resource
isFile, readableChannel
-
Constructor Details
-
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 Details
-
getDescription
- Specified by:
getDescription
in interfaceorg.springframework.core.io.Resource
-
getFilename
- Specified by:
getFilename
in interfaceorg.springframework.core.io.Resource
-
getInputStream
- Specified by:
getInputStream
in interfaceorg.springframework.core.io.InputStreamSource
-
getContentType
- Specified by:
getContentType
in interfaceAttachmentResource
- Returns:
- the content/mime type of the attachment
-
getContentLength
public long getContentLength()- Specified by:
getContentLength
in interfaceAttachmentResource
- Returns:
- the content length (size of the attachment)
-
contentLength
public long contentLength()- Specified by:
contentLength
in interfaceorg.springframework.core.io.Resource
-
isMinorEdit
public boolean isMinorEdit()- Specified by:
isMinorEdit
in interfaceAttachmentResource
- Returns:
- true if the attachment is a minor edit (see
Attachment.isMinorEdit()
)
-
isHidden
public boolean isHidden()- Specified by:
isHidden
in interfaceAttachmentResource
- Returns:
- true if the attachment is hidden (see
Attachment.isHidden()
)
-
exists
public boolean exists()- Specified by:
exists
in interfaceorg.springframework.core.io.Resource
-
isOpen
public boolean isOpen()- Specified by:
isOpen
in interfaceorg.springframework.core.io.Resource
-
getComment
- Specified by:
getComment
in interfaceAttachmentResource
- Returns:
- the comment associated with the attachment or null if there is no comment
-
getURL
- Specified by:
getURL
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
getFile
- Specified by:
getFile
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
createRelative
- Specified by:
createRelative
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
isReadable
public boolean isReadable()- Specified by:
isReadable
in interfaceorg.springframework.core.io.Resource
-
getURI
- Specified by:
getURI
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
lastModified
- Specified by:
lastModified
in interfaceorg.springframework.core.io.Resource
- Throws:
IOException
-
toString
-