|
@@ -20,6 +20,7 @@ import java.nio.channels.FileChannel;
|
|
|
import java.nio.channels.WritableByteChannel;
|
|
import java.nio.channels.WritableByteChannel;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.nio.file.Files;
|
|
import java.nio.file.Files;
|
|
|
|
|
+import java.nio.file.Path;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
import java.util.UUID;
|
|
import java.util.UUID;
|
|
@@ -235,7 +236,7 @@ public class ObjectBasicService {
|
|
|
OutputStream outputStream = response.getOutputStream();
|
|
OutputStream outputStream = response.getOutputStream();
|
|
|
RandomAccessFile raf;
|
|
RandomAccessFile raf;
|
|
|
String cachePath = localCache.getCache(objectId);
|
|
String cachePath = localCache.getCache(objectId);
|
|
|
- if (cachePath != null) {
|
|
|
|
|
|
|
+ if (cachePath != null && Files.exists(Path.of(cachePath))) {
|
|
|
raf = new RandomAccessFile(cachePath, "r");
|
|
raf = new RandomAccessFile(cachePath, "r");
|
|
|
} else {
|
|
} else {
|
|
|
List<DataBlock> list = dataBlockMapper.findByObjectId(objectId);
|
|
List<DataBlock> list = dataBlockMapper.findByObjectId(objectId);
|