@@ -9,6 +9,7 @@ import com.vrt.fileprotection.image.phash.PHash;
|
||||
import com.vrt.fileprotection.image.phash.PerceptualHashHelper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
@@ -160,6 +161,7 @@ public class FileSimilarityService {
|
||||
}
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private NoCopyFileService noCopyFileService;
|
||||
|
||||
public Page<SimilarFileDTO> findSimilarFiles(String fileId, SimilarityFilter filter, Pageable pageable,
|
||||
@@ -220,7 +222,9 @@ public class FileSimilarityService {
|
||||
for (FileEntity file : fileEntityList) {
|
||||
try {
|
||||
Path path = Paths.get(file.getFilePath());
|
||||
FileProtector.Type fileType = FileProtector.Type.valueOf(file.getMimeType().toUpperCase());
|
||||
|
||||
FileProtector.Type fileType = file.getMimeType().equals("document") ? FileProtector.Type.DOC:
|
||||
FileProtector.Type.AUDIO;
|
||||
|
||||
NoCopyCheckResult noCopyCheckResult = noCopyFileService.checkFile(path.toFile(), fileType);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user