protected static File[] requestAll(ResourceHandle[] handles) throws Exception { File[] result; if (handles == null) result = new File[0]; else { result = new File[handles.length]; for (int i = 0; i < result.length; i++) { result[i] = handles[i].request(); } } return result; }
protected static File[] requestAll(ResourceHandle[] handles) throws Exception { File[] result; if (handles == null) result = new File[0]; else { result = new File[handles.length]; for (int i = 0; i < result.length; i++) { result[i] = handles[i].request(); } } return result; }
protected static File[] requestAll(ResourceHandle[] handles) throws IOException { File[] result = (handles == null) ? new File[0] : new File[handles.length]; for (int i = 0; i < result.length; i++) { result[i] = handles[i].request(); } return result; }
public File get(String bsn, String range, Strategy strategy, Map<String, String> properties) throws Exception { ResourceHandle handle = getHandle(bsn, range, strategy, properties); return handle != null ? handle.request() : null; }
public File get(String bsn, String range, Strategy strategy, Map<String, String> properties) throws Exception { ResourceHandle handle = getHandle(bsn, range, strategy, properties); return handle != null ? handle.request() : null; }
public File get(String bsn, String range, Strategy strategy, Map<String, String> properties) throws Exception { ResourceHandle handle = getHandle(bsn, range, strategy, properties); return handle != null ? handle.request() : null; }
@Override public String tooltip(Object... target) throws Exception { if (target == null || target.length == 0) return "LocalIndexedRepo @ " + getLocation(); if (target.length == 2) { ResourceHandle h = getHandle(target); if (h == null) { regenerateAllIndexes(); refresh(); return null; } if (h.getLocation() == Location.remote) { return h.getName() + " (remote, not yet cached)"; } return h.request() .getAbsolutePath() + "\n" + SHA1.digest(h.request()) .asHex() + "\n" + h.getLocation(); } return null; }
@Override public String tooltip(Object... target) throws Exception { if (target == null || target.length == 0) return "LocalIndexedRepo @ " + getLocation(); if (target.length == 2) { ResourceHandle h = getHandle(target); if (h == null) { regenerateAllIndexes(); refresh(); return null; } if (h.getLocation() == Location.remote) { return h.getName() + " (remote, not yet cached)"; } return h.request() .getAbsolutePath() + "\n" + SHA1.digest(h.request()) .asHex() + "\n" + h.getLocation(); } return null; }
/** * This can be optimized to use the download technique with the listeners. * Now just a quick hack to make it work. I actually think these classes * should extend FileRepo. TODO */ @Override public File get(String bsn, Version version, Map<String, String> properties, DownloadListener... listeners) throws Exception { init(); String versionStr; if (version != null) versionStr = version.toString(); else versionStr = properties.get(PROP_VERSION_KEY); ResourceHandle handle = resolveBundle(bsn, versionStr, Strategy.EXACT, properties); if (handle == null) return null; File f = handle.request(); if (f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { error("Download listener for %s: %s", f, e); } } return f; }
/** * This can be optimized to use the download technique with the listeners. * Now just a quick hack to make it work. I actually think these classes * should extend FileRepo. TODO */ @Override public File get(String bsn, Version version, Map<String, String> properties, DownloadListener... listeners) throws Exception { init(); String versionStr; if (version != null) versionStr = version.toString(); else versionStr = properties.get(PROP_VERSION_KEY); ResourceHandle handle = resolveBundle(bsn, versionStr, Strategy.EXACT, properties); if (handle == null) return null; File f = handle.request(); if (f == null) return null; for (DownloadListener l : listeners) { try { l.success(f); } catch (Exception e) { error("Download listener for %s: %s", f, e); } } return f; }