patch prod

This commit is contained in:
jleroy
2024-05-03 13:20:02 +02:00
parent 8a455d2b26
commit 173e051af4
2 changed files with 5 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package fr.eni.enchere.bll;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.File;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Paths; import java.nio.file.Paths;
@@ -9,14 +10,9 @@ import java.nio.file.Paths;
public class FileService { public class FileService {
public boolean fileExists(String filePath) { public boolean fileExists(String filePath) {
if (Files.exists(Paths.get("src/main/resources/static"+filePath)) || Files.exists(Paths.get(filePath))){ filePath = "src/main/resources/static" + filePath;
return true; File file = new File(filePath).getAbsoluteFile();
}else{ return file.exists();
return false;
}
} }
} }
// src/main/resources/static/images/articles/12.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 KiB