|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.portal.service.blobstore.BlobStoreFileItem
public class BlobStoreFileItem
Builds a fileItem from blobstore implementing FileItem.
Metadata is stored in one blob, and content in another one.
get() method is lazy preventing blob to be stored in-memory.
Use #buildFileMetadata(String, long, String) to build the FileMetadata.
#buildFileMetadata(String, long, String),
BlobStoreFileItem(String, BlobStoreService),
Serialized Form| Field Summary | |
|---|---|
static java.lang.String |
JSON_KEY_FILE_BLOB_ID
|
static java.lang.String |
JSON_KEY_FILE_CONTENT_TYPE
|
static java.lang.String |
JSON_KEY_FILE_METADATA_BLOB_ID
|
static java.lang.String |
JSON_KEY_FILE_NAME
|
static java.lang.String |
JSON_KEY_FILE_SIZE
|
| Constructor Summary | |
|---|---|
BlobStoreFileItem(java.lang.String strBlobId,
BlobStoreService blobstoreService)
Builds a fileItem from blobstore. get() method is lazy. |
|
| Method Summary | |
|---|---|
static java.lang.String |
buildFileMetadata(java.lang.String strFileName,
long lSize,
java.lang.String strFileBlobId,
java.lang.String strContentType)
Builds the json value of a file metadata. |
void |
delete()
Deletes both blobs : metadata AND content. |
byte[] |
get()
|
java.lang.String |
getBlobId()
Gets the metadata blob id |
java.lang.String |
getContentType()
|
java.lang.String |
getFieldName()
Not supported |
java.lang.String |
getFileBlobId()
Gets the file blob id |
java.io.InputStream |
getInputStream()
|
java.lang.String |
getName()
|
java.io.OutputStream |
getOutputStream()
Not supported - throws UnsupportedOperationException exception |
long |
getSize()
|
java.lang.String |
getString()
|
java.lang.String |
getString(java.lang.String encoding)
|
boolean |
isFormField()
Not supported |
boolean |
isInMemory()
Always false. |
void |
setFieldName(java.lang.String name)
Not supported |
void |
setFormField(boolean state)
Not supported |
java.lang.String |
toString()
|
void |
write(java.io.File file)
Not supported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String JSON_KEY_FILE_SIZE
public static final java.lang.String JSON_KEY_FILE_NAME
public static final java.lang.String JSON_KEY_FILE_CONTENT_TYPE
public static final java.lang.String JSON_KEY_FILE_BLOB_ID
public static final java.lang.String JSON_KEY_FILE_METADATA_BLOB_ID
| Constructor Detail |
|---|
public BlobStoreFileItem(java.lang.String strBlobId,
BlobStoreService blobstoreService)
throws NoSuchBlobException
BlobStoreService is here to prevent specific usage for the fileItem so it can be used as any other FileItem.
strBlobId - the blob idblobstoreService - the blob service
NoSuchBlobException - if blob cannot be parsed| Method Detail |
|---|
public java.lang.String getBlobId()
public java.lang.String getFileBlobId()
public void delete()
delete in interface org.apache.commons.fileupload.FileItempublic byte[] get()
get in interface org.apache.commons.fileupload.FileItempublic java.lang.String getContentType()
getContentType in interface org.apache.commons.fileupload.FileItempublic java.lang.String getFieldName()
getFieldName in interface org.apache.commons.fileupload.FileItem
public java.io.InputStream getInputStream()
throws java.io.IOException
getInputStream in interface org.apache.commons.fileupload.FileItemjava.io.IOException - ioexceptionpublic java.lang.String getName()
getName in interface org.apache.commons.fileupload.FileItem
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface org.apache.commons.fileupload.FileItemjava.io.IOException - ioepublic long getSize()
getSize in interface org.apache.commons.fileupload.FileItempublic java.lang.String getString()
getString in interface org.apache.commons.fileupload.FileItem
public java.lang.String getString(java.lang.String encoding)
throws java.io.UnsupportedEncodingException
getString in interface org.apache.commons.fileupload.FileItemjava.io.UnsupportedEncodingExceptionpublic boolean isFormField()
isFormField in interface org.apache.commons.fileupload.FileItempublic boolean isInMemory()
isInMemory in interface org.apache.commons.fileupload.FileItempublic void setFieldName(java.lang.String name)
setFieldName in interface org.apache.commons.fileupload.FileItemname - -public void setFormField(boolean state)
setFormField in interface org.apache.commons.fileupload.FileItemstate - -
public void write(java.io.File file)
throws java.lang.Exception
write in interface org.apache.commons.fileupload.FileItemfile - -
java.lang.Exception - expublic java.lang.String toString()
toString in class java.lang.Object
public static final java.lang.String buildFileMetadata(java.lang.String strFileName,
long lSize,
java.lang.String strFileBlobId,
java.lang.String strContentType)
strFileName - filenamelSize - sizestrFileBlobId - the blob idstrContentType - the content type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||