chore(refactor): remove a bunch of compilation warning and remove deprecated StorageInterface method

This commit is contained in:
Ludovic DEHON
2024-01-11 10:42:51 +01:00
parent b0a805e8e0
commit 1e1785db7e
22 changed files with 87 additions and 150 deletions

View File

@@ -10,7 +10,6 @@ import java.io.*;
import java.net.URI;
import java.nio.file.*;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileTime;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
@@ -96,28 +95,6 @@ public class LocalStorage implements StorageInterface {
}
}
@Override
public Long size(String tenantId, URI uri) throws IOException {
try {
return Files.size(getPath(tenantId, uri));
} catch (NoSuchFileException e) {
throw new FileNotFoundException("Unable to find file at '" + uri + "'");
} catch (IOException e) {
throw new IOException("Unable to find file at '" + uri + "' with message '" + e.getMessage() + "'");
}
}
@Override
public Long lastModifiedTime(String tenantId, URI uri) throws IOException {
FileTime lastModifiedTime;
try {
lastModifiedTime = Files.getLastModifiedTime(getPath(tenantId, uri));
} catch (NoSuchFileException e) {
throw new FileNotFoundException(e.getMessage());
}
return lastModifiedTime.toMillis();
}
@Override
public URI put(String tenantId, URI uri, InputStream data) throws IOException {
File file = getPath(tenantId, uri).toFile();