Esempio n. 1
0
  private void ListSubDirectorySizes(File file) {
    File[] files;
    files =
        file.listFiles(
            new FileFilter() {
              @Override
              public boolean accept(File file) {
                //                if (!file.isDirectory()){
                //                    return false;  //To change body of implemented methods use
                // File | Settings | File Templates.
                //                }else{
                //                    return true;
                //                }
                return true;
              }
            });
    Map<String, Long> dirListing = new HashMap<String, Long>();
    for (File dir : files) {
      DiskUsage diskUsage = new DiskUsage();
      diskUsage.accept(dir);
      //            long size = diskUsage.getSize() / (1024 * 1024);
      long size = diskUsage.getSize();
      dirListing.put(dir.getName(), size);
    }

    ValueComparator bvc = new ValueComparator(dirListing);
    TreeMap<String, Long> sorted_map = new TreeMap<String, Long>(bvc);
    sorted_map.putAll(dirListing);

    PrettyPrint(file, sorted_map);
  }
Esempio n. 2
0
  /** Replace working files with the selected checked-in files. */
  @Override
  public void doApply() {
    super.doApply();

    if (pIsFrozen) return;

    TreeMap<String, VersionID> files = new TreeMap<String, VersionID>();
    for (JFileSeqPanel panel : pFileSeqPanels.values()) files.putAll(panel.getFilesToRevert());

    RevertTask task = new RevertTask(files);
    task.start();
  }