com.atlassian.confluence.core
Class InputStreamAttachmentResource

java.lang.Object
  extended by 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
InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength)
          Constructor.
InputStreamAttachmentResource(InputStream inputStream, String filename, String contentType, long contentLength, String comment)
           
 
Method Summary
 org.springframework.core.io.Resource createRelative(String relativePath)
           
 boolean exists()
           
 String getComment()
           
 long getContentLength()
           
 String getContentType()
           
 String getDescription()
           
 File getFile()
           
 String getFilename()
           
 InputStream getInputStream()
           
 URI getURI()
           
 URL getURL()
           
 boolean isOpen()
           
 boolean isReadable()
           
 long lastModified()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InputStreamAttachmentResource

public InputStreamAttachmentResource(InputStream inputStream,
                                     String filename,
                                     String contentType,
                                     long contentLength)
Constructor.

Parameters:
inputStream - attachment stream
filename - name of attachment including extension
contentType - attachment content/mime type
contentLength - length or size of the attachment stream

InputStreamAttachmentResource

public InputStreamAttachmentResource(InputStream inputStream,
                                     String filename,
                                     String contentType,
                                     long contentLength,
                                     String comment)
Method Detail

getDescription

public String getDescription()
Specified by:
getDescription in interface org.springframework.core.io.Resource

getFilename

public String getFilename()
Specified by:
getFilename in interface org.springframework.core.io.Resource

getInputStream

public InputStream getInputStream()
Specified by:
getInputStream in interface org.springframework.core.io.InputStreamSource

getContentType

public 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 String getComment()
Specified by:
getComment in interface AttachmentResource
Returns:
the comment associated with the attachment or null if there is no comment

getURL

public URL getURL()
           throws IOException
Specified by:
getURL in interface org.springframework.core.io.Resource
Throws:
IOException

getFile

public File getFile()
             throws IOException
Specified by:
getFile in interface org.springframework.core.io.Resource
Throws:
IOException

createRelative

public org.springframework.core.io.Resource createRelative(String relativePath)
                                                    throws IOException
Specified by:
createRelative in interface org.springframework.core.io.Resource
Throws:
IOException

isReadable

public boolean isReadable()
Specified by:
isReadable in interface org.springframework.core.io.Resource

getURI

public URI getURI()
           throws IOException
Specified by:
getURI in interface org.springframework.core.io.Resource
Throws:
IOException

lastModified

public long lastModified()
                  throws IOException
Specified by:
lastModified in interface org.springframework.core.io.Resource
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2003-2012 Atlassian. All Rights Reserved.