Interface UploadedFile
-
public interface UploadedFileThis class represents an uploaded file.- Version:
- $Id: UploadedFile.java#1 $
- Author:
- Harald Kuhr
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetContentType()Returns the content type of the file.java.io.InputStreamgetInputStream()Returns the file data, as anInputStream.java.lang.StringgetName()Returns the original file name (from client).longlength()Returns the length of file, in bytes.voidwriteTo(java.io.File pFile)Writes the file data to the givenFile.
-
-
-
Method Detail
-
length
long length()
Returns the length of file, in bytes.- Returns:
- length of file
-
getName
java.lang.String getName()
Returns the original file name (from client).- Returns:
- original name
-
getContentType
java.lang.String getContentType()
Returns the content type of the file.- Returns:
- the content type
-
getInputStream
java.io.InputStream getInputStream() throws java.io.IOExceptionReturns the file data, as anInputStream. The file data may be read from disk, or from an in-memory source, depending on implementation.- Returns:
- an
InputStreamcontaining the file data - Throws:
java.io.IOExceptionjava.lang.RuntimeException
-
writeTo
void writeTo(java.io.File pFile) throws java.io.IOExceptionWrites the file data to the givenFile. Note that implementations are free to optimize this to a rename operation, if the file is allready cached to disk.- Parameters:
pFile- theFile(file name) to write to.- Throws:
java.io.IOExceptionjava.lang.RuntimeException
-
-