@@ -90,6 +90,7 @@ private void PrintDateSize(Writer out, File child, Date modTime,
9090 /**
9191 * Write a htmlized listing of the given directory to the given destination.
9292 *
93+ * @param contextPath path used for link prefixes
9394 * @param dir the directory to list
9495 * @param out write destination
9596 * @param path virtual path of the directory (usually the path name of
@@ -103,7 +104,7 @@ private void PrintDateSize(Writer out, File child, Date modTime,
103104 * @throws NullPointerException if a parameter except <var>files</var>
104105 * is {@code null}
105106 */
106- public List <String > listTo (File dir , Writer out , String path , List <String > files )
107+ public List <String > listTo (String contextPath , File dir , Writer out , String path , List <String > files )
107108 throws HistoryException , IOException {
108109 // TODO this belongs to a jsp, not here
109110 ArrayList <String > readMes = new ArrayList <String >();
@@ -117,7 +118,7 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
117118 }
118119
119120 out .write ("<table id=\" dirlist\" >\n " );
120- out .write ("<thead>\n <tr><th/><th>Name</th><th>Date</th><th>Size</th>" );
121+ out .write ("<thead>\n <tr><th/><th>Name</th><th></th><th> Date</th><th>Size</th>" );
121122 if (offset > 0 ) {
122123 out .write ("<th><tt>Description</tt></th>" );
123124 }
@@ -129,7 +130,7 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
129130 // print the '..' entry even for empty directories
130131 if (path .length () != 0 ) {
131132 out .write ("<tr><td><p class=\" 'r'\" /></td><td>" );
132- out .write ("<b><a href=\" ..\" >..</a></b></td>" );
133+ out .write ("<b><a href=\" ..\" >..</a></b></td><td></td> " );
133134 PrintDateSize (out , dir .getParentFile (), null , dateFormatter );
134135 out .write ("</tr>\n " );
135136 }
@@ -152,9 +153,11 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
152153 readMes .add (file );
153154 }
154155 boolean isDir = child .isDirectory ();
155- out .write ("<tr><td><p class=\" " );
156+ out .write ("<tr><td>" );
157+ out .write ("<p class=\" " );
156158 out .write (isDir ? 'r' : 'p' );
157- out .write ("\" /></td><td><a href=\" " );
159+ out .write ("\" />" );
160+ out .write ("</td><td><a href=\" " );
158161 out .write (Util .URIEncodePath (file ));
159162 if (isDir ) {
160163 out .write ("/\" ><b>" );
@@ -166,6 +169,7 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
166169 out .write ("</a>" );
167170 }
168171 out .write ("</td>" );
172+ Util .writeHAD (out , contextPath , path + file , isDir );
169173 PrintDateSize (out , child , modTimes .get (file ), dateFormatter );
170174 if (offset > 0 ) {
171175 String briefDesc = desc .getChildTag (parentFNode , file );
0 commit comments