com.atlassian.confluence.user.actions
Class TemporaryUploadedPicture

java.lang.Object
  extended by com.atlassian.confluence.user.actions.TemporaryUploadedPicture
All Implemented Interfaces:
Serializable

public class TemporaryUploadedPicture
extends Object
implements Serializable

See Also:
Serialized Form

Constructor Summary
TemporaryUploadedPicture(String originalFileName, int sourceWidth, int sourceHeight, String thumbnailFileName, int thumbnailWidth, int thumbnailHeight)
           
 
Method Summary
 void cleanup()
           
 File getOriginalFile()
           
 String getOriginalFileName()
           
static TemporaryUploadedPicture getPicture(File sourceFile, String fileName, String owningUserName)
          Returns an object representing the original and thumbnail image
static TemporaryUploadedPicture getPicture(InputStream source, String fileName, String owningUserName)
          Returns an object representing the original and thumbnail image
 int getSourceHeight()
           
 int getSourceWidth()
           
 File getThumbnailFile()
           
 String getThumbnailFileDownloadPath()
          Doesn't have url encoding, unlike getThumbnailFileDownloadUrl().
 String getThumbnailFileDownloadUrl()
          Just like getThumbnailFileDownloadPath() but with the filename Url Encoded.
 int getThumbnailHeight()
           
 int getThumbnailWidth()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TemporaryUploadedPicture

public TemporaryUploadedPicture(String originalFileName,
                                int sourceWidth,
                                int sourceHeight,
                                String thumbnailFileName,
                                int thumbnailWidth,
                                int thumbnailHeight)
Method Detail

getPicture

@Nullable
public static TemporaryUploadedPicture getPicture(File sourceFile,
                                                           String fileName,
                                                           String owningUserName)
                                           throws IOException
Returns an object representing the original and thumbnail image

Parameters:
sourceFile - the image uploaded by the user
fileName - a name for this image. It has no effect in the computation.
owningUserName - login of the user who uploaded the file
Returns:
a picture or null if the image couldn't be transformed (unreadable or not-an-image)
Throws:
IOException - in case of I/O exception

getPicture

@Nullable
public static TemporaryUploadedPicture getPicture(InputStream source,
                                                           String fileName,
                                                           String owningUserName)
                                           throws IOException
Returns an object representing the original and thumbnail image

Parameters:
source - the image uploaded by the user
fileName - a name for this image. It has no effect in the computation.
owningUserName - login of the user who uploaded the file
Returns:
a picture or null if the image couldn't be transformed (unreadable or not-an-image)
Throws:
IOException - in case of I/O exception

getOriginalFile

public File getOriginalFile()

getThumbnailFile

public File getThumbnailFile()

getThumbnailFileDownloadPath

public String getThumbnailFileDownloadPath()
Doesn't have url encoding, unlike getThumbnailFileDownloadUrl().


getThumbnailFileDownloadUrl

public String getThumbnailFileDownloadUrl()
Just like getThumbnailFileDownloadPath() but with the filename Url Encoded.


getThumbnailWidth

public int getThumbnailWidth()

getThumbnailHeight

public int getThumbnailHeight()

getSourceWidth

public int getSourceWidth()

getSourceHeight

public int getSourceHeight()

getOriginalFileName

public String getOriginalFileName()

cleanup

public void cleanup()


Copyright © 2003-2013 Atlassian. All Rights Reserved.