Package org.wymiwyg.commons.mediatypes

Examples of org.wymiwyg.commons.mediatypes.MimeType


        Collection sourceFormats = Arrays.asList(formatConverters[i].getSourceFormats());
        if (sourceFormats.contains(mimeType)) {
          Resource newVariant = model.createResource();
          MimeType[] targetTypes = formatConverters[i].getTargetFormats();
          for (int j = 0; j < targetTypes.length; j++) {
            MimeType targetType = targetTypes[j];
            try {
              formatConverters[i].transform(resource, mimeType, targetType, documentVariant, newVariant);
            } catch (IOException e) {
              throw new HandlerException(e);
            }
View Full Code Here


    if (languageHeaders.length > 0) {
      language = languageHeaders[0];
    } else {
      language = null;
    }
    MimeType mimeType;
    try {
      try {
        mimeType = new MimeType(request
            .getHeaderValues(HeaderName.CONTENT_TYPE)[0]);
      } catch (ArrayIndexOutOfBoundsException e) {
        mimeType = new MimeType("unknown/unknown");
      }
    } catch (MimeTypeParseException e) {
      throw new HandlerException("No valid mime-type", e);
    }
    createDocument(resource, bOut.toByteArray(), language, mimeType,
View Full Code Here

   */
  public NTSerializer() {
  }
  public MimeType getMediaType() {
    try {
      return new MimeType("application/rdf+nt");
    } catch (MimeTypeParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

   */
  public N3Serializer() {
  }
  public MimeType getMediaType() {
    try {
      return new MimeType("application/rdf+n3");
    } catch (MimeTypeParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

  /**
   * @see org.wymiwyg.rwcf.tools.modelcontent.ResourceModelerInvoker.Serializer#getMediaType()
   */
  public MimeType getMediaType() {
    try {
      return new MimeType("application/trix");
    } catch (MimeTypeParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

*/
class XMLSerializer extends RDFXMLSerializer {

  public MimeType getMediaType() {
    try {
      return new MimeType("application/xml; stylesheet=none");
    } catch (MimeTypeParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

   */
  public TurtleSerializer() {
  }
  public MimeType getMediaType() {
    try {
      return new MimeType("application/x-turtle");
    } catch (MimeTypeParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

   */
  public RDFXMLSerializer() {
  }
  public MimeType getMediaType() {
    try {
      return new MimeType("application/rdf+xml");
    } catch (MimeTypeParseException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

   *          org.wymiwyg.rwcf.Response, org.wymiwyg.rwcf.HandlerChain)
   */
  public void handle(Request request, Response response, HandlerChain chain)
      throws HandlerException {
    Response responseWrapper;
    MimeType targetType = getPrefferedTarget(request);
    responseWrapper = new ResponseWrapper(response, new EnhancedRequest(request), targetType, localized);
    Request requestWrapper = new RequestWrapper(request,
        "application/java-instance?class=com.hp.hpl.jena.rdf.model.Model");
    chain.doNext(requestWrapper, responseWrapper);
    log.info("resourcemodeler returning");
View Full Code Here

    Iterator<AcceptHeaderEntry> acceptIter = new EnhancedRequest(request).getAccept();
    while (acceptIter.hasNext()) {
      AcceptHeaderEntry range = acceptIter.next();
      Iterator producedTargetIter = targetTypeSet.iterator();
      while (producedTargetIter.hasNext()) {
        MimeType currentTarget = (MimeType) producedTargetIter.next();
        if (range.getRange().match(currentTarget)) {
          return currentTarget;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.wymiwyg.commons.mediatypes.MimeType

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.