Examples of ContentType


Examples of ch.ethz.inf.vs.scandium.dtls.ContentType

      for (Record record : records) {
        record.setSession(session);

        RawData raw = null;

        ContentType contentType = record.getType();
        LOGGER.finest(" => contentType: "+contentType);
        DTLSFlight flight = null;
        switch (contentType) {
        case APPLICATION_DATA:
          if (session == null) {
View Full Code Here

Examples of com.bradmcevoy.http.Response.ContentType

        }
        return typeContents.get(s);
    }

    protected boolean isMultiPart() {
        ContentType ct = getRequestContentType();
        log.trace("content type:", ct);
        return (ContentType.MULTIPART.equals(ct));
    }
View Full Code Here

Examples of com.claymus.site.module.content.ContentType

    int accessLevel = module.getAccessLevel(user.getRole());
    if(accessLevel < ModuleHelper.ADD)
      throw new UserException();

    Page page = PageData.getPage(KeyFactory.stringToKey(pageEncoded));
    ContentType contentData = ContentData.getContentType(contentDTO.getClass().getSimpleName().replace("DTO", ""));
    Content content = new Content(contentData, page.getId(), contentDTO.getLocation());
    content.update(contentDTO);
    content = ContentData.createContent(content);
    if(content == null)
      throw new ServerException("Content could not be created. Please try again later.");
View Full Code Here

Examples of com.fasterxml.clustermate.api.ContentType

                // then the default fallback
                String msg = getExcerpt(resp, config.getMaxExcerptLength());
                return failed(CallFailure.general(_server, statusCode, startTime, System.currentTimeMillis(), msg));
            }
            ContentType contentType = findContentType(resp, ContentType.JSON);
            in = resp.getResponseBodyAsStream();
            T result = converter.convert(contentType, in);
            return new AHCReadCallResult<T>(_server, result);
        } catch (Exception e) {
            if (in != null) {
View Full Code Here

Examples of com.gistlabs.mechanize.util.apache.ContentType

    Util.copy(getInputStream(), new NullOutputStream());
  }

  protected String getContentEncoding(final HttpResponse response) {
    try {
      ContentType contentType = ContentType.get(response.getEntity());
      return contentType.getCharset().displayName();
    } catch (NullPointerException np) {
      // TODO why don't test cases set this?
      return null;
    }
  }
View Full Code Here

Examples of com.google.apphosting.api.search.DocumentPb.FieldValue.ContentType

   * @throws IllegalArgumentException if the document contains an invalid set of fields.
   */
  public static void checkFieldSet(DocumentPb.Document document) {
    Set<Pair<String, ContentType> > noRepeatNames = Sets.newHashSet();
    for (DocumentPb.Field field : document.getFieldList()) {
      ContentType type = field.getValue().getType();
      if (type == ContentType.NUMBER || type == ContentType.DATE) {
        Pair<String, ContentType> typedField = new Pair<String, ContentType>(field.getName(), type);
        if (!noRepeatNames.add(typedField)) {
          throw new IllegalArgumentException(
              "Invalid document " + document.getId() + ": field " + field.getName() +
View Full Code Here

Examples of com.google.caja.util.ContentType

  private void findEmbeddedContent(Node node, List<EmbeddedContent> out) {
    if (node instanceof Element) {
      Element el = (Element) node;
      ElKey key = ElKey.forElement(el);
      ContentType expected = null;
      ExternalReference extRef = null;
      String defaultMimeType = null;
      EmbeddedContent.Scheduling scheduling = EmbeddedContent.Scheduling.NORMAL;
      if (SCRIPT.equals(key)) {
        expected = ContentType.JS;
        extRef = externalReferenceFromAttr(el, SCRIPT_SRC);
        if (Strings.eqIgnoreCase(
            "defer",
            el.getAttributeNS(SCRIPT_DEFER.ns.uri, SCRIPT_DEFER.localName))) {
          scheduling = EmbeddedContent.Scheduling.DEFERRED;
        } else if (Strings.eqIgnoreCase(
            "async",
            el.getAttributeNS(SCRIPT_ASYNC.ns.uri, SCRIPT_ASYNC.localName))) {
          scheduling = EmbeddedContent.Scheduling.ASYNC;
        }
      } else if (STYLE.equals(key)) {
        expected = ContentType.CSS;
      } else if (LINK.equals(key)
                 && Strings.eqIgnoreCase(
                     "stylesheet",
                     el.getAttributeNS(LINK_REL.ns.uri, LINK_REL.localName))) {
        extRef = externalReferenceFromAttr(el, LINK_HREF);
        if (extRef != null) {
          expected = ContentType.CSS;
          defaultMimeType = ContentType.CSS.mimeType;
        }
      }
      if (expected != null) {
        String mimeType = getMimeTypeFromHtmlTypeAttribute(el, key);
        if (mimeType == null) { mimeType = defaultMimeType; }
        ContentType actualType = mimeType != null
            ? ContentType.fromMimeType(mimeType) : null;
        if (actualType == expected) {
          if (extRef == null) {
            out.add(fromElementBody(el, expected, scheduling));
          } else {
View Full Code Here

Examples of com.google.code.javax.mail.internet.ContentType

  }
    }

    private boolean isXmlType(String type) {
  try {
      ContentType ct = new ContentType(type);
      return ct.getSubType().equals("xml") &&
        (ct.getPrimaryType().equals("text") ||
        ct.getPrimaryType().equals("application"));
  } catch (Exception ex) {
      return false;
  }
    }
View Full Code Here

Examples of com.google.gdata.util.ContentType

    }
    String value = httpConn.getHeaderField("Content-Type");
    if (value == null) {
      return null;
    }
    return new ContentType(value);
  }
View Full Code Here

Examples of com.google.gdata.util.ContentType

        throws ParseException {

      if (namespace.equals("")) {
        if (localName.equals("type")) {
          try {
            mimeType = new ContentType(value);
          } catch (IllegalArgumentException e) {
            throw new ParseException(
                CoreErrorDomain.ERR.invalidMimeType, e);
          }
        } else if (localName.equals("src")) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.