|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gentics.api.lib.resolving.ResolvableBean
com.gentics.api.lib.upload.FileInformation
public class FileInformation
Provides information about an uploaded file.
Constructor Summary | |
---|---|
|
FileInformation(File file)
Create an instance of fileinformation based on the given file. |
|
FileInformation(org.apache.commons.fileupload.FileItem myFileItem,
FileUploadProvider fileUploadProvider)
Create a FileInformation object base of the given FileItem |
|
FileInformation(String fileName,
long fileSize,
String contentType,
byte[] fileData)
Create a FileInformation object with preset data |
protected |
FileInformation(String fileName,
long fileSize,
String contentType,
byte[] fileData,
File file,
boolean deleteFileOnInvalidate)
Create an instance of fileinformation |
Method Summary | |
---|---|
FileInformation |
cloneFileInformation()
Can be used to retrieve a clone of a file item if it is needed longer than one request long. |
protected void |
finalize()
Called by the GC - invalidates this instance to delete tmp files. |
String |
getContentType()
Returns the delivered ContentType of the File |
String |
getFileName()
Returns the relative Path of the File. |
String |
getFilePath()
Returns the upload Path if available or null if not. |
long |
getFileSize()
Get the file size in bytes. |
InputStream |
getInputStream()
Get an input stream for reading the content of an uploaded file |
String |
getOriginalFileName()
Returns the "original" filename which was passed by the browser. |
void |
invalidate()
Invalidates this instance of FileInformation. |
Methods inherited from class com.gentics.api.lib.resolving.ResolvableBean |
---|
canResolve, get, getProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FileInformation(String fileName, long fileSize, String contentType, byte[] fileData)
fileName
- name of the filefileSize
- size of the filecontentType
- content typefileData
- file data as byte arraypublic FileInformation(org.apache.commons.fileupload.FileItem myFileItem, FileUploadProvider fileUploadProvider)
myFileItem
- file itemprotected FileInformation(String fileName, long fileSize, String contentType, byte[] fileData, File file, boolean deleteFileOnInvalidate)
fileName
- filenamefileSize
- filesizecontentType
- contenttypefileData
- filedatafile
- filedeleteFileOnInvalidate
- true when the file will be deleted, false if notpublic FileInformation(File file)
invalidate()
.
file
- fileMethod Detail |
---|
protected void finalize()
finalize
in class Object
public final long getFileSize()
public final String getContentType()
public final String getOriginalFileName()
public final String getFileName()
public final String getFilePath()
public final InputStream getInputStream() throws IOException
IOException
public FileInformation cloneFileInformation() throws IOException
IOException
public void invalidate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |