static File loadDataSnippetToFile(S snippetID) ctex { snippetID = fsI(snippetID); File f = DiskSnippetCache_file(parseSnippetID(snippetID)); try { URL url = new URL(dataSnippetLink(snippetID)); System.err.println("Loading library: " + hideCredentials(url)); try { loadBinaryPageToFile(openConnection(url), f); if (fileSize(f) == 0) fail(); } catch { url = new URL("http://tinybrain.de/blobs/" // TODO: should be data.tinybrain.de + psI(snippetID)); loadBinaryPageToFile(openConnection(url), f); } // TODO: check if we hit the "LOADING" message if (fileSize(f) == 0) fail(); System.err.println("Bytes loaded: " + fileSize(f)); } catch e { printStackTrace(e); fail("Binary snippet " + snippetID + " not found or not public"); } return f; }