@Override public Object execute() throws StorageException { return underlyingTransferManager.delete(remoteFile); } });
@Override public boolean delete(final RemoteFile remoteFile) throws StorageException { return underlyingTransferManager.delete(remoteFile); }
@Override public boolean delete(final RemoteFile remoteFile) throws StorageException { return underlyingTransferManager.delete(remoteFile); }
private void deleteActionFile(ActionRemoteFile actionFile) throws StorageException { logger.log(Level.INFO, "Deleting action file: " + actionFile); transferManager.delete(actionFile); }
/** * This method deletes the transaction file. The deletion of the transaction file is the moment the transaction * is considered to be finished and successful. */ private void deleteTransactionFile(File localTransactionFile, TransactionRemoteFile remoteTransactionFile) throws StorageException { // After this deletion, the transaction is final! logger.log(Level.INFO, "- Deleting remote transaction file {0} ...", remoteTransactionFile); transferManager.delete(remoteTransactionFile); localTransactionFile.delete(); logger.log(Level.INFO, "END of TX.commmit(): Succesfully committed transaction."); }
@Override public boolean delete(final RemoteFile remoteFile) throws StorageException { RemoteFile pathAwareRemoteFile = createPathAwareRemoteFile(remoteFile); boolean fileDeleted = underlyingTransferManager.delete(pathAwareRemoteFile); boolean folderDeleted = removeFolder(pathAwareRemoteFile); return fileDeleted && folderDeleted; }
/** * Removes temporary files on the offsite storage that are not listed in any * of the {@link TransactionRemoteFile}s available remotely. * * <p>Temporary files might be left over from unfinished transactions. */ public void removeUnreferencedTemporaryFiles() throws StorageException { // Retrieve all transactions Map<TransactionTO, TransactionRemoteFile> transactions = retrieveRemoteTransactions(); Collection<TempRemoteFile> tempRemoteFiles = list(TempRemoteFile.class).values(); // Find all remoteFiles that are referenced in a transaction Set<TempRemoteFile> tempRemoteFilesInTransactions = new HashSet<TempRemoteFile>(); for (TransactionTO transaction : transactions.keySet()) { for (ActionTO action : transaction.getActions()) { tempRemoteFilesInTransactions.add(action.getTempRemoteFile()); } } // Consider just those files that are not referenced and delete them. tempRemoteFiles.removeAll(tempRemoteFilesInTransactions); for (TempRemoteFile unreferencedTempRemoteFile : tempRemoteFiles) { logger.log(Level.INFO, "Unreferenced temporary file found. Deleting {0}", unreferencedTempRemoteFile); underlyingTransferManager.delete(unreferencedTempRemoteFile); } }
transferManager.delete(tempRemoteFile);