Package org.w3c.www.mime

Examples of org.w3c.www.mime.MimeType


  throws CvsException
    {
  String u = (String)request.getState(AuthFilter.STATE_AUTHUSER);
  String env[] = {"USER="+u , "LOGNAME="+u };
  String names [] = null;
  MimeType mtype;
        mtype = request.getContentType();
  if (mtype != null &&
      (mtype.match(MimeType.TEXT) != MimeType.MATCH_SUBTYPE) &&
      (mtype.match(MimeType.APPLICATION_XHTML_XML) !=
                      MimeType.MATCH_SPECIFIC_SUBTYPE)) {
      names = new String[2];
      names[0] = "-kb";
      names[1] = getFileResource().getFile().getName();
  } else {
View Full Code Here


  if ( contenttype == null ) {
      String charset = getCharset();
      if (charset == null)
    contenttype = HttpFactory.makeMimeType(getContentType());
      else {
    MimeType ctype = getContentType().getClone();
    ctype.addParameter("charset", charset);
    contenttype = HttpFactory.makeMimeType(ctype);
      }
  }
  if (contentlength == null) {
      int cl = -1;
View Full Code Here

        // Dump the request as the body
        // Removed unused headers:
  // FIXME should be something else for chuncked stream
  ByteArrayOutputStream ba = new ByteArrayOutputStream();
  try {
      reply.setContentType(new MimeType("message/http"));
      request.dump(ba);
      reply.setContentLength(ba.size());
  } catch (Exception ex) {
      ex.printStackTrace();
  }
View Full Code Here

     */

    protected synchronized MimeType getBrowseType() {
  if ( browsetype == null ) {
      try {
    browsetype = new MimeType("application/x-navibrowse");
      } catch (Exception ex) {
    ex.printStackTrace();
      }
  }
  return browsetype;
View Full Code Here

    public ReplyInterface ingoingFilter(RequestInterface req) {
  Request request = (Request) req;
  if(request.getMethod().equals("PUT")) {
      try {
    MimeType req_mt = request.getContentType();
    if (req_mt.match(MimeType.TEXT) == MimeType.NO_MATCH)
        return null;
      } catch (NullPointerException ex) {
    // no Content-Type sent! check anyway
      }
View Full Code Here

    System.arraycopy(acc, 0, newacc, 1, acc.length);
      } else {
    newacc = new HttpAccept[1];
      }
      try {
    newacc[0] = HttpFactory.makeAccept(new MimeType(param), 1.1);
    request.setAccept(newacc);
      } catch (MimeTypeFormatException ex) {
    // not a valid mime type... maybe something else, do not care
      }
  }
View Full Code Here

    System.arraycopy(acc, 0, newacc, 1, acc.length);
      } else {
    newacc = new HttpAccept[1];
      }
      try {
    newacc[0] = HttpFactory.makeAccept(new MimeType(param), 1.1);
    request.setAccept(newacc);
      } catch (MimeTypeFormatException ex) {
    // not a valid mime type... maybe something else, do not care
      }
  }
View Full Code Here

      error.setContent("partial PUT not supported.");
      throw new HTTPException(error);
  }
  // Check that if some type is provided it doesn't conflict:
  if ( request.hasContentType() ) {
      MimeType rtype = request.getContentType() ;
      MimeType type  = xmptype ;
      if ( type == null ) {
    setValue (ATTR_CONTENT_TYPE, rtype) ;
      } else if ( rtype.match (type) < 0 ) {
    if (debug) {
        System.out.println("No match between: ["+
               rtype.toString()+"] and ["+
               type.toString()+"]");
    }
    Reply error = request.makeReply(HTTP.UNSUPPORTED_MEDIA_TYPE) ;
    error.setContent ("<p>Invalid content type: "+type.toString());
    throw new HTTPException (error) ;
      }
  }
  ImageFileResource ifresource = (ImageFileResource) fresource;
  // Write the body back to the file:
View Full Code Here

     * @return an object or <strong>null</strong> if the object was not
     * initialized
     */
    public Object getValue() {
  try {
      return new MimeType(comp.getText());
  } catch (Exception ex) {
      ex.printStackTrace();
  }
  // not reached
  return null;
View Full Code Here

         , Attribute a
         , Object o
         , Properties p)
  throws RemoteAccessException
    {
  MimeType type = (MimeType)o;
  if (o == null) {
      oldvalue = "*none*";
      createComponent(oldvalue);;
  } else {
      createComponent(type.toString());
      oldvalue = type.toString();
  }
    }
View Full Code Here

TOP

Related Classes of org.w3c.www.mime.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.