|
@@ -67,8 +67,7 @@ class Ls extends FsCommand {
|
|
|
protected static final SimpleDateFormat dateFormat =
|
|
|
new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
|
|
|
|
|
- protected int maxPerm = 9, maxRepl = 3, maxLen = 10, maxOwner = 0,
|
|
|
- maxGroup = 0;
|
|
|
+ protected int maxRepl = 3, maxLen = 10, maxOwner = 0, maxGroup = 0;
|
|
|
protected String lineFormat;
|
|
|
protected boolean dirRecurse;
|
|
|
|
|
@@ -117,7 +116,7 @@ class Ls extends FsCommand {
|
|
|
FileStatus stat = item.stat;
|
|
|
String line = String.format(lineFormat,
|
|
|
(stat.isDirectory() ? "d" : "-"),
|
|
|
- stat.getPermission() + (hasAcl(item) ? "+" : ""),
|
|
|
+ stat.getPermission() + (hasAcl(item) ? "+" : " "),
|
|
|
(stat.isFile() ? stat.getReplication() : "-"),
|
|
|
stat.getOwner(),
|
|
|
stat.getGroup(),
|
|
@@ -135,7 +134,6 @@ class Ls extends FsCommand {
|
|
|
private void adjustColumnWidths(PathData items[]) {
|
|
|
for (PathData item : items) {
|
|
|
FileStatus stat = item.stat;
|
|
|
- maxPerm = maxLength(maxPerm, stat.getPermission());
|
|
|
maxRepl = maxLength(maxRepl, stat.getReplication());
|
|
|
maxLen = maxLength(maxLen, stat.getLen());
|
|
|
maxOwner = maxLength(maxOwner, stat.getOwner());
|
|
@@ -143,7 +141,7 @@ class Ls extends FsCommand {
|
|
|
}
|
|
|
|
|
|
StringBuilder fmt = new StringBuilder();
|
|
|
- fmt.append("%s%-" + maxPerm + "s "); // permission string
|
|
|
+ fmt.append("%s%s"); // permission string
|
|
|
fmt.append("%" + maxRepl + "s ");
|
|
|
// Do not use '%-0s' as a formatting conversion, since it will throw a
|
|
|
// a MissingFormatWidthException if it is used in String.format().
|