图片的查找
这是在xml里面先找,然后再去文件夹里面找
public boolean deleteXml(String uuid) {
Document dom = Dom4jFactory.getDocument();
// Element e = (Element) dom.selectSingleNode("//photos//photo[@uuid='"+uuid.trim()+"']");
Element e = (Element) dom.selectSingleNode("//photos//photo[@uuid='" + uuid.trim() + "']");
return e.getParent().remove(e);
}
public PhotoModel getSingleByUuid(String uuid) {
List<PhotoModel> photos = getAll();
for (PhotoModel photo : photos) {
if (photo.getUuid().equals(uuid)) {
return photo;
}
}
return null;
}