Class UploadedFileItem
- java.lang.Object
-
- org.apache.tapestry5.upload.internal.services.UploadedFileItem
-
- All Implemented Interfaces:
UploadedFile
public class UploadedFileItem extends java.lang.Object implements UploadedFile
Implentation ofUploadedFile
for FileItems.
-
-
Constructor Summary
Constructors Constructor Description UploadedFileItem(org.apache.commons.fileupload.FileItem item)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanup()
java.lang.String
getContentType()
java.lang.String
getFileName()
java.lang.String
getFilePath()
long
getSize()
java.io.InputStream
getStream()
boolean
isInMemory()
void
write(java.io.File file)
Writes the content of the file to a known location.
-
-
-
Constructor Detail
-
UploadedFileItem
public UploadedFileItem(org.apache.commons.fileupload.FileItem item)
-
-
Method Detail
-
getContentType
public java.lang.String getContentType()
- Specified by:
getContentType
in interfaceUploadedFile
- Returns:
- the MIME type specified when the file was uploaded.
-
getFileName
public java.lang.String getFileName()
- Specified by:
getFileName
in interfaceUploadedFile
- Returns:
- the name of the file that was uploaded.
-
getFilePath
public java.lang.String getFilePath()
- Specified by:
getFilePath
in interfaceUploadedFile
- Returns:
- the complete path, as reported by the client browser.
-
getSize
public long getSize()
- Specified by:
getSize
in interfaceUploadedFile
- Returns:
- the size, in bytes, of the uploaded content.
-
getStream
public java.io.InputStream getStream()
- Specified by:
getStream
in interfaceUploadedFile
- Returns:
- an input stream of the content of the file.
-
isInMemory
public boolean isInMemory()
- Specified by:
isInMemory
in interfaceUploadedFile
- Returns:
- true if the uploaded content is in memory.
-
write
public void write(java.io.File file)
Description copied from interface:UploadedFile
Writes the content of the file to a known location.- Specified by:
write
in interfaceUploadedFile
- Parameters:
file
- Location to write file to
-
cleanup
public void cleanup()
-
-