Top Description Fields Constructors Methods
org.glassfish.grizzly.http.multipart

public Class MultipartEntry

extends Object
Class Inheritance
Imports
java.io.IOException, java.util.Map, .Set, .TreeMap, org.glassfish.grizzly.http.io.NIOInputStream, .NIOReader, org.glassfish.grizzly.http.server.Request, org.glassfish.grizzly.http.util.ContentType, .Header

Abstraction represents single multipart entry, its functionality is pretty similar to Request. In order to read multipart entry data it's possible to use either getNIOInputStream() or getNIOReader() depends on whether we want to operate with binary or String data.
Author
Alexey Stashok
Since
2.0.1

Field Summary

Modifier and TypeField and Description
private int
private ContentDisposition
private String
private static final String
private static final String
private final Map<String, String>
private final MultipartEntryNIOInputStream
private boolean
private boolean
isMultipart

Is this entry multipart/mixed

private boolean
isMultipartParsed

Have we parsed content-type and figured out whether it's multipart/mixed?

private boolean
private final MultipartContext
private final MultipartEntryNIOReader
private NIOInputStream
private int
protected boolean
usingInputStream

Using stream flag.

protected boolean
usingReader

Using writer flag.

Constructor Summary

AccessConstructor and Description
pack-priv
MultipartEntry(final MultipartContext multipartContext)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
addAvailableBytes(final int delta)

pack-priv int
public ContentDisposition

Returns:

the multipart entry content-disposition.
getContentDisposition
()

Get the multipart entry content-disposition.

public String

Returns:

the multipart entry content-type.
getContentType
()

Get the multipart entry content-type.

protected String
public String

Returns:

the multipart entry header value.
getHeader
(final String
multipart entry header name.
name
)

Get the multipart entry header value.

public String

Returns:

the multipart entry header value.
getHeader
(final Header
entry header.
header
)

Get the multipart entry header value.

public Set<String>

Returns:

the multipart entry header names.
getHeaderNames
()

Get the multipart entry header names.

public MultipartContext
getMultipartContext()

Get multipart processing context.

public NIOInputStream
public NIOReader
pack-priv int

Returns:

the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content
getReservedBytes
()

Get the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content

pack-priv void
initialize(final NIOInputStream parentInputStream)

pack-priv boolean
public boolean

Returns:

true if this is "multipart/*" multipart entry, or false otherwise.
isMultipart
()

Returns true if this is "multipart/*" multipart entry, or false otherwise.

pack-priv void
pack-priv void
pack-priv void
pack-priv void
setContentDisposition(final ContentDisposition contentDisposition)

pack-priv void
setContentType(final String contentType)

pack-priv void
setHeader(final String name, final String value)

pack-priv void
setHeader(final Header header, final String value)

pack-priv void
setReservedBytes(int
the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content
reservedBytes
)

Set the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content

public void
skip()

Skip the multipart entry processing.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

availableBytesback to summary
private int availableBytes
contentDispositionback to summary
private ContentDisposition contentDisposition
contentTypeback to summary
private String contentType
DEFAULT_CONTENT_ENCODINGback to summary
private static final String DEFAULT_CONTENT_ENCODING
DEFAULT_CONTENT_TYPEback to summary
private static final String DEFAULT_CONTENT_TYPE
headersback to summary
private final Map<String, String> headers
inputStreamback to summary
private final MultipartEntryNIOInputStream inputStream
isFinishedback to summary
private boolean isFinished
isMultipartback to summary
private boolean isMultipart

Is this entry multipart/mixed

isMultipartParsedback to summary
private boolean isMultipartParsed

Have we parsed content-type and figured out whether it's multipart/mixed?

isSkippingback to summary
private boolean isSkipping
multipartContextback to summary
private final MultipartContext multipartContext
readerback to summary
private final MultipartEntryNIOReader reader
requestInputStreamback to summary
private NIOInputStream requestInputStream
reservedBytesback to summary
private int reservedBytes
usingInputStreamback to summary
protected boolean usingInputStream

Using stream flag.

usingReaderback to summary
protected boolean usingReader

Using writer flag.

Constructor Detail

MultipartEntryback to summary
pack-priv MultipartEntry(final MultipartContext multipartContext)

Method Detail

addAvailableBytesback to summary
pack-priv void addAvailableBytes(final int delta)
availableBytesback to summary
pack-priv int availableBytes()
getContentDispositionback to summary
public ContentDisposition getContentDisposition()

Get the multipart entry content-disposition.

Returns:ContentDisposition

the multipart entry content-disposition.

getContentTypeback to summary
public String getContentType()

Get the multipart entry content-type.

Returns:String

the multipart entry content-type.

getEncodingback to summary
protected String getEncoding()
getHeaderback to summary
public String getHeader(final String name)

Get the multipart entry header value.

Parameters
name:String

multipart entry header name.

Returns:String

the multipart entry header value.

getHeaderback to summary
public String getHeader(final Header header)

Get the multipart entry header value.

Parameters
header:Header

entry header.

Returns:String

the multipart entry header value.

Since
2.1.2
getHeaderNamesback to summary
public Set<String> getHeaderNames()

Get the multipart entry header names.

Returns:Set<String>

the multipart entry header names.

getMultipartContextback to summary
public MultipartContext getMultipartContext()

Get multipart processing context.

Returns:MultipartContext

MultipartContext.

getNIOInputStreamback to summary
public NIOInputStream getNIOInputStream()
getNIOReaderback to summary
public NIOReader getNIOReader()
getReservedBytesback to summary
pack-priv int getReservedBytes()

Get the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content

Returns:int

the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content

initializeback to summary
pack-priv void initialize(final NIOInputStream parentInputStream)
isFinishedback to summary
pack-priv boolean isFinished()
isMultipartback to summary
public boolean isMultipart()

Returns true if this is "multipart/*" multipart entry, or false otherwise.

Returns:boolean

true if this is "multipart/*" multipart entry, or false otherwise.

onDataReceivedback to summary
pack-priv void onDataReceived() throws Exception
Annotations
@SuppressWarnings:ResultOfMethodCallIgnored
onFinishedback to summary
pack-priv void onFinished() throws Exception
resetback to summary
pack-priv void reset()
setContentDispositionback to summary
pack-priv void setContentDisposition(final ContentDisposition contentDisposition)
setContentTypeback to summary
pack-priv void setContentType(final String contentType)
setHeaderback to summary
pack-priv void setHeader(final String name, final String value)
setHeaderback to summary
pack-priv void setHeader(final Header header, final String value)
Since
2.1.2
setReservedBytesback to summary
pack-priv void setReservedBytes(int reservedBytes)

Set the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content

Parameters
reservedBytes:int

the previous (processed) line terminator bytes, which we're not sure about, whether they are part of section boundary or multipart entry content

skipback to summary
public void skip() throws IOException

Skip the multipart entry processing.

Annotations
@SuppressWarnings:ResultOfMethodCallIgnored