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

19
LINES

< > TinyBrain | #1008031 - loadDataSnippetToFile

JavaX fragment (include)

static File loadDataSnippetToFile(S snippetID) ctex {
  File f = DiskSnippetCache_file(parseSnippetID(snippetID));
  try {
    URL url = new URL("http://eyeocr.sourceforge.net/filestore/filestore.php?cmd=serve&file=blob_"
      + parseSnippetID(snippetID) + "&contentType=application/binary");
    System.err.println("Loading library: " + 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 1 computer(s): tvejysmllsmz

No comments. add comment

Snippet ID: #1008031
Snippet name: loadDataSnippetToFile
Eternal ID of this version: #1008031/5
Text MD5: 3057ebe01c69d39e2211c6429570057d
Author: stefan
Category:
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-04-21 01:28:51
Source code size: 790 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 13 / 2
Version history: 4 change(s)
Referenced in: [show]