From 321d74eba092f307e0d990fa9b037d9ae02afce4 Mon Sep 17 00:00:00 2001 From: mandlm Date: Tue, 29 Dec 2015 21:28:07 +0100 Subject: [PATCH] Include .JPG files --- .../fotostream/server/CurrentImageNameServiceImpl.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/net/molez/mandlm/fotostream/server/CurrentImageNameServiceImpl.java b/src/net/molez/mandlm/fotostream/server/CurrentImageNameServiceImpl.java index 8a668aa..fb1cfad 100644 --- a/src/net/molez/mandlm/fotostream/server/CurrentImageNameServiceImpl.java +++ b/src/net/molez/mandlm/fotostream/server/CurrentImageNameServiceImpl.java @@ -20,12 +20,13 @@ public class CurrentImageNameServiceImpl extends RemoteServiceServlet implements { imageFiles.clear(); - File imageFolder = new File("img/"); + File imageFolder = new File("img"); File[] files = imageFolder.listFiles(); for (File imageFile : files) { - if (imageFile.isFile() && imageFile.getName().endsWith(".jpg")) + if (imageFile.isFile() && + imageFile.getName().endsWith(".jpg") || imageFile.getName().endsWith(".JPG")) { imageFiles.add(imageFile); } @@ -52,7 +53,7 @@ public class CurrentImageNameServiceImpl extends RemoteServiceServlet implements if (imageFiles.isEmpty()) { - return "img/no_image.png"; + return null; } File latestFile = imageFiles.get(imageFiles.size() - 1);