예제 #1
0
파일: Main.java 프로젝트: damacode/MyTumblr
 private static void handleNonDownloadPost(Post post) {
   for (Picture picture : post.pictures) {
     if (!Main.pic_pic_hash.containsKey(picture)) {
       Main.pic_pic_hash.put(picture, picture);
       Main.pic_post_hash.put(picture, post);
     } else {
       if (!post.equals(Main.pic_post_hash.get(picture))) {
         dup_post_list.put(post, Main.pic_post_hash.get(picture));
       }
     }
   }
 }
예제 #2
0
파일: Main.java 프로젝트: damacode/MyTumblr
 private static void handlePost(Post post) {
   Main.post_post_hash.put(post, post);
   for (Picture picture : post.pictures) {
     Helper.downloadFileFromURLToFileInTemp(picture.thumb_url, picture.thumb_name);
     picture.md5_id = Helper.createMD5FromFileInTemp(picture.thumb_name);
     Helper.moveTempImageToStore(picture.thumb_name, new File(Main.blogdir, picture.md5_id));
     if (!Main.pic_pic_hash.containsKey(picture)) {
       Main.pic_pic_hash.put(picture, picture);
       Main.pic_post_hash.put(picture, post);
       Helper.downloadFileFromURLToFileInTemp(picture.media_url, picture.media_name);
       Helper.moveTempImageToStore(picture.media_name, new File(Main.blogdir, picture.md5_id));
     } else {
       if (!post.equals(Main.pic_post_hash.get(picture))) {
         dup_post_list.put(post, Main.pic_post_hash.get(picture));
       }
     }
   }
 }