/** Test of testDirectoryAnalyser method, of class FileSystemAnalyzer. */
  @Test
  public void testDirectoryAnalyser() throws Exception {
    System.out.println("testDirectoryAnalyser");
    FileSystemAnalyzer instance = new FileSystemAnalyzer();
    // Update the property file
    testPropertyReader();
    String folderPath = "C:\\Youdyog\\PublicPhone";
    System.out.println(
        DataUtility.getCurrentTimeStamp()
            + ", Starting the folder enlister test code: "
            + folderPath);
    File file = new File(folderPath);
    instance.updateFolderMetaDataStore(file);
    System.out.println("--------");
    System.out.println(DataUtility.getCurrentTimeStamp() + ", Dirs  : " + lFolderMetaDataStore);
    System.out.println(
        DataUtility.getCurrentTimeStamp() + ", Files : " + lFileMetaDataStore.size());
    System.out.println("--------");
    instance.updateAnalyzedDirectoryDataStore(folderPath);

    // Fetch the updated dataset
    // get the mAnalyzedDataStore
    ArrayList<AnalyzedData> lAnalyzed = mAnalyzedDataStore.get(folderPath);

    for (AnalyzedData ad : lAnalyzed) {
      System.out.println(
          "Group/Category Name: "
              + ad.dataGroupStatistics.dataType
              + ", Size: "
              + ad.dataGroupStatistics.dataCount);
      for (DataStats ds : ad.listDataSatistics) {
        System.out.println("    -Ext: " + ds.dataType + ", Size: " + ds.dataCount);
      }
    }
  }
Exemplo n.º 2
0
  /**
   * Create instance of Connection Pool
   *
   * @return
   */
  public static JDBCDataSource getInstance() {
    if (datasource == null) {

      ResourceBundle rb = ResourceBundle.getBundle("in.co.sunrays.bundle.system");

      datasource = new JDBCDataSource();
      datasource.cpds = new ComboPooledDataSource();
      try {
        datasource.cpds.setDriverClass(rb.getString("driver"));
      } catch (Exception e) {
        e.printStackTrace();
      }
      datasource.cpds.setJdbcUrl(rb.getString("url"));
      datasource.cpds.setUser(rb.getString("username"));
      datasource.cpds.setPassword(rb.getString("password"));
      datasource.cpds.setInitialPoolSize(new Integer((String) rb.getString("initialPoolSize")));
      datasource.cpds.setAcquireIncrement(new Integer((String) rb.getString("acquireIncrement")));
      datasource.cpds.setMaxPoolSize(new Integer((String) rb.getString("maxPoolSize")));
      datasource.cpds.setMaxIdleTime(DataUtility.getInt(rb.getString("timeout")));
      datasource.cpds.setMinPoolSize(new Integer((String) rb.getString("minPoolSize")));
    }
    return datasource;
  }