本文整理汇总了Java中com.flickr4java.flickr.photos.Photo.getId方法的典型用法代码示例。如果您正苦于以下问题:Java Photo.getId方法的具体用法?Java Photo.getId怎么用?Java Photo.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.flickr4java.flickr.photos.Photo
的用法示例。
在下文中一共展示了Photo.getId方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: FlickrResultOption
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
public FlickrResultOption(Photo photo)
{
this.photo = photo;
this.value = photo.getId();
this.description = photo.getDescription();
this.disabled = false;
}
示例2: execute
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
@Override
protected void execute() {
try {
for(int i=0; i<photos.size();i++) {
Photo p = photos.get(i);
String url = "https://farm" + p.getFarm() + ".staticflickr.com/" + p.getServer()
+ "/" + p.getId() + "_" + p.getOriginalSecret() + "_o." + p
.getOriginalFormat();
downloadTempPhoto(url, p.getId() + "_o", p.getOriginalFormat());
p.setGeoData(getLocation(p.getId()));
logger.debug("Got geodata=[{},{}]", p.getGeoData().getLatitude(),p.getGeoData().getLongitude());
if (!isRunning()) {
logger.debug("Download interrupted.");
return;
}
callback.accept(p);
progressCallback.accept((double) (i + 1) / (double) photos.size());
}
progressCallback.accept(1.0);
}
catch (FlickrException | ServiceException e) {
logger.error(e.getMessage());
errorHandler.propagate(new ServiceException("Failed to download photo", e));
}
}
示例3: generateFilename
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
private String generateFilename(Photo p, int size) {
String suffix = sizes.getSuffix(size);
if (size == Size.ORIGINAL) {
return p.getId() + "_" + p.getOriginalSecret() + suffix + "." + p.getOriginalFormat();
}
else {
return p.getId() + "_" + p.getSecret() + suffix + ".jpg";
}
}
示例4: PhotoDTO
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
public PhotoDTO(Photo photo) {
this.title = photo.getTitle();
this.description = photo.getDescription();
this.url = photo.getUrl();
this.id = photo.getId();
this.ownerName = photo.getOwner().getRealName() != null ? photo.getOwner().getRealName() : photo.getOwner().getUsername();
resolveLargestSize(photo);
this.setSquareUrl(photo.getSquareSize().getSource());
}
示例5: PhotosNotInASet
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
public PhotosNotInASet(Configuration configuration, Flickr flickr) throws IOException, SAXException, FlickrException {
super(configuration);
if(configuration.limitDownloadsToSets.size() > 0) {
return;
}
Logger.getLogger(getClass()).info("Downloading list of photos that are not in a set");
int pageNum = 1;
while (true) {
PhotoList photos = flickr.getPhotosInterface().getNotInSet(500, pageNum);
if (photos.size() == 0)
break;
for (int i = 0; i < photos.size(); i++) {
Photo photo = (Photo) photos.get(i);
if (this.primaryPhotoId == null) {
this.primaryPhotoId = photo.getId();
this.primaryPhotoSmallSquareUrl = photo.getSmallSquareUrl();
}
this.photoSet.add(photo);
}
pageNum++;
}
Logger.getLogger(getClass()).info(String.format("There are a total of %s photos that are not in a set", this.photoSet.size()));
}
示例6: buildOriFlickrUrl
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
private String buildOriFlickrUrl(Photo p){
return "https://farm" + p.getFarm() + ".staticflickr.com/" + p.getServer()
+ "/" + p.getId() + "_" + p.getOriginalSecret() + "_o." + p
.getOriginalFormat();
}
示例7: buildFlickrUrl
import com.flickr4java.flickr.photos.Photo; //导入方法依赖的package包/类
private String buildFlickrUrl(Photo p){
return "https://farm" + p.getFarm() + ".staticflickr.com/" + p.getServer() + "/" + p.getId() + "_" + p.getSecret() + "_z." + p.getOriginalFormat();
}