我與play framework工作,我有我的部署應用程序的問題上playapps.net,我還沒有localy。 他在這裏的我的代碼:解析圖像目錄
public static void image(Long idCategorieProject, Long idImage)
{
CategorieProject categorieproject = CategorieProject.findById(idCategorieProject);
List<Categorie> categories = Categorie.all().fetch();
// SMALL IMAGES
List<String>smallImages = null;
try
{
File dirSmall = new File("public/images/projects/"+idCategorieProject+"/small/");
smallImages = new ArrayList();
File[] smallImageFiles = dirSmall.listFiles();
for (int i = 0; i < smallImageFiles.length; i++) {
smallImages.add(smallImageFiles[i].getName());
}
} catch (Exception e) {
System.out.println(e);
}
// FULL IMAGE
List<String>fullImages = null;
try
{
File dirSmall = new File("public/images/projects/"+idCategorieProject+"/full/");
fullImages = new ArrayList();
File[] fullImageFiles = dirSmall.listFiles();
for (int i = 0; i < fullImageFiles.length; i++) {
if (i == idImage)
fullImages.add(fullImageFiles[i].getName());
}
} catch (Exception e) {
System.out.println(e);
}
render(lang, categorieproject, categories, fullImages, smallImages);
}
Localy,我的圖片數組不爲空,我可以顯示它們,但與部署的版本,它似乎陣列爲空。有沒有另一種解析圖像目錄的解決方案?