@NotThreadSafe public class FileItemStream extends Object implements IFileItemStream, Closeable
IFileItemStream.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file item.
|
String |
getContentType()
Returns the items content type, or null.
|
String |
getFieldName()
Returns the items field name.
|
IFileItemHeaders |
getHeaders()
Returns the collection of headers defined locally within this item.
|
String |
getName()
Returns the original filename in the client's filesystem, as provided by
the browser (or other client software).
|
String |
getNameSecure()
Returns the original filename in the client's filesystem, as provided by
the browser (or other client software).
|
String |
getNameUnchecked()
Returns the original filename in the client's filesystem, as provided by
the browser (or other client software).
|
boolean |
isFormField()
Returns, whether this is a form field.
|
InputStream |
openStream()
Returns an input stream, which may be used to read the items contents.
|
void |
setHeaders(IFileItemHeaders aHeaders)
Sets the headers read from within an item.
|
public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - An I/O error occurred.@Nullable public String getContentType()
getContentType in interface IFileItemStreampublic String getFieldName()
getFieldName in interface IFileItemStream@Nullable public String getName()
IFileItemStreamgetName in interface IFileItemStream@Nullable public String getNameSecure()
IFileItemStreamIFileItemStream.getName() this method automatically removes everything and
including a NUL byte and therefore does not throw an
InvalidFileNameException.getNameSecure in interface IFileItemStream@Nullable public String getNameUnchecked()
IFileItemStreamgetNameUnchecked in interface IFileItemStreampublic boolean isFormField()
isFormField in interface IFileItemStream@Nonnull public InputStream openStream() throws IOException
openStream in interface IFileItemStreamIOException - An I/O error occurred.@Nullable public IFileItemHeaders getHeaders()
IFileItemHeadersSupportgetHeaders in interface IFileItemHeadersSupportIFileItemHeaders present for this item.public void setHeaders(@Nullable IFileItemHeaders aHeaders)
IFileItemHeadersSupportIFileItem or IFileItemStream should implement this
interface to be able to get the raw headers found within the item header
block.setHeaders in interface IFileItemHeadersSupportaHeaders - the instance that holds onto the headers for this instance.Copyright © 2014–2019 Philip Helger. All rights reserved.