More duplicate disks

This commit is contained in:
Denis Molony 2016-12-10 18:36:44 +11:00
parent 21419474d1
commit 4a36ec039c
10 changed files with 156 additions and 337 deletions

View File

@ -27,10 +27,6 @@ public class DiskDetails
checksum = ComputeCRC32.getChecksumValue (file);
}
// public boolean isDuplicate ()
// {
// return duplicate;
// }
public void addDuplicateChecksum (DiskDetails diskDetails)
{

View File

@ -8,7 +8,8 @@ import javax.swing.table.AbstractTableModel;
public class DiskTableModel extends AbstractTableModel
{
static final String[] headers = { "Name", "Location", "Checksum" };
static final String[] headers =
{ "Path", "Name", "same name", "same data", "Checksum" };
Map<String, DiskDetails> fileNameMap;
Map<Long, DiskDetails> checkSumMap;
@ -22,18 +23,10 @@ public class DiskTableModel extends AbstractTableModel
for (String key : fileNameMap.keySet ())
{
DiskDetails original = fileNameMap.get (key);
// if (false)
// {
// if (original.getDuplicateChecksums ().size () > 0)
// {
// lines.add (new TableLine (original));
// for (DiskDetails duplicate : original.getDuplicateChecksums ())
// lines.add (new TableLine (duplicate));
// }
// }
// else
lines.add (new TableLine (original));
for (DiskDetails duplicate : original.getDuplicateNames ())
lines.add (new TableLine (duplicate));
}
}
@ -58,17 +51,7 @@ public class DiskTableModel extends AbstractTableModel
@Override
public Class<?> getColumnClass (int columnIndex)
{
switch (columnIndex)
{
case 0:
return String.class;
case 1:
return String.class;
case 2:
return Long.class;
default:
return Object.class;
}
return lines.isEmpty () ? Object.class : getValueAt (0, columnIndex).getClass ();
}
@Override
@ -78,10 +61,14 @@ public class DiskTableModel extends AbstractTableModel
switch (columnIndex)
{
case 0:
return line.shortName;
return line.path;
case 1:
return line.diskDetails.getRootName ();
return line.shortName;
case 2:
return line.duplicateNames;
case 3:
return line.duplicateChecksums;
case 4:
return line.checksum;
default:
return "???";
@ -90,15 +77,37 @@ public class DiskTableModel extends AbstractTableModel
class TableLine
{
String shortName;
DiskDetails diskDetails;
long checksum;
private final String shortName;
private final String path;
private final long checksum;
private final int duplicateNames;
private final int duplicateChecksums;
final DiskDetails diskDetails;
public TableLine (DiskDetails diskDetails)
{
this.shortName = diskDetails.getShortName ();
this.diskDetails = diskDetails;
this.checksum = diskDetails.getChecksum ();
shortName = diskDetails.getShortName ();
checksum = diskDetails.getChecksum ();
String rootName = diskDetails.getRootName ();
path = rootName.substring (0, rootName.length () - shortName.length ());
if (diskDetails.isDuplicateChecksum ())
{
DiskDetails original = checkSumMap.get (diskDetails.getChecksum ());
duplicateChecksums = original.getDuplicateChecksums ().size () + 1;
}
else
duplicateChecksums = diskDetails.getDuplicateChecksums ().size () + 1;
if (diskDetails.isDuplicateName ())
{
DiskDetails original = fileNameMap.get (diskDetails.getShortName ());
duplicateNames = original.getDuplicateNames ().size () + 1;
}
else
duplicateNames = diskDetails.getDuplicateNames ().size () + 1;
}
}
}

View File

@ -5,21 +5,20 @@ import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
import com.bytezone.diskbrowser.gui.FileComparator;
import com.bytezone.diskbrowser.utilities.Utility;
public class DuplicateHandler
{
private static final FileComparator fileComparator = new FileComparator ();
private static final int MAX_NAME_WIDTH = 34;
private static final String FORMAT = "%-" + MAX_NAME_WIDTH + "s %,10d%n";
// private static final FileComparator fileComparator = new FileComparator ();
// private static final int MAX_NAME_WIDTH = 34;
// private static final String FORMAT = "%-" + MAX_NAME_WIDTH + "s %,10d%n";
private final File rootFolder;
private int totalDisks;
private int totalFolders;
private final int rootFolderNameLength;
private final boolean debug = false;
// private final boolean debug = false;
// total files for each suffix
private final Map<String, Integer> typeList = new TreeMap<String, Integer> ();
@ -105,20 +104,15 @@ public class DuplicateHandler
DiskDetails diskDetails = new DiskDetails (file, rootName, fileName);
if (fileNameMap.containsKey (fileName))
{
DiskDetails otherDisk = fileNameMap.get (fileName);
otherDisk.addDuplicateName (diskDetails);
}
fileNameMap.get (fileName).addDuplicateName (diskDetails);
else
fileNameMap.put (fileName, diskDetails);
if (checksumMap.containsKey (diskDetails.getChecksum ()))
{
DiskDetails otherDisk = checksumMap.get (diskDetails.getChecksum ());
otherDisk.addDuplicateChecksum (diskDetails);
}
long checksum = diskDetails.getChecksum ();
if (checksumMap.containsKey (checksum))
checksumMap.get (checksum).addDuplicateChecksum (diskDetails);
else
checksumMap.put (diskDetails.getChecksum (), diskDetails);
checksumMap.put (checksum, diskDetails);
}
private void incrementType (File file, String fileName)

View File

@ -1,102 +1,61 @@
package com.bytezone.diskbrowser.duplicates;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Rectangle;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import javax.swing.table.JTableHeader;
import javax.swing.table.TableRowSorter;
import com.bytezone.diskbrowser.gui.DuplicateAction;
import com.bytezone.diskbrowser.gui.DuplicateAction.DiskTableSelectionListener;
public class DuplicateWindow extends JFrame
{
private final JTable table;
int folderNameLength;
Map<String, List<DiskDetails>> duplicateDisks;
File rootFolder;
JButton buttonDelete = new JButton ("Delete selected");
JButton buttonCancel = new JButton ("Cancel");
JButton buttonAll = new JButton ("Select all duplicates");
JButton buttonClear = new JButton ("Clear all");
// JPanel mainPanel = new JPanel ();
private final JButton btnExport = new JButton ("Export");
private final JButton btnHide = new JButton ("Close");
List<DiskDetails> disksSelected = new ArrayList<DiskDetails> ();
private DuplicateHandler duplicateHandler;
private final List<DiskTableSelectionListener> listeners;
DuplicateHandler duplicateHandler;
public DuplicateWindow (File rootFolder)
public DuplicateWindow (File rootFolder,
List<DuplicateAction.DiskTableSelectionListener> listeners)
{
super ("Duplicate Disk Detection - " + rootFolder.getAbsolutePath ());
folderNameLength = rootFolder.getAbsolutePath ().length ();
this.listeners = listeners;
table = new JTable ();
JScrollPane scrollPane =
new JScrollPane (table, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
table.setFillsViewportHeight (true);
// table.setShowGrid (true);
// table.setGridColor (Color.BLACK);
table.setFillsViewportHeight (true);
table.setAutoCreateRowSorter (true);
table.setShowGrid (true);
table.setGridColor (Color.LIGHT_GRAY);
add (scrollPane, BorderLayout.CENTER);
JPanel panel = new JPanel ();
panel.add (buttonClear);
panel.add (buttonAll);
panel.add (buttonDelete);
panel.add (buttonCancel);
panel.add (btnHide);
panel.add (btnExport);
add (panel, BorderLayout.SOUTH);
buttonClear.setEnabled (false);
buttonAll.setEnabled (false);
buttonDelete.setEnabled (false);
buttonCancel.setEnabled (false);
btnHide.setEnabled (true);
btnExport.setEnabled (false);
buttonAll.addActionListener (new ActionListener ()
{
@Override
public void actionPerformed (ActionEvent e)
{
// for (DuplicatePanel dp : duplicatePanels)
// {
// int count = 0;
// for (JCheckBox cb : dp.checkBoxes)
// {
// if (count > 0 && dp.duplicateDisks.get (count).isDuplicate ())
// if (!cb.isSelected ())
// {
// cb.setSelected (true); // doesn't fire the actionListener!
// disksSelected.add (dp.duplicateDisks.get (count));
// }
// ++count;
// }
// }
buttonDelete.setEnabled (disksSelected.size () > 0);
buttonClear.setEnabled (disksSelected.size () > 0);
}
});
buttonClear.addActionListener (new ActionListener ()
{
@Override
public void actionPerformed (ActionEvent e)
{
// for (DuplicatePanel dp : duplicatePanels)
// for (JCheckBox cb : dp.checkBoxes)
// cb.setSelected (false); // doesn't fire the actionListener!
disksSelected.clear ();
buttonDelete.setEnabled (false);
buttonClear.setEnabled (false);
}
});
buttonCancel.addActionListener (new ActionListener ()
btnHide.addActionListener (new ActionListener ()
{
@Override
public void actionPerformed (ActionEvent e)
@ -105,41 +64,7 @@ public class DuplicateWindow extends JFrame
}
});
buttonDelete.addActionListener (new ActionListener ()
{
@Override
public void actionPerformed (ActionEvent e)
{
int totalDeleted = 0;
int totalFailed = 0;
// for (DuplicatePanel dp : duplicatePanels)
// {
// int count = 0;
// for (JCheckBox cb : dp.checkBoxes)
// {
// if (cb.isSelected ())
// {
// DiskDetails dd = dp.duplicateDisks.get (count);
// if (dd.delete ())
// {
// ++totalDeleted;
// System.out.println ("Deleted : " + dd);
// }
// else
// {
// ++totalFailed;
// System.out.println ("Failed : " + dd);
// }
// }
// ++count;
// }
// }
System.out.printf ("Deleted : %d, Failed : %d%n", totalDeleted, totalFailed);
}
});
setSize (1100, 700);
setSize (1200, 700);
setLocationRelativeTo (null);
setDefaultCloseOperation (HIDE_ON_CLOSE);
}
@ -147,10 +72,42 @@ public class DuplicateWindow extends JFrame
public void setDuplicateHandler (DuplicateHandler duplicateHandler)
{
this.duplicateHandler = duplicateHandler;
table.setModel (new DiskTableModel (duplicateHandler));
table.getColumnModel ().getColumn (0).setPreferredWidth (300);
table.getColumnModel ().getColumn (1).setPreferredWidth (500);
table.getColumnModel ().getColumn (2).setPreferredWidth (100);
int[] columnWidths = { 300, 300, 40, 40, 100 };
for (int i = 0; i < columnWidths.length; i++)
table.getColumnModel ().getColumn (i).setPreferredWidth (columnWidths[i]);
final TableRowSorter<DiskTableModel> sorter =
new TableRowSorter<DiskTableModel> ((DiskTableModel) table.getModel ());
table.setRowSorter (sorter);
ListSelectionModel listSelectionModel = table.getSelectionModel ();
listSelectionModel.addListSelectionListener (new ListSelectionListener ()
{
@Override
public void valueChanged (ListSelectionEvent e)
{
if (e.getValueIsAdjusting ())
return;
ListSelectionModel lsm = (ListSelectionModel) e.getSource ();
if (lsm.isSelectionEmpty ())
return;
table.scrollRectToVisible (
new Rectangle (table.getCellRect (lsm.getMinSelectionIndex (), 0, true)));
int selectedRow = table.getSelectedRow ();
int actualRow = sorter.convertRowIndexToModel (selectedRow);
DiskTableModel diskTableModel = (DiskTableModel) table.getModel ();
DiskDetails diskDetails = diskTableModel.lines.get (actualRow).diskDetails;
for (DiskTableSelectionListener listener : listeners)
listener.diskSelected (diskDetails);
}
});
JTableHeader header = table.getTableHeader ();
header.setFont (header.getFont ().deriveFont ((float) 13.0));

View File

@ -31,13 +31,16 @@ import com.bytezone.diskbrowser.applefile.AppleFileSource;
import com.bytezone.diskbrowser.catalog.DocumentCreatorFactory;
import com.bytezone.diskbrowser.disk.DualDosDisk;
import com.bytezone.diskbrowser.disk.FormattedDisk;
import com.bytezone.diskbrowser.duplicates.DiskDetails;
import com.bytezone.diskbrowser.gui.DuplicateAction.DiskTableSelectionListener;
import com.bytezone.diskbrowser.gui.RedoHandler.RedoEvent;
import com.bytezone.diskbrowser.gui.RedoHandler.RedoListener;
import com.bytezone.diskbrowser.gui.RootDirectoryAction.RootDirectoryChangeListener;
import com.bytezone.diskbrowser.gui.TreeBuilder.FileNode;
class CatalogPanel extends JTabbedPane implements RedoListener, SectorSelectionListener,
QuitListener, FontChangeListener, RootDirectoryChangeListener
class CatalogPanel extends JTabbedPane
implements RedoListener, SectorSelectionListener, QuitListener, FontChangeListener,
RootDirectoryChangeListener, DiskTableSelectionListener
{
private static final String prefsLastDiskUsed = "Last disk used";
private static final String prefsLastDosUsed = "Last dos used";
@ -69,7 +72,6 @@ class CatalogPanel extends JTabbedPane implements RedoListener, SectorSelectionL
setTabPlacement (SwingConstants.BOTTOM);
setPreferredSize (new Dimension (360, 802)); // width, height
// setPreferredSize (new Dimension (360, 523)); // width, height
createTabs (prefs);
addChangeListener (new TabChangeListener ());
@ -193,13 +195,6 @@ class CatalogPanel extends JTabbedPane implements RedoListener, SectorSelectionL
setSelectedIndex (0);
}
// void setDuplicateAction (DuplicateAction action)
// {
// this.duplicateAction = action;
// if (fileTab != null && fileTab.rootFolder != null)
// action.setDuplicates (fileTab.rootFolder, fileTab.duplicateDisks);
// }
void setCloseTabAction (CloseTabAction action)
{
this.closeTabAction = action;
@ -444,4 +439,14 @@ class CatalogPanel extends JTabbedPane implements RedoListener, SectorSelectionL
addDiskPanel (node.getFormattedDisk (), null, true);
}
}
// a disk has been selected from the Disk Duplicates Table
@Override
public void diskSelected (DiskDetails diskDetails)
{
if (getSelectedIndex () != 0)
setSelectedIndex (0);
fileTab.selectDisk (diskDetails.getRootName ());
}
}

View File

@ -59,7 +59,7 @@ class DiskAndFileSelector
// }
// }
public void fireDiskSelectionEvent (FileNode node)
void fireDiskSelectionEvent (FileNode node)
{
if (node.file.isDirectory ())
{
@ -71,13 +71,13 @@ class DiskAndFileSelector
FormattedDisk fd = node.getFormattedDisk ();
if (fd == null)
JOptionPane.showMessageDialog (null, "Incorrect file format", "Format error",
JOptionPane.ERROR_MESSAGE);
JOptionPane.ERROR_MESSAGE);
else
fireDiskSelectionEvent (fd);
}
}
public void fireFileNodeSelectionEvent (FileNode node)
void fireFileNodeSelectionEvent (FileNode node)
{
FileNodeSelectedEvent e = new FileNodeSelectedEvent (this, node);
e.redo = redo;
@ -87,7 +87,7 @@ class DiskAndFileSelector
listener.fileNodeSelected (e);
}
public void fireDiskSelectionEvent (FormattedDisk disk)
void fireDiskSelectionEvent (FormattedDisk disk)
{
if (disk == currentDisk)
{
@ -124,7 +124,7 @@ class DiskAndFileSelector
listenerList.remove (FileSelectionListener.class, listener);
}
public void fireFileSelectionEvent (AppleFileSource file)
void fireFileSelectionEvent (AppleFileSource file)
{
assert file != null;
currentDisk = null;

View File

@ -97,6 +97,8 @@ public class DiskBrowser extends JFrame implements DiskSelectionListener, QuitLi
diskLayoutPanel.addSectorSelectionListener (redoHandler);
diskLayoutPanel.addSectorSelectionListener (catalogPanel);
duplicateAction.addTableSelectionListener (catalogPanel);
redoHandler.addRedoListener (catalogPanel);
redoHandler.addRedoListener (diskLayoutPanel);

View File

@ -4,20 +4,24 @@ import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.swing.Action;
import javax.swing.KeyStroke;
import com.bytezone.common.DefaultAction;
import com.bytezone.diskbrowser.duplicates.DiskDetails;
import com.bytezone.diskbrowser.duplicates.DuplicateWindow;
import com.bytezone.diskbrowser.duplicates.DuplicateWorker;
import com.bytezone.diskbrowser.gui.RootDirectoryAction.RootDirectoryChangeListener;
public class DuplicateAction extends DefaultAction implements RootDirectoryChangeListener
{
int rootFolderLength;
File rootFolder;
DuplicateWindow window;
private File rootFolder;
private DuplicateWindow window;
private final List<DiskTableSelectionListener> listeners =
new ArrayList<DiskTableSelectionListener> ();
public DuplicateAction ()
{
@ -44,10 +48,21 @@ public class DuplicateAction extends DefaultAction implements RootDirectoryChang
{
if (window == null)
{
window = new DuplicateWindow (rootFolder);
window = new DuplicateWindow (rootFolder, listeners);
new DuplicateWorker (rootFolder, window).execute ();
}
else
window.setVisible (true);
}
public void addTableSelectionListener (DiskTableSelectionListener listener)
{
if (!listeners.contains (listener))
listeners.add (listener);
}
public interface DiskTableSelectionListener
{
public void diskSelected (DiskDetails diskDetails);
}
}

View File

@ -28,7 +28,6 @@ import com.bytezone.diskbrowser.gui.TreeBuilder.FileNode;
class FileSystemTab extends AbstractTab
{
File rootFolder;
// Map<String, List<DiskDetails>> duplicateDisks;
public FileSystemTab (File folder, DiskAndFileSelector selector, RedoHandler navMan,
Font font, DiskSelectedEvent diskEvent)
@ -38,7 +37,6 @@ class FileSystemTab extends AbstractTab
TreeBuilder tb = new TreeBuilder (folder);
// duplicateDisks = tb.duplicateDisks;
setTree (tb.getTree ());
setSelectionListener (tree);
@ -123,32 +121,14 @@ class FileSystemTab extends AbstractTab
System.out.println ("Disk node not found");
}
void selectDisk (String path)
{
showNode (findNode (rootFolder.getAbsolutePath () + path));
}
private DefaultMutableTreeNode findNode (String absolutePath)
{
DefaultMutableTreeNode rootNode = getRootNode ();
if (true)
return search (rootNode, absolutePath);
// old code
Enumeration<DefaultMutableTreeNode> children = rootNode.breadthFirstEnumeration ();
while (children.hasMoreElements ())
{
DefaultMutableTreeNode node = children.nextElement ();
FileNode fn = (FileNode) node.getUserObject ();
System.out.println ("Comparing : " + fn.file.getAbsolutePath ());
if (absolutePath.startsWith (fn.file.getAbsolutePath ()))
{
System.out.println ("promising");
fn.readFiles ();
}
if (fn.file.getAbsolutePath ().equals (absolutePath))
return node;
}
System.out.println ("Node not found : " + absolutePath);
return null;
return search (getRootNode (), absolutePath);
}
private DefaultMutableTreeNode search (DefaultMutableTreeNode node, String absolutePath)

View File

@ -26,27 +26,9 @@ public class TreeBuilder
private static final int DISK_16_SIZE = 143360;
private static final int DISK_800K_SIZE = 819264;
// private static final boolean FULL_TREE_TRAVERSAL = false;
private final FileComparator fileComparator = new FileComparator ();
private final JTree tree;
// private int totalDisks;
// private int totalFolders;
// // total files for each suffix
// private final Map<String, Integer> typeList = new TreeMap<String, Integer> ();
//
// // list of unique disk names -> List of File duplicates
// final Map<String, List<DiskDetails>> duplicateDisks =
// new TreeMap<String, List<DiskDetails>> ();
//
// // list of unique disk names -> File
// private final Map<String, File> diskNames = new HashMap<String, File> ();
//
// // list of checksum -> File
// final Map<Long, List<File>> dosMap = new TreeMap<Long, List<File>> ();
public TreeBuilder (File folder)
{
assert (folder.exists ());
@ -62,22 +44,6 @@ public class TreeBuilder
treeModel.setAsksAllowsChildren (true); // allows empty nodes to appear as folders
setDiskIcon ("/com/bytezone/diskbrowser/icons/disk.png");
// ((FileNode) root.getUserObject ()).disks = totalDisks;
// if (FULL_TREE_TRAVERSAL)
// {
// System.out.printf ("%nFolders ..... %,5d%n", totalFolders);
// System.out.printf ("Disks ....... %,5d%n%n", totalDisks);
//
// int grandTotal = 0;
// for (String key : typeList.keySet ())
// {
// int typeTotal = typeList.get (key);
// grandTotal += typeTotal;
// System.out.printf ("%13.13s %,6d%n", key + " ...........", typeTotal);
// }
// System.out.printf ("%nTotal ....... %,6d%n%n", grandTotal);
// }
}
public JTree getTree ()
@ -94,7 +60,6 @@ public class TreeBuilder
return;
}
// FileNode parentNode = (FileNode) node.getUserObject ();
Arrays.sort (files, fileComparator);
for (File file : files)
@ -107,30 +72,9 @@ public class TreeBuilder
newNode.setAllowsChildren (true);
node.add (newNode);
// totalFolders++;
// if (FULL_TREE_TRAVERSAL)
// addFiles (newNode, file); // recursion!
continue;
}
// if (FULL_TREE_TRAVERSAL)
// {
// int pos = file.getName ().lastIndexOf ('.');
// if (pos > 0)
// {
// String type = file.getName ().substring (pos + 1).toLowerCase ();
// if (typeList.containsKey (type))
// {
// int t = typeList.get (type);
// typeList.put (type, ++t);
// }
// else
// typeList.put (type, 1);
// }
// }
if (file.length () != DISK_16_SIZE && file.length () != DISK_13_SIZE
&& file.length () != DISK_800K_SIZE && file.length () < 200000)
{
@ -139,8 +83,6 @@ public class TreeBuilder
continue;
}
// parentNode.disks++;
if (Utility.validFileType (file.getAbsolutePath ()))
{
FileNode fileNode = new FileNode (file);
@ -148,74 +90,10 @@ public class TreeBuilder
fileNode.setTreeNode (newNode);
newNode.setAllowsChildren (false);
node.add (newNode);
// if (false)
// checkDuplicates (file);
// totalDisks++;
// if (false)
// checksumDos (file);
}
}
}
// private void checksumDos (File file)
// {
// if (file.length () != 143360 || file.getAbsolutePath ().contains ("/ZDisks/"))
// return;
//
// Disk disk = new AppleDisk (file, 35, 16);
// byte[] buffer = disk.readSector (0, 0);
//
// Checksum checksum = new CRC32 ();
// checksum.update (buffer, 0, buffer.length);
// long cs = checksum.getValue ();
// List<File> files = dosMap.get (cs);
// if (files == null)
// {
// files = new ArrayList<File> ();
// dosMap.put (cs, files);
// }
// files.add (file);
// }
// private void checkDuplicates (File file)
// {
// if (diskNames.containsKey (file.getName ()))
// {
// List<DiskDetails> diskList = duplicateDisks.get (file.getName ());
// if (diskList == null)
// {
// diskList = new ArrayList<DiskDetails> ();
// duplicateDisks.put (file.getName (), diskList);
// diskList.add (new DiskDetails (diskNames.get (file.getName ())));// add original
// }
// diskList.add (new DiskDetails (file)); // add the duplicate
// }
// else
// diskNames.put (file.getName (), file);
// }
// private boolean validFileType (String filename)
// {
// int dotPos = filename.lastIndexOf ('.');
// if (dotPos < 0)
// return false;
//
// String suffix = filename.substring (dotPos + 1).toLowerCase ();
//
// int dotPos2 = filename.lastIndexOf ('.', dotPos - 1);
// if (dotPos2 > 0)
// {
// String suffix2 = filename.substring (dotPos2 + 1, dotPos).toLowerCase ();
// if (suffix.equals ("gz") && (suffix2.equals ("bxy") || suffix2.equals ("bny")))
// return false;
// }
//
// return suffixes.contains (suffix);
// }
private void setDiskIcon (String iconName)
{
URL url = this.getClass ().getResource (iconName);
@ -356,21 +234,4 @@ public class TreeBuilder
return null;
}
}
// private class FileComparator implements Comparator<File>
// {
// @Override
// public int compare (File thisFile, File thatFile)
// {
// boolean thisFileIsDirectory = thisFile.isDirectory ();
// boolean thatFileIsDirectory = thatFile.isDirectory ();
//
// if (thisFileIsDirectory && !thatFileIsDirectory)
// return -1;
// if (!thisFileIsDirectory && thatFileIsDirectory)
// return 1;
//
// return thisFile.getName ().compareToIgnoreCase (thatFile.getName ());
// }
// }
}