72
72
import java .nio .file .Files ;
73
73
import java .nio .file .Path ;
74
74
import java .nio .file .Paths ;
75
- import java .text .DateFormat ;
76
- import java .time .format .DateTimeFormatter ;
77
75
import java .util .*;
78
76
import java .util .List ;
79
77
import java .util .concurrent .*;
83
81
import java .util .stream .Collectors ;
84
82
85
83
import static java .nio .charset .StandardCharsets .UTF_8 ;
86
- import static java . time . ZoneOffset . UTC ;
84
+ import static org . exist . client . InteractiveClient . DATE_TIME_FORMATTER ;
87
85
import static org .exist .util .FileUtils .humanSize ;
88
86
89
87
/**
@@ -93,15 +91,15 @@ public class ClientFrame extends JFrame implements WindowFocusListener, KeyListe
93
91
94
92
private static final long serialVersionUID = 1L ;
95
93
96
- public final static String CUT = Messages .getString ("ClientFrame.0" ); //$NON-NLS-1$
97
- public final static String COPY = Messages .getString ("ClientFrame.1" ); //$NON-NLS-1$
98
- public final static String PASTE = Messages .getString ("ClientFrame.2" ); //$NON-NLS-1$
94
+ public static final String CUT = Messages .getString ("ClientFrame.0" ); //$NON-NLS-1$
95
+ public static final String COPY = Messages .getString ("ClientFrame.1" ); //$NON-NLS-1$
96
+ public static final String PASTE = Messages .getString ("ClientFrame.2" ); //$NON-NLS-1$
99
97
100
- public final static int MAX_DISPLAY_LENGTH = 512000 ;
101
- public final static int MAX_HISTORY = 50 ;
98
+ public static final int MAX_DISPLAY_LENGTH = 512000 ;
99
+ public static final int MAX_HISTORY = 50 ;
102
100
103
- private final static SimpleAttributeSet promptAttrs = new SimpleAttributeSet ();
104
- private final static SimpleAttributeSet defaultAttrs = new SimpleAttributeSet ();
101
+ private static final SimpleAttributeSet promptAttrs = new SimpleAttributeSet ();
102
+ private static final SimpleAttributeSet defaultAttrs = new SimpleAttributeSet ();
105
103
static {
106
104
StyleConstants .setForeground (promptAttrs , Color .blue );
107
105
StyleConstants .setBold (promptAttrs , true );
@@ -742,12 +740,6 @@ private void removeAction(final ActionEvent ev) {
742
740
}
743
741
}
744
742
745
- try {
746
- removeRootCollection .close ();
747
- } catch (final XMLDBException e ) {
748
- showErrorMessage (e .getMessage (), e );
749
- }
750
-
751
743
ClientAction .call (client ::getResources , e -> showErrorMessage (e .getMessage (), e ));
752
744
};
753
745
client .newClientThread ("remove" , removeTask ).start ();
@@ -1262,8 +1254,6 @@ private void setPermAction(final ActionEvent ev) throws PermissionDeniedExceptio
1262
1254
ModeDisplay mode = null ;
1263
1255
SimpleACLPermissionAider acl = null ;
1264
1256
1265
- final DateFormat dateTimeFormat = DateFormat .getDateTimeInstance ();
1266
-
1267
1257
final List <ResourceDescriptor > selected = new ArrayList <>();
1268
1258
1269
1259
boolean firstPerm = true ;
@@ -1283,7 +1273,7 @@ private void setPermAction(final ActionEvent ev) throws PermissionDeniedExceptio
1283
1273
1284
1274
if (selectedRow .isCollection ()) {
1285
1275
final Collection coll = collection .getChildCollection (thisName .toString ());
1286
- thisCreated = dateTimeFormat .format (coll .getCreationTime ());
1276
+ thisCreated = DATE_TIME_FORMATTER .format (coll .getCreationTime ());
1287
1277
thisModified = NON_APPLICABLE ;
1288
1278
thisMimeType = COLLECTION_MIME_TYPE ;
1289
1279
thisMessageDigestType = NON_APPLICABLE ;
@@ -1292,8 +1282,8 @@ private void setPermAction(final ActionEvent ev) throws PermissionDeniedExceptio
1292
1282
thisPerm = service .getPermissions (coll );
1293
1283
} else {
1294
1284
final Resource res = collection .getResource (thisName .toString ());
1295
- thisCreated = dateTimeFormat .format (res .getCreationTime ());
1296
- thisModified = dateTimeFormat .format (res .getLastModificationTime ());
1285
+ thisCreated = DATE_TIME_FORMATTER .format (res .getCreationTime ());
1286
+ thisModified = DATE_TIME_FORMATTER .format (res .getLastModificationTime ());
1297
1287
thisMimeType = ((EXistResource ) res ).getMimeType ();
1298
1288
if (res instanceof EXistBinaryResource ) {
1299
1289
final MessageDigest messageDigest = ((EXistBinaryResource ) res ).getContentDigest (DigestType .BLAKE_256 );
@@ -1596,8 +1586,6 @@ static class ResourceTableModel extends AbstractTableModel {
1596
1586
1597
1587
private List <ResourceDescriptor > rows = null ;
1598
1588
1599
- private DateTimeFormatter dateFormat = DateTimeFormatter .ofPattern ("yyyy-MM-dd HH:mm:ss" ).withZone (UTC );
1600
-
1601
1589
public void setData (final List <ResourceDescriptor > rows ) {
1602
1590
rows .sort (new ResourceComparator ());
1603
1591
this .rows = rows ;
@@ -1651,7 +1639,7 @@ public Object getValueAt(final int rowIndex, final int columnIndex) {
1651
1639
case 0 :
1652
1640
return row .getName ().toString ();
1653
1641
case 1 :
1654
- return dateFormat .format (row .getInstant ());
1642
+ return DATE_TIME_FORMATTER .format (row .getInstant ());
1655
1643
case 2 :
1656
1644
return row .getOwner ();
1657
1645
case 3 :
0 commit comments