|
||||||||||
| 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 String |
JSON_KEY_FILE_BLOB_ID
|
static String |
JSON_KEY_FILE_CONTENT_TYPE
|
static String |
JSON_KEY_FILE_METADATA_BLOB_ID
|
static String |
JSON_KEY_FILE_NAME
|
static String |
JSON_KEY_FILE_SIZE
|
| Constructor Summary | |
|---|---|
BlobStoreFileItem(String strBlobId,
BlobStoreService blobstoreService)
Builds a fileItem from blobstore. get() method is lazy. |
|
| Method Summary | |
|---|---|
static String |
buildFileMetadata(String strFileName,
long lSize,
String strFileBlobId,
String strContentType)
Builds the json value of a file metadata. |
void |
delete()
Deletes both blobs : metadata AND content. |
byte[] |
get()
|
String |
getBlobId()
Gets the metadata blob id |
String |
getContentType()
|
String |
getFieldName()
Not supported |
String |
getFileBlobId()
Gets the file blob id |
InputStream |
getInputStream()
|
String |
getName()
|
OutputStream |
getOutputStream()
Not supported - throws UnsupportedOperationException exception |
long |
getSize()
|
String |
getString()
|
String |
getString(String encoding)
|
boolean |
isFormField()
Not supported |
boolean |
isInMemory()
Always false. |
void |
setFieldName(String name)
Not supported |
void |
setFormField(boolean state)
Not supported |
String |
toString()
|
void |
write(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 String JSON_KEY_FILE_SIZE
public static final String JSON_KEY_FILE_NAME
public static final String JSON_KEY_FILE_CONTENT_TYPE
public static final String JSON_KEY_FILE_BLOB_ID
public static final String JSON_KEY_FILE_METADATA_BLOB_ID
| Constructor Detail |
|---|
public BlobStoreFileItem(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 String getBlobId()
public String getFileBlobId()
public void delete()
delete in interface org.apache.commons.fileupload.FileItempublic byte[] get()
get in interface org.apache.commons.fileupload.FileItempublic String getContentType()
getContentType in interface org.apache.commons.fileupload.FileItempublic String getFieldName()
getFieldName in interface org.apache.commons.fileupload.FileItem
public InputStream getInputStream()
throws IOException
getInputStream in interface org.apache.commons.fileupload.FileItemIOException - ioexceptionpublic String getName()
getName in interface org.apache.commons.fileupload.FileItem
public OutputStream getOutputStream()
throws IOException
getOutputStream in interface org.apache.commons.fileupload.FileItemIOException - ioepublic long getSize()
getSize in interface org.apache.commons.fileupload.FileItempublic String getString()
getString in interface org.apache.commons.fileupload.FileItem
public String getString(String encoding)
throws UnsupportedEncodingException
getString in interface org.apache.commons.fileupload.FileItemUnsupportedEncodingExceptionpublic boolean isFormField()
isFormField in interface org.apache.commons.fileupload.FileItempublic boolean isInMemory()
isInMemory in interface org.apache.commons.fileupload.FileItempublic void setFieldName(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(File file)
throws Exception
write in interface org.apache.commons.fileupload.FileItemfile - -
Exception - expublic String toString()
toString in class Object
public static final String buildFileMetadata(String strFileName,
long lSize,
String strFileBlobId,
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 | |||||||||