Class BatchParserCommon
- java.lang.Object
-
- org.apache.olingo.odata2.core.batch.v2.BatchParserCommon
-
public class BatchParserCommon extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static PatternPATTERN_CONTENT_TYPE_APPLICATION_HTTPprotected static PatternPATTERN_HEADER_LINEstatic PatternPATTERN_MULTIPART_MIXEDstatic PatternPATTERN_RELATIVE_URI
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidconsumeBlankLine(List<Line> remainingMessage, boolean isStrict)static HeaderconsumeHeaders(List<Line> remainingMessage)static InputStreamconvertToInputStream(String contentType, BatchQueryOperation operation, int contentLength)Convert body in form of List of Line items into a InputStream.static StringgetBoundary(String contentType, int line)static StringlineListToString(List<Line> list)static Map<String,List<String>>parseQueryParameter(Line httpRequest)static LineremoveEndingCRLF(Line line)static StringtrimLineListToLength(List<Line> list, int length)
-
-
-
Field Detail
-
PATTERN_HEADER_LINE
protected static final Pattern PATTERN_HEADER_LINE
-
PATTERN_MULTIPART_MIXED
public static final Pattern PATTERN_MULTIPART_MIXED
-
PATTERN_CONTENT_TYPE_APPLICATION_HTTP
public static final Pattern PATTERN_CONTENT_TYPE_APPLICATION_HTTP
-
PATTERN_RELATIVE_URI
public static final Pattern PATTERN_RELATIVE_URI
-
-
Method Detail
-
convertToInputStream
public static InputStream convertToInputStream(String contentType, BatchQueryOperation operation, int contentLength) throws BatchException
Convert body in form of List of Line items into a InputStream. The body is transformed with the charset set in ContentType and if no charset is set with Olingo default charset (seeBatchHelper.DEFAULT_CHARSET). If content length is a positive value the content is trimmed to according length. Otherwise the whole content is written into the InputStream.- Parameters:
contentType- content type valueoperation- which is written into the InputStreamcontentLength- if it is a positive value the content is trimmed to according length. Otherwise the whole content is written into the InputStream.- Returns:
- Content of BatchQueryOperation as InputStream in according charset and length
- Throws:
BatchException- if something goes wrong
-
consumeHeaders
public static Header consumeHeaders(List<Line> remainingMessage) throws BatchException
- Throws:
BatchException
-
consumeBlankLine
public static void consumeBlankLine(List<Line> remainingMessage, boolean isStrict) throws BatchException
- Throws:
BatchException
-
getBoundary
public static String getBoundary(String contentType, int line) throws BatchException
- Throws:
BatchException
-
-