com.atlassian.confluence.user.actions
Class TemporaryUploadedPicture

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

public class TemporaryUploadedPicture
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
TemporaryUploadedPicture(java.lang.String originalFileName, int sourceWidth, int sourceHeight, java.lang.String thumbnailFileName, int thumbnailWidth, int thumbnailHeight)
           
 
Method Summary
 void cleanup()
           
 java.io.File getOriginalFile()
           
 java.lang.String getOriginalFileName()
           
static TemporaryUploadedPicture getPicture(java.io.File sourceFile, java.lang.String fileName, java.lang.String owningUserName)
          Returns an object representing the original and thumbnail image
static TemporaryUploadedPicture getPicture(java.io.InputStream source, java.lang.String fileName, java.lang.String owningUserName)
          Returns an object representing the original and thumbnail image
 int getSourceHeight()
           
 int getSourceWidth()
           
 java.io.File getThumbnailFile()
           
 java.lang.String getThumbnailFileDownloadPath()
          Doesn't have url encoding, unlike getThumbnailFileDownloadUrl().
 java.lang.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(java.lang.String originalFileName,
                                int sourceWidth,
                                int sourceHeight,
                                java.lang.String thumbnailFileName,
                                int thumbnailWidth,
                                int thumbnailHeight)
Method Detail

getPicture

@Nullable
public static TemporaryUploadedPicture getPicture(java.io.File sourceFile,
                                                           java.lang.String fileName,
                                                           java.lang.String owningUserName)
                                           throws java.io.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:
com.atlassian.core.exception.FailedPredicateException - if there is insufficient memory to process the image
java.io.IOException - in case of I/O exception

getPicture

@Nullable
public static TemporaryUploadedPicture getPicture(java.io.InputStream source,
                                                           java.lang.String fileName,
                                                           java.lang.String owningUserName)
                                           throws java.io.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:
com.atlassian.core.exception.FailedPredicateException - if there is insufficient memory to process the image
java.io.IOException - in case of I/O exception

getOriginalFile

public java.io.File getOriginalFile()

getThumbnailFile

public java.io.File getThumbnailFile()

getThumbnailFileDownloadPath

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


getThumbnailFileDownloadUrl

public java.lang.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 java.lang.String getOriginalFileName()

cleanup

public void cleanup()


Copyright © 2003-2014 Atlassian. All Rights Reserved.