This commit is contained in:
@@ -382,7 +382,7 @@ public class FileUploadServiceImpl implements FileUploadService {
|
||||
}
|
||||
|
||||
private void checkForDuplicatesSynchronously(String filePath)
|
||||
throws IOException {
|
||||
throws IOException , DuplicateImageException {
|
||||
Path path = Paths.get(filePath);
|
||||
Map<String, Long> hash = imageHashService.calculateHash(path);
|
||||
|
||||
@@ -390,8 +390,8 @@ public class FileUploadServiceImpl implements FileUploadService {
|
||||
hash.get("hi"), hash.get("low"));
|
||||
|
||||
if (!duplicates.isEmpty()) {
|
||||
throw new DuplicateImageException("Duplicate", duplicates.get(0).getId(),
|
||||
duplicates.get(0).getUserId());
|
||||
throw new DuplicateImageException("Duplicate", duplicates.getFirst().getId(),
|
||||
duplicates.getFirst().getUserId());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user