static File loadDataSnippetToFile(S snippetID) ctex { snippetID = fsI(snippetID); File f = DiskSnippetCache_file(parseSnippetID(snippetID)); new L urlsTried; try { URL url = addAndReturn(urlsTried, new URL(dataSnippetLink(snippetID))); print("Loading library: " + hideCredentials(url)); try { loadBinaryPageToFile(openConnection(url), f); if (fileSize(f) == 0) fail(); } catch { url = addAndReturn(urlsTried, new URL("http://data.tinybrain.de/blobs/" + psI(snippetID))); print("Trying other server: " + hideCredentials(url)); loadBinaryPageToFile(openConnection(url), f); print("Got bytes: " + fileSize(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. URLs tried: " + allToString(urlsTried)); } return f; }