Class BatchParserCommon


  • public class BatchParserCommon
    extends Object
    • 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

      • trimLineListToLength

        public static String trimLineListToLength​(List<Line> list,
                                                  int length)
      • lineListToString

        public static String lineListToString​(List<Line> list)
      • 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 (see BatchHelper.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 value
        operation - which is written into the InputStream
        contentLength - 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
      • removeEndingCRLF

        public static Line removeEndingCRLF​(Line line)