Interface FileItem
-
- All Known Implementing Classes:
FormData.FileItemImpl
public interface FileItemRepresents an item of a multipart message for which thefilenameattribute has been specified
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddelete()If the part represents a file on the file system, delete it, otherwise do nothingPathgetFile()Gives access to the file stored on the file system.longgetFileSize()The size of the body - works regardless of the result ofisInMemoryInputStreamgetInputStream()The body represented as anInputStream- works regardless of the result ofisInMemorybooleanisInMemory()Determines whether the body is held in memoryvoidwrite(Path target)Copy the body to the specifiedPath- works regardless of the result ofisInMemory
-
-
-
Method Detail
-
isInMemory
boolean isInMemory()
Determines whether the body is held in memory
-
getFile
Path getFile()
Gives access to the file stored on the file system. This should only be used whenisInMemoryisfalse
-
getFileSize
long getFileSize() throws IOExceptionThe size of the body - works regardless of the result ofisInMemory- Throws:
IOException
-
getInputStream
InputStream getInputStream() throws IOException
The body represented as anInputStream- works regardless of the result ofisInMemory- Throws:
IOException
-
delete
void delete() throws IOExceptionIf the part represents a file on the file system, delete it, otherwise do nothing- Throws:
IOException
-
write
void write(Path target) throws IOException
Copy the body to the specifiedPath- works regardless of the result ofisInMemory- Throws:
IOException
-
-