Package org.w3c.util

Examples of org.w3c.util.LookupTable


     * Read the servlets.properties file
     * @param file the servlets.properties file.
     */
    protected void readProperties(File file) {
  Properties props = new Properties();
  servlets = new LookupTable();
  general  = new LookupTable();
  try {
      InputStream in =
    new BufferedInputStream(new FileInputStream(file));
      props.load(in);
      in.close();
  } catch (FileNotFoundException fnfex) {
      // nothing
  } catch (IOException ioex) {
      // nothing to do
  }
  Enumeration e = props.propertyNames();
  while (e.hasMoreElements()) {
      String property = (String) e.nextElement();
      if (property.startsWith("servlet.")) {
    String value = props.getProperty(property);
    property     = property.substring(8); // remove "servlet."
    int idx      = property.indexOf('.');
    if (idx != -1) {
        String name = property.substring(0, idx);
        property    = property.substring(idx+1);
        if (idx != -1) {
      LookupTable lt = (LookupTable) servlets.get(name);
      if (lt == null) {
          lt = new LookupTable();
          servlets.put(name, lt);
      }
      lt.put(property, value);
        }
    }
      } else if (property.startsWith("servlets.")) {
    String value = props.getProperty(property);
    String name  = property.substring(9); // remove "servlets."
View Full Code Here


  throws SAXException
    {
  String iname = name.intern();
  if (iname == iRESOURCE_TAG) {
      if (level == 0) {
    table = new LookupTable(len);
      }
  } else if (iname == iATTRIBUTE_TAG) {
      if (level == 0) {
    String attribute = attributes.getValue(NAME_ATTR);
    readAttr = load(attribute);
View Full Code Here

  saved      = true;
  bytestored = 0;
  bytecount  = 0;
  cr_count   = 0;
  for (int i = 0 ; i < tables.length ; i++) {
      LookupTable table = tables[i];
      try {
    String stored =
        (String)table.get(CachedResource.NAME_CURRENT_LENGTH);
    String id =
        (String)table.get(CachedResource.NAME_IDENTIFIER);
    String file =
        (String)table.get(CachedResource.NAME_FILE);
    file = (file == null) ? "" : file;
    bytestored += Integer.parseInt(stored);
    lookupTable.put(id, file);
      } catch (Exception ex) {
    if (debug) {
View Full Code Here

     */
    public CacheGeneration readDescription(CacheGeneration generation,
             Reader reader)
  throws IOException        
    {
  LookupTable tables[] = null;
  try {
      tables = serializer.readAttributes(reader,
                 CachedResource.ATTR_DESCR);
  } catch (SerializationException ex) {
      String msg = "XML Serialization, load failed : "+
View Full Code Here

TOP

Related Classes of org.w3c.util.LookupTable

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.