コード例 #1
0
  private String associateFile(Source source, String propertyName) throws Exception {
    if (source.hasProperty(propertyName)) {
      source.deleteProperty(propertyName);
    }
    File stats = source.createFileProperty(propertyName);
    DataSource ds = dsf.getDataSource(source.getName());
    ds.open();
    long rc = ds.getRowCount();
    ds.close();

    FileOutputStream fis = new FileOutputStream(stats);
    String rcStr = Long.toString(rc);
    fis.write(rcStr.getBytes());
    fis.close();

    return rcStr;
  }