Package org.w3c.www.http

Examples of org.w3c.www.http.HttpAccept


  if ( ! request.hasAccept() ) {
      //return the image
      return false;
  } else {
      // The browser has given some preferences:
      HttpAccept accepts[] = request.getAccept() ;
     
      //two content types image/jpeg and comment-type
      HttpAccept imgAccept =
    getMatchingAccept(accepts, getContentType());
      HttpAccept comAccept =
    getMatchingAccept(accepts, getCommentType());
     
      if ((imgAccept != null) &&  (comAccept != null)) {
    // go for best MIME match first
    int matchImg = getContentType().match(imgAccept.getMimeType());
    int matchCom = getCommentType().match(comAccept.getMimeType());

    if (matchImg == matchCom) {
        // equals, use quality
        return (imgAccept.getQuality() < comAccept.getQuality());
    } else {
        return (matchImg < matchCom);
    }
      } else if (comAccept != null)
    return true;
View Full Code Here


  int pos = sfile.indexOf(';');
  if (pos != -1) {
      param = (String) request.getState("type");
  }
  if (param != null) {
      HttpAccept acc[] = request.getAccept();
      HttpAccept newacc[] = null;
      if (acc != null) {
    newacc = new HttpAccept[acc.length+1];
    System.arraycopy(acc, 0, newacc, 1, acc.length);
      } else {
    newacc = new HttpAccept[1];
View Full Code Here

  int pos = sfile.indexOf(';');
  if (pos != -1) {
      param = (String) request.getState("type");
  }
  if (param != null) {
      HttpAccept acc[] = request.getAccept();
      HttpAccept newacc[] = null;
      if (acc != null) {
    newacc = new HttpAccept[acc.length+1];
    System.arraycopy(acc, 0, newacc, 1, acc.length);
      } else {
    newacc = new HttpAccept[1];
View Full Code Here

    VariantState state = (VariantState) states.elementAt(i) ;
    state.setQuality (1.0) ;
      }
  } else {
      // The browser has given some preferences:
      HttpAccept accepts[] = request.getAccept() ;

      for (int i = 0 ; i < states.size() ; i++ ) {
    VariantState state = (VariantState) states.elementAt(i) ;
    // Get the most specific match for this variant:
    ResourceReference rr = state.getResource();
View Full Code Here

  if ( ! request.hasAccept() ) {
      //return the image
      return false;
  } else {
      // The browser has given some preferences:
      HttpAccept accepts[] = request.getAccept() ;
     
      //two content types image/jpeg and comment-type
      HttpAccept imgAccept =
    getMatchingAccept(accepts, getContentType());
      HttpAccept xmpAccept =
    getMatchingAccept(accepts, xmptype);
     
      if ((imgAccept != null) &&  (xmpAccept != null)) {
    // go for best MIME match first
    int matchImg = getContentType().match(imgAccept.getMimeType());
    int matchXMP = xmptype.match(xmpAccept.getMimeType());

    if (matchImg == matchXMP) {
        // equals, use quality
        return (imgAccept.getQuality() < xmpAccept.getQuality());
    } else {
        return (matchImg < matchXMP);
    }
      } else if (xmpAccept != null)
    return true;
View Full Code Here

  int pos = sfile.indexOf(';');
  if (pos != -1) {
      param = (String) request.getState("type");
  }
  if (param != null) {
      HttpAccept acc[] = request.getAccept();
      HttpAccept newacc[] = null;
      if (acc != null) {
    newacc = new HttpAccept[acc.length+1];
    System.arraycopy(acc, 0, newacc, 1, acc.length);
      } else {
    newacc = new HttpAccept[1];
View Full Code Here

  int pos = sfile.indexOf(';');
  if (pos != -1) {
      param = (String) request.getState("type");
  }
  if (param != null) {
      HttpAccept acc[] = request.getAccept();
      HttpAccept newacc[] = null;
      if (acc != null) {
    newacc = new HttpAccept[acc.length+1];
    System.arraycopy(acc, 0, newacc, 1, acc.length);
      } else {
    newacc = new HttpAccept[1];
View Full Code Here

TOP

Related Classes of org.w3c.www.http.HttpAccept

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.