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

18
LINES

< > TinyBrain | #1008031 - loadDataSnippetToFile

JavaX fragment (include)

static File loadDataSnippetToFile(S snippetID) ctex {
  File f = DiskSnippetCache_file(parseSnippetID(snippetID));
  try {
    URL url = new URL(dataSnippetLink(snippetID));
    System.err.println("Loading library: " + hideCredentials(url));
    try {
      loadBinaryPageToFile(url.openConnection(), f);
    } catch {
      url = new URL("http://data.tinybrain.de/blobs/"
        + parseSnippetID(snippetID));
      loadBinaryPageToFile(url.openConnection(), f);
    }
    System.err.println("Bytes loaded: " + fileSize(f));
  } catch (FileNotFoundException e) {
    throw new IOException("Binary snippet #" + snippetID + " not found or not public");
  }
  return f;
}

Author comment

Began life as a copy of #1000675

download  show line numbers  debug dex   

Travelled to 2 computer(s): cfunsshuasjs, tvejysmllsmz

No comments. add comment

Snippet ID: #1008031
Snippet name: loadDataSnippetToFile
Eternal ID of this version: #1008031/7
Text MD5: c3a04f027b2a1b6fbec5804e739904bf
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-06-10 14:38:34
Source code size: 686 bytes / 18 lines
Pitched / IR pitched: No / No
Views / Downloads: 28 / 18
Version history: 6 change(s)
Referenced in: [show]