NCBACK-25 add protection for audio and use hash method from library
Test Workflow / test (push) Successful in 3s
Test Workflow / test (push) Successful in 3s
This commit is contained in:
@@ -12,7 +12,6 @@ import ru.soune.nocopy.dto.BaseResponse;
|
||||
import ru.soune.nocopy.dto.MessageCode;
|
||||
import ru.soune.nocopy.dto.file.YandexSearchResponse;
|
||||
import ru.soune.nocopy.entity.file.FileEntity;
|
||||
import ru.soune.nocopy.exception.FileEntityNotFoundException;
|
||||
import ru.soune.nocopy.exception.NotValidFieldException;
|
||||
import ru.soune.nocopy.repository.FileEntityRepository;
|
||||
|
||||
|
||||
@@ -50,20 +50,4 @@ public class FileProcessingOrchestrator {
|
||||
noCopyFileService.addFile(fileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private FileProtector.Type determineFileType(String mimeType) {
|
||||
if (mimeType == null) {
|
||||
return FileProtector.Type.IMAGE;
|
||||
}
|
||||
|
||||
if (mimeType.startsWith("image")) {
|
||||
return FileProtector.Type.IMAGE;
|
||||
} else if (mimeType.startsWith("video")) {
|
||||
return FileProtector.Type.VIDEO;
|
||||
} else if (mimeType.startsWith("audio")) {
|
||||
return FileProtector.Type.AUDIO;
|
||||
} else {
|
||||
return FileProtector.Type.IMAGE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user