本文整理汇总了Java中com.flickr4java.flickr.photosets.Photoset类的典型用法代码示例。如果您正苦于以下问题:Java Photoset类的具体用法?Java Photoset怎么用?Java Photoset使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Photoset类属于com.flickr4java.flickr.photosets包,在下文中一共展示了Photoset类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: findAllPictureId
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
private Set<String> findAllPictureId(int year) throws FlickrException {
PhotosetsInterface photosetsInterface = flickrFactory.getFlickr().getPhotosetsInterface();
Collection<Photoset> photosets = photosetsInterface.getList(flickrFactory.getUserId()).getPhotosets();
Set<String> ids = new HashSet<>();
int counter = 0;
for (Photoset photoset : photosets) {
counter++;
if (!photoset.getTitle().contains(year + "")) {
continue;
}
LOGGER.info("PHOTOSET[{}]: {}/{}", photoset.getTitle(), counter, photosets.size());
ids.addAll(idsFromPhotoset(photoset));
}
return ids;
}
示例2: getSets
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
public List<AbstractSet> getSets() throws FlickrException, IOException, SAXException {
if (this.sets != null)
return this.sets;
Logger.getLogger(Sets.class).info("Downloading photo set information");
List<AbstractSet> setMap = new LinkedList<AbstractSet>();
Iterator<Photoset> fsets = this.flickr.getPhotosetsInterface().getList(this.configuration.photosUser.getId()).getPhotosets().iterator();
while (fsets.hasNext()) {
Photoset fset = fsets.next();
AbstractSet s = new Set(this.configuration, fset);
setMap.add(s);
}
PhotosNotInASet photosNotInSet = new PhotosNotInASet(this.configuration, this.flickr);
if (photosNotInSet.getMediaCount() > 0)
setMap.add(photosNotInSet);
return setMap;
}
示例3: findPhotoset
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
private Photoset findPhotoset(String name) {
if (name == null)
return null;
Photosets photosets = null;
try {
photosets = flickr.getPhotosetsInterface().getList(nsid);
Iterator<Photoset> sets = photosets.getPhotosets().iterator();
while (sets.hasNext()) {
Photoset set = sets.next();
if (set.getTitle().equals(name)) {
return set;
}
}
} catch (FlickrException e1) {
e1.printStackTrace();
}
return null;
}
示例4: idsFromPhotoset
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
private Collection<String> idsFromPhotoset(Photoset photoset) throws FlickrException {
PhotoList<Photo> photos = flickrFactory.getFlickr().getPhotosetsInterface().getPhotos(photoset.getId(), photoset.getPhotoCount(), 1);
Set<String> ids = new HashSet<>();
photos.stream().forEach((photo) -> {
ids.add(photo.getId());
});
return ids;
}
示例5: flickrProcess
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
@Override
protected PhotoList<Photo> flickrProcess(String path) {
try {
final PhotosetsInterface setsInterface = flickr.getPhotosetsInterface();
final Matcher matcher = r.matcher(path);
matcher.find();
final String setId = matcher.group(1);
final Photoset set = setsInterface.getInfo(setId);
return setsInterface.getPhotos(setId, set.getPhotoCount(), 0);
} catch (final Exception e) {
e.printStackTrace();
}
return null;
}
示例6: createTopLevelXml
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
public Element createTopLevelXml() throws FlickrException, SAXException, IOException {
CollectionsInterface collectionsInterface = this.flickr.getCollectionsInterface();
File iconsDir = new File(this.configuration.photosBaseDirectory, COLLECTIONS_ICON_DIRECTORY);
iconsDir.mkdir();
Element allCollections = new Element("collections");
for (Collection collection : collectionsInterface.getTree(null, null)) {
Element setsEle = new Element("sets");
for (Photoset set : collection.getPhotosets()) {
setsEle.addContent(new Element("set")
.setAttribute("id", set.getId())
.setAttribute("title", set.getTitle()));
}
String iconLarge = collection.getIconLarge();
String iconSmall = collection.getIconSmall();
if(!iconLarge.matches("^https://.*")) iconLarge = "https://www.flickr.com" + iconLarge;
if(!iconSmall.matches("^https://.*")) iconSmall = "https://www.flickr.com" + iconSmall;
File largeFile = new File(iconsDir, collection.getId() + "-large." + (iconLarge.matches(".*jpg$") ? "jpg" : "gif"));
File smallFile = new File(iconsDir, collection.getId() + "-small." + (iconSmall.matches(".*jpg$") ? "jpg" : "gif"));
allCollections.addContent(new Element("collection")
.addContent(new Element("id").setText(collection.getId()))
.addContent(new Element("title").setText(collection.getTitle()))
.addContent(new Element("description").setText(collection.getDescription()))
.addContent(XmlUtils.downloadMediaAndCreateElement("iconLarge", largeFile, iconsDir.getName() + File.separator + largeFile.getName(), iconLarge, this.configuration.downloadCollectionIcons, configuration))
.addContent(XmlUtils.downloadMediaAndCreateElement("iconSmall", smallFile, iconsDir.getName() + File.separator + smallFile.getName(), iconSmall, this.configuration.downloadCollectionIcons, configuration))
.addContent(setsEle));
}
return allCollections;
}
示例7: Set
import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
public Set(Configuration configuration, Photoset set) {
super(configuration);
this.set = set;
}