@@ -228,20 +228,26 @@ public synchronized void storeSettings() {
228228
229229 LOGGER .info ("store settings to disk" );
230230
231+ int workspaceCount = 0 ;
232+ int archiveCount = 0 ;
231233 for ( String workspaceId : workspaces .keySet () ) {
232234 Workspace workspace = workspaces .get (workspaceId );
233235
234236 // add fields for name and last-seen
235237 properties .setProperty ( Fields .PROP_WORKSPACE_PRE + workspaceId , workspace .getName () );
236238 properties .setProperty ( Fields .PROP_LASTSEEN_PRE + workspaceId , Tools .DATE_FORMATTER .format (workspace .getLastseen ()) );
239+ workspaceCount ++;
237240
238241 // iterate over all archives
239242 for ( String archiveId : workspace .getArchives ().keySet () ) {
240243 String archiveName = workspace .getArchives ().get (archiveId );
241244 properties .setProperty ( Fields .PROP_ARCHIVE_PRE + workspaceId + Fields .PROP_SEPARATOR + archiveId , archiveName );
245+ archiveCount ++;
242246 }
243247 }
244248
249+ LOGGER .debug ("Constructed settings file with " , workspaceCount , " Workspaces and " , archiveCount , " Archives" );
250+
245251 try {
246252 // first write settings to temp file
247253 File temp = File .createTempFile ( Fields .TEMP_FILE_PREFIX , "settings.conf" );
@@ -251,13 +257,16 @@ public synchronized void storeSettings() {
251257 // flush'n'close
252258 output .flush ();
253259 output .close ();
260+ LOGGER .debug ("wrote " , temp , " (" , temp .length (), " Bytes) to disk." );
254261
255262 // create directories (just in case...)
256263 Files .createDirectories ( Fields .SETTINGS_FILE .toPath ().getParent () );
257264
258265 // replace actual settings file, with newly written one
259266 try {
267+ LOGGER .info ("Trying to move new settings file in place " , Fields .SETTINGS_FILE );
260268 Files .move ( temp .toPath (), Fields .SETTINGS_FILE .toPath (), StandardCopyOption .REPLACE_EXISTING , StandardCopyOption .ATOMIC_MOVE );
269+ LOGGER .info ("done moving." );
261270 }
262271 catch (AtomicMoveNotSupportedException e ) {
263272 LOGGER .info (e , "Atomic move of settings file failed. Fallback to normal operation." );
0 commit comments