diff --git a/src/main/java/ru/soune/nocopy/controller/ApiController.java b/src/main/java/ru/soune/nocopy/controller/ApiController.java index 732b346..9aa8084 100644 --- a/src/main/java/ru/soune/nocopy/controller/ApiController.java +++ b/src/main/java/ru/soune/nocopy/controller/ApiController.java @@ -6,6 +6,7 @@ import com.vrt.fileprotection.NoCopyCheckResult; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import org.springframework.core.io.FileSystemResource; import org.springframework.core.io.Resource; import org.springframework.core.io.UrlResource; import org.springframework.data.domain.Page; @@ -338,8 +339,10 @@ public class ApiController { } - Path filePath = Paths.get(entityResponse.getProtectedFilePath()); - Resource resource = new UrlResource(filePath.toUri()); + Path filePath = Paths.get(entityResponse.getFilePath()); + Resource resource = new FileSystemResource(filePath); + +// Resource resource = new UrlResource(filePath.toUri()); if (!resource.exists()) { Map errorData = new HashMap<>();