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 java.lang.Object
- implements AttachmentResource
Represents an attachment resource that is supported by an input stream.
Constructor Summary |
InputStreamAttachmentResource(java.io.InputStream inputStream,
java.lang.String filename,
java.lang.String contentType,
long contentLength)
Constructor. |
InputStreamAttachmentResource(java.io.InputStream inputStream,
java.lang.String filename,
java.lang.String contentType,
long contentLength,
java.lang.String comment)
|
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 |
getURI, isReadable, lastModified |
InputStreamAttachmentResource
public InputStreamAttachmentResource(java.io.InputStream inputStream,
java.lang.String filename,
java.lang.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(java.io.InputStream inputStream,
java.lang.String filename,
java.lang.String contentType,
long contentLength,
java.lang.String comment)
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interface org.springframework.core.io.Resource
getFilename
public java.lang.String getFilename()
- Specified by:
getFilename
in interface org.springframework.core.io.Resource
getInputStream
public java.io.InputStream getInputStream()
- Specified by:
getInputStream
in interface org.springframework.core.io.InputStreamSource
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in interface AttachmentResource
- Returns:
- the content/mime type of the attachment
getContentLength
public long getContentLength()
- Specified by:
getContentLength
in interface AttachmentResource
- Returns:
- the content length (size of the attachment)
exists
public boolean exists()
- Specified by:
exists
in interface org.springframework.core.io.Resource
isOpen
public boolean isOpen()
- Specified by:
isOpen
in interface org.springframework.core.io.Resource
getComment
public java.lang.String getComment()
- Specified by:
getComment
in interface AttachmentResource
- Returns:
- the comment associated with the attachment or null if there is no comment
getURL
public java.net.URL getURL()
throws java.io.IOException
- Specified by:
getURL
in interface org.springframework.core.io.Resource
- Throws:
java.io.IOException
getFile
public java.io.File getFile()
throws java.io.IOException
- Specified by:
getFile
in interface org.springframework.core.io.Resource
- Throws:
java.io.IOException
createRelative
public org.springframework.core.io.Resource createRelative(java.lang.String relativePath)
throws java.io.IOException
- Specified by:
createRelative
in interface org.springframework.core.io.Resource
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2003-2010 Atlassian. All Rights Reserved.