@@ -90,6 +90,7 @@ private void PrintDateSize(Writer out, File child, Date modTime,
90
90
/**
91
91
* Write a htmlized listing of the given directory to the given destination.
92
92
*
93
+ * @param contextPath path used for link prefixes
93
94
* @param dir the directory to list
94
95
* @param out write destination
95
96
* @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,
103
104
* @throws NullPointerException if a parameter except <var>files</var>
104
105
* is {@code null}
105
106
*/
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 )
107
108
throws HistoryException , IOException {
108
109
// TODO this belongs to a jsp, not here
109
110
ArrayList <String > readMes = new ArrayList <String >();
@@ -117,7 +118,7 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
117
118
}
118
119
119
120
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>" );
121
122
if (offset > 0 ) {
122
123
out .write ("<th><tt>Description</tt></th>" );
123
124
}
@@ -129,7 +130,7 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
129
130
// print the '..' entry even for empty directories
130
131
if (path .length () != 0 ) {
131
132
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> " );
133
134
PrintDateSize (out , dir .getParentFile (), null , dateFormatter );
134
135
out .write ("</tr>\n " );
135
136
}
@@ -152,9 +153,11 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
152
153
readMes .add (file );
153
154
}
154
155
boolean isDir = child .isDirectory ();
155
- out .write ("<tr><td><p class=\" " );
156
+ out .write ("<tr><td>" );
157
+ out .write ("<p class=\" " );
156
158
out .write (isDir ? 'r' : 'p' );
157
- out .write ("\" /></td><td><a href=\" " );
159
+ out .write ("\" />" );
160
+ out .write ("</td><td><a href=\" " );
158
161
out .write (Util .URIEncodePath (file ));
159
162
if (isDir ) {
160
163
out .write ("/\" ><b>" );
@@ -166,6 +169,7 @@ public List<String> listTo(File dir, Writer out, String path, List<String> files
166
169
out .write ("</a>" );
167
170
}
168
171
out .write ("</td>" );
172
+ Util .writeHAD (out , contextPath , path + file , isDir );
169
173
PrintDateSize (out , child , modTimes .get (file ), dateFormatter );
170
174
if (offset > 0 ) {
171
175
String briefDesc = desc .getChildTag (parentFNode , file );
0 commit comments