Ejemplo n.º 1
0
  /**
   * _more_
   *
   * @param entry _more_
   * @return _more_
   * @throws Exception On badness
   */
  public Hashtable getRecordProperties(Entry entry) throws Exception {
    Object[] values = entry.getTypeHandler().getEntryValues(entry);
    String propertiesString =
        (values[IDX_PROPERTIES] != null) ? values[IDX_PROPERTIES].toString() : "";

    String typeProperties = getProperty("record.properties", (String) null);

    Hashtable p = null;

    if (typeProperties != null) {
      if (p == null) {
        p = new Hashtable();
      }
      p.putAll(RecordFile.getProperties(typeProperties));
    }

    if (propertiesString != null) {
      if (p == null) {
        p = new Hashtable();
      }
      p.putAll(RecordFile.getProperties(propertiesString));
    }

    return p;
  }
Ejemplo n.º 2
0
  /**
   * _more_
   *
   * @param entry _more_
   * @param originalFile _more_
   * @throws Exception _more_
   */
  public void initializeEntry(Entry entry, File originalFile) throws Exception {

    if (anySuperTypesOfThisType()) {
      return;
    }
    Hashtable existingProperties = getRecordProperties(entry);
    if ((existingProperties != null) && (existingProperties.size() > 0)) {
      return;
    }

    // Look around for properties files that define
    // the crs, fields for text formats, etc.
    Hashtable properties =
        RecordFile.getPropertiesForFile(originalFile.toString(), PointFile.DFLT_PROPERTIES_FILE);

    // Make the properties string
    String contents = makePropertiesString(properties);
    Object[] values = entry.getTypeHandler().getEntryValues(entry);
    // Append the properties file contents
    if (values[IDX_PROPERTIES] != null) {
      values[IDX_PROPERTIES] = "\n" + contents;
    } else {
      values[IDX_PROPERTIES] = contents;
    }
  }