path fixed

This commit is contained in:
Theophyl Hoguet committed 2023-03-13 20:33:23 +01:00
1 parent 4c3f5ee9fd
commit 532d442f2f
1 file changed
+3 -1
@@ -10,6 +10,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository
@@ -19,7 +20,8 @@ public class ImageDao implements Dao<Image> {
public ImageDao() { public ImageDao() {
try { try {
final File folder = new File("backend/src/main/resources/images"); final var folderPath = new ClassPathResource("images");
final var folder = folderPath.getFile();
getAllImages(folder); getAllImages(folder);
} catch (final Exception e) { } catch (final Exception e) {
e.printStackTrace(); e.printStackTrace();