当前位置: 首页>>代码示例>>Java>>正文


Java Photoset类代码示例

本文整理汇总了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;
}
 
开发者ID:sapka12,项目名称:mosaicmaker,代码行数:20,代码来源:FlickrCrawler.java

示例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;
}
 
开发者ID:masneyb,项目名称:flickrdownload,代码行数:21,代码来源:Sets.java

示例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;
}
 
开发者ID:entercritical,项目名称:SwanFlickrUploader,代码行数:24,代码来源:Upload.java

示例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;
}
 
开发者ID:sapka12,项目名称:mosaicmaker,代码行数:11,代码来源:FlickrCrawler.java

示例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;
}
 
开发者ID:openimaj,项目名称:openimaj,代码行数:15,代码来源:FlickrWebpageImageCollection.java

示例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;
}
 
开发者ID:masneyb,项目名称:flickrdownload,代码行数:36,代码来源:Collections.java

示例7: Set

import com.flickr4java.flickr.photosets.Photoset; //导入依赖的package包/类
public Set(Configuration configuration, Photoset set) {
	super(configuration);
	this.set = set;
}
 
开发者ID:masneyb,项目名称:flickrdownload,代码行数:5,代码来源:Set.java


注:本文中的com.flickr4java.flickr.photosets.Photoset类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。