⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 directoryinfo.java

📁 dump3 morpheus 0.2.9 src
💻 JAVA
字号:
/**
 * DuMP3 version morpheus_0.2.9 - a duplicate/similar file finder in Java<BR>
 * Copyright 2005 Alexander Gr&auml;sser<BR>
 * All Rights Reserved, http://dump3.sourceforge.net/<BR>
 * <BR>
 * This file is part of DuMP3.<BR>
 * <BR>
 * DuMP3 is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 2 of the License, or (at your option) any later version.<BR>
 * <BR>
 * DuMP3 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 * PARTICULAR PURPOSE. See the GNU General Public License for more details.<BR>
 * <BR>
 * You should have received a copy of the GNU General Public License along with DuMP3; if not, write to the Free Software Foundation, Inc., 51 Franklin St,
 * Fifth Floor, Boston, MA 02110-1301 USA
 */
package net.za.grasser.duplicate.file;

import java.io.File;
import java.util.ArrayList;

/**
 * @author <a href="http://sourceforge.net/sendmessage.php?touser=733840">pyropunk at sourceforge dot net</a>
 * @version $Revision: 1.5 $
 * @modelguid {6952787A-0C4B-4A82-B25F-BFF7A50A8333}
 */
public class DirectoryInfo {
  /** @modelguid {D630C0C9-AA82-4855-B4A4-C4498723BD6B} */
  private String name;
  /**
   * <code>subdirs</code> DirectoryInfo - ArrayList of DirectoryInfo objects.
   * 
   * @modelguid {6D89692B-3AA1-456F-9D4D-518CC50F4224}
   */
  private ArrayList<DirectoryInfo> subdirs;
  /**
   * <code>files</code> DirectoryInfo - ArrayList of MDFingerprint objects.
   * 
   * @modelguid {673AEEA9-8A8C-4CD8-AE7B-CDA35DE9D7C2}
   */
  private ArrayList<FingerprintFile> files;
  /** @modelguid {A31A8F69-65A6-417D-9E7B-19D8742E1DB4} */
  private DirectoryInfo parent;

  /**
   * @param pName String
   * @modelguid {BABE7B08-7953-4417-94C1-483D550302B5}
   */
  public DirectoryInfo(final String pName) {
    name = pName;
  }

  /**
   * @return ArrayList of FingerprintFile objects.
   * @modelguid {DCBCB27E-E819-4885-B83B-3B31E19A5347}
   */
  public ArrayList<FingerprintFile> getFiles() {
    return files;
  }

  /**
   * @return String - name of this derectory.
   * @modelguid {77492DDD-EEDB-4745-B380-B477D971C2E8}
   */
  public String getName() {
    return name;
  }

  /**
   * @return DirectoryInfo - the parent dir.
   * @modelguid {ADD84D80-AFBE-4BBE-8E59-91BC40C74293}
   */
  public DirectoryInfo getParent() {
    return parent;
  }

  /**
   * @return ArrayList of DirectoryInfo objects.
   * @modelguid {AC00C398-1D06-48DB-BD6F-486440E4879E}
   */
  public ArrayList<DirectoryInfo> getSubDirectories() {
    return subdirs;
  }

  /**
   * @param vector ArrayList of MDFingerprint objects.
   * @modelguid {581038DB-C437-4B8F-9EB9-420EBE2990D1}
   */
  public void setFiles(final ArrayList<FingerprintFile> vector) {
    files = vector;
  }

  /**
   * @param string
   * @modelguid {1D64F66D-CCB2-42A7-9ADB-EAEBCD2CEA2E}
   */
  public void setName(final String string) {
    name = string;
  }

  /**
   * @param info
   * @modelguid {B05BFA6E-5626-4FAF-BA61-5ACB9DF22448}
   */
  public void setParent(final DirectoryInfo info) {
    parent = info;
  }

  /**
   * @param vector - ArrayList of DirectoryInfo objects.
   * @modelguid {40CAD58E-ED3A-4EDC-B5E5-0B766C1816F7}
   */
  public void setSubDirectories(final ArrayList<DirectoryInfo> vector) {
    subdirs = vector;
  }

  /**
   * @return String
   * @modelguid {2A9D19C0-1381-4E17-8553-381309D6901C}
   */
  public String getPath() {
    final StringBuffer ret = new StringBuffer(100);
    ret.append(name);
    DirectoryInfo p = getParent();
    while (p != null) {
      if (p.getName().endsWith("/") || p.getName().endsWith(File.separator)) {
        ret.insert(0, p.getName());
      } else {
        ret.insert(0, File.separator);
        ret.insert(0, p.getName());
      }
      p = p.getParent();
    }
    if (ret.lastIndexOf("/") != ret.length() - 1 && ret.lastIndexOf(File.separator) != ret.length() - 1) {
      ret.append(File.separator);
    }
    return ret.toString();
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -