Class HttpContent
- java.lang.Object
-
- de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.HttpContent
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.fraunhofer.iosb.ilt.frostserver.plugin.batchprocessing.multipart.Content
Content.IsFinished
-
-
Constructor Summary
Constructors Constructor Description HttpContent()HttpContent(boolean requireContentId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddData(String data)StringgetContent(boolean allHeaders)Get the String content.StringgetContentId()StringgetContentIdValue()StringgetData()Get the data in the http request.List<String>getErrors()Get the list of error messages generating during parsing.Map<String,String>getHeaders()Get the headers.Map<String,String>getHttpHeaders()Get the headers of the http request.HttpMethodgetMethod()StringgetPath()Get the path part of the http request.StringgetStatusLine()StringgetVersion()booleanisExecuteFailed()Content.IsFinishedisFinished()Gives the parse-state of the Content.booleanisParseFailed()Flag indicating there were errors parsing the content.voidparseLine(String line)Add the line to the content.voidsetContentId(String contentId)voidsetContentIdValue(String contentIdValue)voidsetExecuteFailed(boolean executeFailed)voidsetLogIndent(String logIndent)Sets the indentation of log messages.voidsetStatusLine(String statusLine)voidstripLastNewline()Informs the Content that the last newline should be removed again.voidupdateUsingContentIds(List<ContentIdPair> contentIds)
-
-
-
Method Detail
-
parseLine
public void parseLine(String line)
Description copied from interface:ContentAdd the line to the content.
-
isParseFailed
public boolean isParseFailed()
Description copied from interface:ContentFlag indicating there were errors parsing the content.- Specified by:
isParseFailedin interfaceContent- Returns:
- true if there were parse errors.
-
isExecuteFailed
public boolean isExecuteFailed()
-
setExecuteFailed
public void setExecuteFailed(boolean executeFailed)
-
getErrors
public List<String> getErrors()
Description copied from interface:ContentGet the list of error messages generating during parsing.
-
getPath
public String getPath()
Get the path part of the http request.- Returns:
- the URL part of the http request.
-
getData
public String getData()
Get the data in the http request. This does not include the outer headers, command, nor inner headers.- Returns:
- The data in http request.
-
addData
public void addData(String data)
-
getContentId
public String getContentId()
-
setContentId
public void setContentId(String contentId)
-
getContentIdValue
public String getContentIdValue()
-
setContentIdValue
public void setContentIdValue(String contentIdValue)
-
updateUsingContentIds
public void updateUsingContentIds(List<ContentIdPair> contentIds)
-
getMethod
public HttpMethod getMethod()
-
getStatusLine
public String getStatusLine()
-
setStatusLine
public void setStatusLine(String statusLine)
-
getHttpHeaders
public Map<String,String> getHttpHeaders()
Get the headers of the http request. These are not the same as the multipart-headers.- Returns:
- the headers of the http request.
-
getContent
public String getContent(boolean allHeaders)
Description copied from interface:ContentGet the String content.- Specified by:
getContentin interfaceContent- Parameters:
allHeaders- flag indicating all headers should be included. If the content is going to be added to a HttpServletResponse, the headers need to be set separately.- Returns:
- The content.
-
getHeaders
public Map<String,String> getHeaders()
Description copied from interface:ContentGet the headers. This will include the Content-Type header.- Specified by:
getHeadersin interfaceContent- Returns:
- the headers.
-
stripLastNewline
public void stripLastNewline()
Description copied from interface:ContentInforms the Content that the last newline should be removed again. The newline before a boundary is part of the boundary, not of the content.- Specified by:
stripLastNewlinein interfaceContent
-
isFinished
public Content.IsFinished isFinished()
Description copied from interface:ContentGives the parse-state of the Content. This indicates if more content is expected or not.- Specified by:
isFinishedin interfaceContent- Returns:
- the parse-state of the Content.
-
getVersion
public String getVersion()
-
setLogIndent
public void setLogIndent(String logIndent)
Description copied from interface:ContentSets the indentation of log messages. Since Content can be nested, this makes debug output better readable.- Specified by:
setLogIndentin interfaceContent- Parameters:
logIndent- the indentation of log messages.
-
-