models
Class CacheFileInfo

java.lang.Object
  extended by models.CacheFile
      extended by models.CacheFileInfo

public class CacheFileInfo
extends CacheFile

model for cache files on the server

See Also:
CacheFile

Constructor Summary
CacheFileInfo(byte[] file, java.lang.String fileName, java.lang.String contentType, boolean image)
          constructor of class
 
Method Summary
 void appendFile(byte[] file)
          append file data
 java.lang.String etag()
           
static java.util.List<java.lang.String> fromBody(play.mvc.Http.MultipartFormData body)
          ready files from body
static java.util.List<java.lang.String> fromBody(play.mvc.Http.MultipartFormData body, boolean isImages)
          ready files from body
 java.lang.String getContentType()
           
 byte[] getFile()
           
 java.lang.String getFileName()
           
static CacheFileInfo getFromCache(java.lang.String uuid)
          get file from cache
 boolean isImage()
           
 void setContentType(java.lang.String contentType)
          set content type
 void setFile(byte[] file)
          set file data
 void setFileName(java.lang.String fileName)
          set file name
 void setImage(boolean image)
          set is file image
 
Methods inherited from class models.CacheFile
getContentType, getImageFormatName, md5, removeFromCache
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheFileInfo

public CacheFileInfo(byte[] file,
                     java.lang.String fileName,
                     java.lang.String contentType,
                     boolean image)
constructor of class

Parameters:
file - byte array of file
fileName - file name string
contentType - content type of file
image - is file an image
Method Detail

getFile

public byte[] getFile()
Returns:
byte array of file data

etag

public java.lang.String etag()
Returns:
etag: md5 hash string of file byte array

setFile

public void setFile(byte[] file)
set file data

Parameters:
file - byte array

appendFile

public void appendFile(byte[] file)
append file data


getFileName

public java.lang.String getFileName()
Returns:
file name

setFileName

public void setFileName(java.lang.String fileName)
set file name

Parameters:
fileName - name string

getContentType

public java.lang.String getContentType()
Returns:
content type of file

setContentType

public void setContentType(java.lang.String contentType)
set content type

Parameters:
contentType - content type string

isImage

public boolean isImage()
Returns:
if file is image return true otherwise false

setImage

public void setImage(boolean image)
set is file image

Parameters:
image - boolean value

getFromCache

public static CacheFileInfo getFromCache(java.lang.String uuid)
get file from cache

Returns:
CacheFileInfo object

fromBody

public static java.util.List<java.lang.String> fromBody(play.mvc.Http.MultipartFormData body)
                                                 throws java.io.IOException
ready files from body

Parameters:
body - body object
Returns:
list of keys with which objects are located in the cache
Throws:
java.io.IOException

fromBody

public static java.util.List<java.lang.String> fromBody(play.mvc.Http.MultipartFormData body,
                                                        boolean isImages)
                                                 throws java.io.IOException
ready files from body

Parameters:
body - body object
isImages - is file an image
Returns:
list of keys which objects are in the cache
Throws:
java.io.IOException