Include .JPG files

This commit is contained in:
mandlm 2015-12-29 21:28:07 +01:00
parent 27c0416d8f
commit 321d74eba0

View file

@ -20,12 +20,13 @@ public class CurrentImageNameServiceImpl extends RemoteServiceServlet implements
{ {
imageFiles.clear(); imageFiles.clear();
File imageFolder = new File("img/"); File imageFolder = new File("img");
File[] files = imageFolder.listFiles(); File[] files = imageFolder.listFiles();
for (File imageFile : files) 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); imageFiles.add(imageFile);
} }
@ -52,7 +53,7 @@ public class CurrentImageNameServiceImpl extends RemoteServiceServlet implements
if (imageFiles.isEmpty()) if (imageFiles.isEmpty())
{ {
return "img/no_image.png"; return null;
} }
File latestFile = imageFiles.get(imageFiles.size() - 1); File latestFile = imageFiles.get(imageFiles.size() - 1);