Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

23
LINES

< > BotCompany Repo | #1026065 // Migrate blobs to new file server [dev.]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Libraryless. Click here for Pure Java version (10055L/72K).

1  
!7
2  
3  
p-exp {
4  
  agiBlue_whiteListMe();
5  
  SS idToMD5 = fileServer_IDsAndMD5s();
6  
  //pnl(idToMD5);
7  
  for (File f : listFiles(newFile("/var/www/blobs"))) {
8  
    print(fileName(f));
9  
    int id = parseInt(fileName(f));
10  
    if (id == 0) continue with print("Skipping: " + f);
11  
    S md5 = idToMD5.get(str(id));
12  
    S newMD5 = fileMD5(f);
13  
    if (nempty(md5))
14  
      if (eq(md5, newMD5))
15  
        continue with print("Snippet " + id + " exists");
16  
      else
17  
        continue with print("Snippet differs? " + id);
18  
    
19  
    retry(3, r {
20  
      uploadToFileServerWithFixedID(f, snippetTitle(id), fsI(id));
21  
    });
22  
  }
23  
}

Author comment

Began life as a copy of #1026059

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1026065
Snippet name: Migrate blobs to new file server [dev.]
Eternal ID of this version: #1026065/2
Text MD5: ce0a4ade79f3fc1db8cc21d55069a9c2
Transpilation MD5: c5c553fcdc656536788531425448a21a
Author: stefan
Category: javax / networking
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-11-18 21:36:57
Source code size: 624 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 285 / 1001
Version history: 1 change(s)
Referenced in: [show references]