com.atlassian.confluence.core
Class UploadedResource

java.lang.Object
  extended by com.atlassian.confluence.core.UploadedResource
All Implemented Interfaces:
AttachmentResource, org.springframework.core.io.InputStreamSource, org.springframework.core.io.Resource
Direct Known Subclasses:
UploadedResource

public class UploadedResource
extends java.lang.Object
implements AttachmentResource

Resource wrapper for uploaded files. This will become extra handy once we get a better multipart file handling e.g. Attachments handled entirely in memory


Constructor Summary
UploadedResource(java.io.File file, java.lang.String filename, java.lang.String contentType, java.lang.String comment)
           
UploadedResource(com.atlassian.xwork.FileUploadUtils.UploadedFile uploadedFile)
           
UploadedResource(com.atlassian.xwork.FileUploadUtils.UploadedFile uploadedFile, java.lang.String comment)
           
 
Method Summary
 org.springframework.core.io.Resource createRelative(java.lang.String relativePath)
           
 boolean exists()
           
 java.lang.String getComment()
           
 long getContentLength()
           
 java.lang.String getContentType()
           
 java.lang.String getDescription()
           
 java.io.File getFile()
           
 java.lang.String getFilename()
           
 java.io.InputStream getInputStream()
           
 java.net.URL getURL()
           
 boolean isOpen()
           
 java.lang.String toString()
           
 
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
 

Constructor Detail

UploadedResource

public UploadedResource(com.atlassian.xwork.FileUploadUtils.UploadedFile uploadedFile)

UploadedResource

public UploadedResource(com.atlassian.xwork.FileUploadUtils.UploadedFile uploadedFile,
                        java.lang.String comment)

UploadedResource

public UploadedResource(java.io.File file,
                        java.lang.String filename,
                        java.lang.String contentType,
                        java.lang.String comment)
Method Detail

getDescription

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

getFile

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

getFilename

public java.lang.String getFilename()
                             throws java.lang.IllegalStateException
Specified by:
getFilename in interface org.springframework.core.io.Resource
Throws:
java.lang.IllegalStateException

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

getInputStream

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

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

getURL

public java.net.URL getURL()
                    throws java.io.IOException
Specified by:
getURL 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.