Skip to content

Commit 5ab9a5d

Browse files
committed
[bugfix] Fix alignment of output in the Java Admin Client shell
Closes #2282
1 parent 946e86e commit 5ab9a5d

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/org/exist/client/InteractiveClient.java

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -370,25 +370,23 @@ protected void getResources() throws XMLDBException {
370370

371371
final List<ResourceDescriptor> tableData = new ArrayList<ResourceDescriptor>(resources.length); // A list of ResourceDescriptor for the GUI
372372

373-
final String cols[] = new String[4];
374373
int i = 0;
375374
for (; i < childCollections.length; i++) {
376375
//child = current.getChildCollection(childCollections[i]);
377376

378377
perm = mgtService.getSubCollectionPermissions(current, childCollections[i]);
379378

379+
final Date created = mgtService.getSubCollectionCreationTime(current, childCollections[i]);
380+
380381
if ("true".equals(properties.getProperty(PERMISSIONS))) {
381-
cols[0] = perm.toString();
382-
cols[1] = getOwnerName(perm);
383-
cols[2] = getGroupName(perm);
384-
cols[3] = childCollections[i];
385-
resources[i] = 'd' + formatString(cols, colSizes);
382+
resources[i] = '-' + perm.toString() + '\t' + getOwnerName(perm)
383+
+ '\t' + getGroupName(perm) + '\t'
384+
+ created.toString() + '\t'
385+
+ childCollections[i];
386386
} else {
387387
resources[i] = childCollections[i];
388388
}
389389

390-
final Date created = mgtService.getSubCollectionCreationTime(current, childCollections[i]);
391-
392390
if (options.startGUI) {
393391
try {
394392
tableData.add(
@@ -413,17 +411,18 @@ protected void getResources() throws XMLDBException {
413411
if (perm == null) {
414412
System.out.println("null"); //TODO this is not useful!
415413
}
414+
415+
final Date lastModificationTime = ((EXistResource) res).getLastModificationTime();
416+
416417
if ("true".equals(properties.getProperty(PERMISSIONS))) {
417-
resources[i] = '-' + perm.toString() + '\t' + perm.getOwner().getName()
418-
+ '\t' + perm.getGroup().getName() + '\t'
418+
resources[i] = '-' + perm.toString() + '\t' + getOwnerName(perm)
419+
+ '\t' + getGroupName(perm) + '\t'
420+
+ lastModificationTime.toString() + '\t'
419421
+ childResources[j];
420422
} else {
421423
resources[i] = childResources[j];
422424
}
423425

424-
final Date lastModificationTime = ((EXistResource) res).getLastModificationTime();
425-
resources[i] += "\t" + lastModificationTime;
426-
427426
if (options.startGUI) {
428427
try {
429428
tableData.add(

0 commit comments

Comments
 (0)