Issue #3319 - Fixing listing output dir slash expectation from tests

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2019-04-03 17:12:26 -05:00
parent b929f5c2db
commit 31b0de2285
1 changed files with 4 additions and 9 deletions

View File

@ -692,22 +692,17 @@ public abstract class Resource implements ResourceFactory, Closeable
{ {
name = name.substring(slashIdx + 1); name = name.substring(slashIdx + 1);
} }
if (item.isDirectory() && !name.endsWith("/"))
{
name += URIUtil.SLASH;
}
// Name // Name
buf.append("<tr><td class=\"name\"><a href=\""); buf.append("<tr><td class=\"name\"><a href=\"");
String path=URIUtil.addPaths(encodedBase,URIUtil.encodePath(name)); String path=URIUtil.addPaths(encodedBase,URIUtil.encodePath(name));
buf.append(path); buf.append(path);
if (item.isDirectory() && !path.endsWith("/"))
{
buf.append(URIUtil.SLASH);
}
buf.append("\">"); buf.append("\">");
buf.append(deTag(name)); buf.append(deTag(name));
if (item.isDirectory() && !path.endsWith("/"))
{
buf.append(URIUtil.SLASH);
}
buf.append("&nbsp;"); buf.append("&nbsp;");
buf.append("</a></td>"); buf.append("</a></td>");