Package org.w3c.www.mime

Examples of org.w3c.www.mime.MimeType


  FramedResource template = null;
 
  //try with content type in request.
  if (req instanceof Request) {
      Request request = (Request) req;
      MimeType type = request.getContentType();
      if (type != null)
    rr = loadContentType(type.toString());
      if (rr != null) {
    String s_dir = "directory".intern();
    String s_ide = "identifier".intern();
    String s_fil = "filename".intern();
    String s_con = "context".intern();
View Full Code Here


  String param[] = new String[1];
  String value[] = new String[1];
  param[0] = "charset";
  // a translation table may be needed there
  value[0] = encoding;
  this.type = new MimeType("text", "html", param, value);
    }
View Full Code Here

  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

     * Get the entity MIME type.
     * @return An HttpMimeType object describing the entity's type, or
     * <strong>null</strong> if udefined.
     */
    public MimeType getContentType() {
  MimeType mt = super.getContentType();
  if (mt == null) {
      return MimeType.APPLICATION_OCTET_STREAM;
  } else {
      return mt;
  }
View Full Code Here

  return ((MimeType)obj).toString();
    }

    public Object unpickle (String value) {
  try {
      return new MimeType(value);
  } catch (MimeTypeFormatException ex) {
      return null;
  }
    }
View Full Code Here

  if(credential != null) {
      request.setAuthorization(credential);
  }
  try {
      Reply    reply = http.runRequest(request);
      MimeType type  = reply.getContentType();
      if( reply.getStatus() == HTTP.UNAUTHORIZED) {
        getInputStream(reply).close();
    throw new RemoteAccessException("Unauthorized");
      }
      if ((type == null) || (type.match(conftype) < 0)) {
        String content = getContent(reply);
        if (content != null)
    throw new RemoteAccessException(content);
        throw new RemoteAccessException("invalid content type");
      }
View Full Code Here

  if (array == null)
      return null;
  if (array instanceof String[])
      return (String[]) array;
  else if (array instanceof MimeType[]) {
      MimeType mimes[] = (MimeType[]) array;
      String strArray [] = new String[mimes.length];
      for (int i = 0 ; i < mimes.length ; i++)
    strArray[i] = mimes[i].toString();
      return strArray;
  } else
View Full Code Here

    public Object unpickle (String array[]) {
  int    cnt       = array.length ;
  if (cnt < 1)
      return null;
  MimeType mimes[] = new MimeType[cnt] ;
  for (int i = 0 ; i < cnt ; i++) {
      try {
    mimes[i] = new MimeType(array[i]) ;
      } catch (MimeTypeFormatException ex) {
    mimes[i] = null;
      }
  }
  return mimes ;
View Full Code Here

    public Object unpickle (DataInputStream in)
  throws IOException
    {
  try {
      return new MimeType(in.readUTF()) ;
  } catch (MimeTypeFormatException ex) {
      return null;
//      throw new IOException("illegal MIME type.") ;
  }
    }
View Full Code Here

  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

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.