Package org.openrdf.http.protocol.exceptions

Examples of org.openrdf.http.protocol.exceptions.NoCompatibleMediaType


    }
    else if (Model.class.isAssignableFrom(type)) {
      acceptRDF(false);
    }
    else {
      throw new NoCompatibleMediaType("No parsers are available for " + type);
    }
  }
View Full Code Here


      return;
    }
    // Specify which formats we support using Accept headers
    Set<BooleanQueryResultFormat> booleanFormats = BooleanQueryResultParserRegistry.getInstance().getKeys();
    if (booleanFormats.isEmpty()) {
      throw new NoCompatibleMediaType("No boolean query result parsers have been registered");
    }

    for (BooleanQueryResultFormat format : booleanFormats) {
      // Determine a q-value that reflects the user specified preference
      int qValue = 10;
View Full Code Here

      return;
    }
    // Specify which formats we support using Accept headers
    Set<TupleQueryResultFormat> tqrFormats = TupleQueryResultParserRegistry.getInstance().getKeys();
    if (tqrFormats.isEmpty()) {
      throw new NoCompatibleMediaType("No tuple query result parsers have been registered");
    }

    for (TupleQueryResultFormat format : tqrFormats) {
      // Determine a q-value that reflects the user specified preference
      int qValue = 10;
View Full Code Here

    throws NoCompatibleMediaType
  {
    // Specify which formats we support using Accept headers
    Set<RDFFormat> rdfFormats = RDFParserRegistry.getInstance().getKeys();
    if (rdfFormats.isEmpty()) {
      throw new NoCompatibleMediaType("No tuple RDF parsers have been registered");
    }

    for (RDFFormat format : rdfFormats) {
      // Determine a q-value that reflects the necessity of context
      // support and the user specified preference
View Full Code Here

    }
    else if (Model.class.isAssignableFrom(type)) {
      return type.cast(readModel());
    }
    else {
      throw new NoCompatibleMediaType("Cannot read " + type);
    }
  }
View Full Code Here

      result = QueryResultIO.parse(getResponseBodyAsStream(), format);
      return result;
    }
    catch (UnsupportedQueryResultFormatException e) {
      logger.warn(e.toString(), e);
      throw new NoCompatibleMediaType("Server responded with an unsupported file format: " + mimeType);
    }
    finally {
      if (result == null) {
        abort();
      }
View Full Code Here

      pool.executeTask(result);
      return result;
    }
    catch (UnsupportedQueryResultFormatException e) {
      logger.warn(e.toString(), e);
      throw new NoCompatibleMediaType("Server responded with an unsupported file format: " + mimeType);
    }
    finally {
      if (result == null) {
        abort();
      }
View Full Code Here

          mimeType);
      QueryResultIO.parse(getResponseBodyAsStream(), format, handler, pool.getValueFactory());
    }
    catch (UnsupportedQueryResultFormatException e) {
      logger.warn(e.toString(), e);
      throw new NoCompatibleMediaType("Server responded with an unsupported file format: " + mimeType);
    }
  }
View Full Code Here

      pool.executeTask(result);
      return result;
    }
    catch (UnsupportedRDFormatException e) {
      logger.warn(e.toString(), e);
      throw new NoCompatibleMediaType("Server responded with an unsupported file format: " + mimeType);
    }
    finally {
      if (result == null) {
        abort();
      }
View Full Code Here

      parser.setRDFHandler(handler);
      parser.parse(getResponseBodyAsStream(), method.getURI().getURI());
    }
    catch (UnsupportedRDFormatException e) {
      logger.warn(e.toString(), e);
      throw new NoCompatibleMediaType("Server responded with an unsupported file format: " + mimeType);
    }
  }
View Full Code Here

TOP

Related Classes of org.openrdf.http.protocol.exceptions.NoCompatibleMediaType

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.