public List<String> deleteUnusedFileDistributionReferences(FileDirectory fileDirectory) {
        Set<String> fileReferencesInUse = getFileReferencesInUse();
        log.log(Level.FINE, () -> "File references in use : " + fileReferencesInUse);

        List<String> toDelete = sortedUnusedFileReferences(fileDirectory.getRoot(), fileReferencesInUse);
        log.log(Level.FINE, () -> "File references not in use: " + toDelete);
        List<String> deleted = new ArrayList<>();
        toDelete.forEach(fileReference -> {
            if (fileDirectory.delete(new FileReference(fileReference), this::isFileReferenceInUse, this::isFileReferenceOld))
                deleted.add(fileReference);
        });
        log.log(Level.FINE, () -> "Deleted " + deleted.size() + " file references not in use");
        return deleted;
    }
Deletes an application and associated resources

@return true if the application was found and deleted, false if it was not present
@throws RuntimeException if deleting the application fails. This method is exception safe.
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java