Index: /gli/trunk/src/org/greenstone/gatherer/collection/CollectionTreeNode.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/collection/CollectionTreeNode.java	(revision 16837)
+++ /gli/trunk/src/org/greenstone/gatherer/collection/CollectionTreeNode.java	(revision 16838)
@@ -51,6 +51,4 @@
     private boolean is_srcreplaceable = false;
 
-    private String displayFileName = null;
-
     public CollectionTreeNode(File file)
     {
@@ -61,43 +59,4 @@
 	this.is_srcreplaceable = CollectionDesignManager.plugin_manager.isFileSrcReplaceable(file);
     
-	displayFileName = calcDisplayString();
-    }
-
-
-    /** This method returns a string representation of the filenodes in the Collection
-     * Tree, that can then be displayed in the tree. 
-     * We'll initially assume that the filenames are utf8 encoded and so convert the
-     * filename into utf8 for proper presentation in the Collection tree pane.
-     * If the filenames are not utf8, then the conversion would have introduced funny
-     * characters. Therefore, when converting to utf8, if the converted filename 
-     * contains the special character '\ufffd', then we know the conversion did not work
-     * and we return the original string which may or may not be properly presented by
-     * default.
-     * See http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/CharsetDecoder.html
-     * which says "How a decoding error is handled depends upon the action requested for 
-     * that type of error, which is described by an instance of the CodingErrorAction class.
-     * The possible error actions are to ignore the erroneous input, report the error to
-     * the invoker via the returned CoderResult object, or replace the erroneous input with
-     * the current value of the replacement string. The replacement has the initial value 
-     * "\uFFFD"; its value may be changed via the replaceWith method."
-     * The following made me think that String(byte[], String charsetName) constructor may
-     * use the replacement value \uFFFD.
-     * http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20512969.html
-     * mentions the following which made me think of this: 
-     * convertedStr = convertedStr.replace('\ufffd', ' ');
-     */
-    protected String calcDisplayString() {
-	String filename = super.toString();
-	try{
-	    String utf8filename = new String(filename.getBytes(), "UTF8");
-	    if(utf8filename.indexOf('\ufffd') == -1) {
-		return utf8filename;
-	    } else { // contains the character indicating that it's invalid utf8
-		// return the original string
-		return filename;
-	    }
-	} catch(java.io.UnsupportedEncodingException e) {
-	    return filename;
-	}
     }
 
@@ -122,16 +81,3 @@
 	return is_srcreplaceable;
     }
-
-    /** This method returns a string representation of the filenodes in the Collection
-     * Tree, which is what will be displayed in the tree. It tries to convert it into
-     * some common encoding formats. Failing that, the unchanged filepath is returned.
-     * @see displayString
-     */ 
-    public String toString() 
-    {
-	if(displayFileName == null) {    
-	  displayFileName = calcDisplayString();
-	}
-	return displayFileName;
-    }
 }
Index: /gli/trunk/src/org/greenstone/gatherer/file/FileNode.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/file/FileNode.java	(revision 16837)
+++ /gli/trunk/src/org/greenstone/gatherer/file/FileNode.java	(revision 16838)
@@ -20,4 +20,6 @@
     protected FileSystemModel model = null;
     protected MutableTreeNode parent = null;
+    /** The string that is displayed as the filename. Attempts to be in the correct encoding. */
+    protected String displayFileName = null;
 
 
@@ -32,6 +34,44 @@
 	    this.allows_children = false;
 	}
-    }
-
+	displayFileName = calcDisplayString();
+    }
+
+
+     /** This method returns a string representation of the filenodes in the Collection
+     * Tree, that can then be displayed in the tree. 
+     * We'll initially assume that the filenames are utf8 encoded and so convert the
+     * filename into utf8 for proper presentation in the Collection tree pane.
+     * If the filenames are not utf8, then the conversion would have introduced funny
+     * characters. Therefore, when converting to utf8, if the converted filename 
+     * contains the special character '\ufffd', then we know the conversion did not work
+     * and we return the original string which may or may not be properly presented by
+     * default.
+     * See http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/CharsetDecoder.html
+     * which says "How a decoding error is handled depends upon the action requested for 
+     * that type of error, which is described by an instance of the CodingErrorAction class.
+     * The possible error actions are to ignore the erroneous input, report the error to
+     * the invoker via the returned CoderResult object, or replace the erroneous input with
+     * the current value of the replacement string. The replacement has the initial value 
+     * "\uFFFD"; its value may be changed via the replaceWith method."
+     * The following made me think that String(byte[], String charsetName) constructor may
+     * use the replacement value \uFFFD.
+     * http://www.experts-exchange.com/Programming/Programming_Languages/Java/Q_20512969.html
+     * mentions the following which made me think of this: 
+     * convertedStr = convertedStr.replace('\ufffd', ' ');
+     */
+    protected String calcDisplayString() {
+	String filename = file.getName();
+	try{
+	    String utf8filename = new String(filename.getBytes(), "UTF8");
+	    if(utf8filename.indexOf('\ufffd') == -1) {
+		return utf8filename;
+	    } else { // contains the character indicating that it's invalid utf8
+		// return the original string
+		return filename;
+	    }
+	} catch(java.io.UnsupportedEncodingException e) {
+	    return filename;
+	}
+    }
 
     /** Returns the children of the node as an Enumeration. */
@@ -312,5 +352,8 @@
 	}
 	else {
-	    return file.getName();
+	    if(displayFileName == null) {    
+		displayFileName = calcDisplayString();
+	    }
+	    return displayFileName;	    
 	}
     }
