Package org.apache.abdera.parser

Examples of org.apache.abdera.parser.ParseException


    ParserOptions options)
      throws ParseException {
    try {
      return parser.parse(getInputStream(), getUri(), options);
    } catch (Exception e) {
      throw new ParseException(e);
    }
  }
View Full Code Here


      try {
        return parser.parse(
          getInputStream(),
          null, options);
      } catch (IRISyntaxException e) {
        throw new ParseException(e); // won't never happen
      }
    }
    return document;
  }
View Full Code Here

        document.setBaseUri(base.toString());
      if (options != null && options.getCharset() != null)
        ((OMDocument)document).setCharsetEncoding(options.getCharset());
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
    return document;
  }
View Full Code Here

        StAXUtils.createXMLStreamReader(in) :
        StAXUtils.createXMLStreamReader(in, charset);
      return parse(xmlreader, base, options);
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
  }
View Full Code Here

    try {
      if (options == null) options = getDefaultParserOptions();
      return parse(StAXUtils.createXMLStreamReader(in), base, options);
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
  }
View Full Code Here

          reader,
          options);
      return getDocument(builder, base != null ? new IRI(base) : null, options);
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
  }
View Full Code Here

    boundary = "--" + boundary;

    String type = request.getContentType().getParameter(TYPE_PARAM);
    if (!(type != null && MimeTypeHelper.isAtom(type))) {
      throw new ParseException("multipart/related stream invalid, type parameter should be "
              + Constants.ATOM_MEDIA_TYPE);
    }

    PushbackInputStream pushBackInput = new PushbackInputStream(request.getInputStream(), 2);
    pushBackInput.unread("\r\n".getBytes());
View Full Code Here

  }
 
  private void checkMultipartContent(Document<Entry> entry, Map<String, String> dataHeaders,
      RequestContext request) throws ParseException {
    if (entry == null) {
      throw new ParseException("multipart/related stream invalid, media link entry is missing");
    }
    if (!dataHeaders.containsKey(CONTENT_TYPE_HEADER)) {
      throw new ParseException("multipart/related stream invalid, data content-type is missing");       
    }
    if (!isContentTypeAccepted(dataHeaders.get(CONTENT_TYPE_HEADER), request)) {
      throw new ParseException("multipart/related stream invalid, content-type "
          + dataHeaders.get(CONTENT_TYPE_HEADER) + " not accepted into this multipart file");
    }
  }
View Full Code Here

      FOMBuilder builder = new FOMBuilder(factory, xmlreader, options);
      document = getDocument(builder, (base != null) ? new IRI(base) : null);
      setCharset(options, xmlreader.getCharacterEncodingScheme(), document);
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
    return document;
  }
View Full Code Here

      FOMBuilder builder = new FOMBuilder(factory, xmlreader, options);
      document = getDocument(builder, base != null ? new IRI(base) : null);
      setCharset(options, xmlreader.getCharacterEncodingScheme(), document);
    } catch (Exception e) {
      if (!(e instanceof ParseException))
        e = new ParseException(e);
      throw (ParseException)e;
    }
    return document;
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.parser.ParseException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.