Class ContentDispositionParser
java.lang.Object
org.simpleframework.common.parse.Parser
org.simpleframework.http.parse.ContentDispositionParser
- All Implemented Interfaces:
ContentDisposition
The
ContentDispositionParser object is used to represent
a parser used to parse the Content-Disposition header. Its used when
there is a multipart form upload to the server and allows the
server to determine the individual part types.- Author:
- Niall Gallagher
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor for theContentDispositionParserobject.Constructor for theContentDispositionParserobject. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclear()This is used to clear all previously collected tokens.This method is used to acquire the file name of the part.getName()This method is used to acquire the name of the part.protected voidinit()This will initialize theParserwhen it is ready to parse a newString.booleanisFile()This method is used to determine the type of a part.protected voidparse()This is the method that should be implemented to read the buffer.
-
Constructor Details
-
ContentDispositionParser
public ContentDispositionParser()Constructor for theContentDispositionParserobject. This is used to create a parser that can parse a disposition header which is typically sent as part of a multipart upload. It can be used to determine the type of the upload. -
ContentDispositionParser
Constructor for theContentDispositionParserobject. This is used to create a parser that can parse a disposition header which is typically sent as part of a multipart upload. It can be used to determine the type of the upload.- Parameters:
text- this is the header value that is to be parsed
-
-
Method Details
-
getFileName
This method is used to acquire the file name of the part. This is used when the part represents a text parameter rather than a file. However, this can also be used with a file part.- Specified by:
getFileNamein interfaceContentDisposition- Returns:
- this returns the file name of the associated part
-
getName
This method is used to acquire the name of the part. Typically this is used when the part represents a text parameter rather than a file. However, this can also be used with a file part.- Specified by:
getNamein interfaceContentDisposition- Returns:
- this returns the name of the associated part
-
isFile
public boolean isFile()This method is used to determine the type of a part. Typically a part is either a text parameter or a file. If this is true then the content represented by the associated part is a file.- Specified by:
isFilein interfaceContentDisposition- Returns:
- this returns true if the associated part is a file
-
init
protected void init()This will initialize theParserwhen it is ready to parse a newString. This will reset the parser to a ready state. This method is invoked by the parser before the parse method is invoked, it is used to pack the contents of the header and clear any previous tokens used. -
clear
protected void clear()This is used to clear all previously collected tokens. This allows the parser to be reused when there are multiple source strings to be parsed. Clearing of the tokens is performed when the parser is initialized. -
parse
-