- core.setSoneStatus(sone, SoneStatus.inserting);
- FreenetURI finalUri = freenetInterface.insertDirectory(insertInformation.getInsertUri().setKeyType("USK").setSuggestedEdition(0), insertInformation.generateManifestEntries(), "index.html");
- sone.updateUris(finalUri.getEdition());
+ sone.setStatus(SoneStatus.inserting);
+ long insertTime = System.currentTimeMillis();
+ insertInformation.setTime(insertTime);
+ soneInsertListenerManager.fireInsertStarted();
+ FreenetURI finalUri = freenetInterface.insertDirectory(insertInformation.getInsertUri(), insertInformation.generateManifestEntries(), "index.html");
+ soneInsertListenerManager.fireInsertFinished(System.currentTimeMillis() - insertTime);
+ /* at this point we might already be stopped. */
+ if (shouldStop()) {
+ /* if so, bail out, don’t change anything. */
+ break;
+ }
+ sone.setTime(insertTime);
+ sone.setLatestEdition(finalUri.getEdition());
+ core.touchConfiguration();