Package org.w3c.tools.resources.indexer

Examples of org.w3c.tools.resources.indexer.TemplateContainer


  } catch (MimeTypeFormatException ex) {
      return null;
  }
  ResourceReference rr = getContentTypes();
  try {
      TemplateContainer types = (TemplateContainer) rr.lock();
      Enumeration e = types.enumerateResourceIdentifiers(true);
      String key = "*:*"; // if there is no better match...
      int match = -1;
      int cmatch;
      while (e.hasMoreElements()) {
    String ext_entry = (String)e.nextElement();
    MimeType entry_type = null;
    try {
        entry_type = new MimeType(ext_entry.replace(':','/'));
    } catch (MimeTypeFormatException mex) {
        // ok there is a configuration problem here
        continue;
    }
    cmatch = mtype.match(entry_type);
    if (cmatch > match) {
        match = cmatch;
        key = ext_entry;
        if (match == MimeType.MATCH_SPECIFIC_SUBTYPE)
      break; // exact match exit loop asap
    }
      }
      return types.lookup(key);
  } catch (InvalidResourceException ex) {
      String msg = ("[resource indexer]: content-types \""+
        type+
        "\" couldn't be restored ("+ex.getMessage()+")");
      getContext().getServer().errlog(msg);
View Full Code Here

TOP

Related Classes of org.w3c.tools.resources.indexer.TemplateContainer

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.