Esempio n. 1
0
 public List<String> getRaceDriverNames() {
   List<String> names = new ArrayList<String>();
   for (RaceDriver driver : getRaceDrivers()) {
     names.add(driver.getName());
   }
   return names;
 }
Esempio n. 2
0
 public ImplRaceDriverService() throws IOException, ServiceException {
   drivers = new ArrayList<RaceDriver>();
   Query myQuery = new Query(feedURL);
   myQuery.setStringCustomParameter("kind", "photo");
   myQuery.setStringCustomParameter("tag", "Driver");
   AlbumFeed feed = picasawebService.query(myQuery, AlbumFeed.class);
   for (PhotoEntry photo : feed.getPhotoEntries()) {
     RaceDriver driver = new RaceDriver();
     driver.setName(photo.getDescription().getPlainText());
     driver.setUrl(photo.getMediaContents().get(0).getUrl());
     Query tagQuery =
         new Query(
             new URL(
                 "https://picasaweb.google.com/data/feed/api/user/107302466601293793664/albumid/"
                     + photo.getAlbumId()
                     + "/photoid/"
                     + photo.getGphotoId()
                     + "?kind=tag"));
     AlbumFeed tags = picasawebService.query(tagQuery, AlbumFeed.class);
     for (TagEntry tag : tags.getTagEntries()) {
       if (tag.getTitle().getPlainText().startsWith("wiki:")) {
         driver.setWikiUrl(tag.getTitle().getPlainText().substring(5));
       }
     }
     drivers.add(driver);
   }
 }