/** * print the list of path entries * * @param lvl debug level to use */ public static void dump(int lvl) { log(lvl, "ImagePath has %d entries (valid %d)", imagePaths.size(), getCount()); String bundle = "(taken as bundle path)"; for (PathEntry p : imagePaths) { if (p == null) { log(lvl, "Path: NULL %s", bundle); } else { log(lvl, "Path: given: %s\nis: %s", p.path, p.getPath()); } bundle = ""; } }
public static boolean removeHTTP(String pathHTTP) { try { String proto = "http://"; String protos = "https://"; if (pathHTTP.startsWith(proto) || pathHTTP.startsWith(protos)) { proto = ""; } pathHTTP = FileManager.slashify(pathHTTP, false); return remove(new URL(proto + pathHTTP)); } catch (Exception ex) { log (-1, "removeHTTP: not possible: %s\n%s", pathHTTP, ex); return false; } }
log(lvl, "open: " + fname); URL furl = find(fname); if (furl != null) { br = new BufferedReader(new InputStreamReader(furl.openStream())); } catch (IOException ex) { log(-1, "open: %s", ex.getMessage()); return null; return br; } catch (IOException ex) { log(-1, "open: %s", ex.getMessage()); try { br.close(); } catch (IOException ex1) { log(-1, "open: %s", ex1.getMessage()); return null;
/** * empty path list and keep bundlePath (entry 0)<br> * Image cache is cleared completely * convenience for the scripting level * @return true */ public static boolean reset() { log(lvl, "reset"); if (imagePaths.isEmpty()) { return false; } for (PathEntry p : imagePaths) { if (p == null) { continue; } Image.purge(p.pathURL); } PathEntry bp = imagePaths.get(0); imagePaths.clear(); imagePaths.add(bp); return true; }
cls = Class.forName(klassName); } catch (ClassNotFoundException ex) { log(-1,"add: class %s not found on classpath.", klassName);
Settings.BundlePath = path.getPath(); bundlePath = path; log(lvl, "new BundlePath:\n%s", path); return true; log(-1, "setBundlePath: invalid BundlePath: %s \nusing working folder: %s", bPath, wf); if (!new File(wf).exists()) { log(-1, "setBundlePath: Fatal error: working folder does not exist --- terminating"); System.exit(1);