本文整理汇总了Java中com.flickr4java.flickr.photos.Photo.getOriginalFormat方法的典型用法代码示例。如果您正苦于以下问题:Java Photo.getOriginalFormat方法的具体用法?Java Photo.getOriginalFormat怎么用?Java Photo.getOriginalFormat使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.flickr4java.flickr.photos.Photo
的用法示例。
在下文中一共展示了Photo.getOriginalFormat方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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));
}
}
示例2: 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";
}
}
示例3: 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();
}
示例4: 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();
}