@Override public synchronized boolean refresh() { try { getIndex(true); return true; } catch (Exception e) { logger.error("Refreshing repository {} failed", this.getName(), e); return false; } }
@Override public synchronized boolean refresh() { try { getIndex(true); return true; } catch (Exception e) { logger.error("Refreshing repository {} failed", this.getName(), e); return false; } }
@Override public String toString() { String location; try { location = getRoot().getAbsolutePath(); } catch (Exception e) { location = config.cache(); } return String.format("%s [%-40s r/w=%s]", getName(), location, canWrite()); }
@Override public String toString() { String location; try { location = getRoot().getAbsolutePath(); } catch (Exception e) { location = config.cache(); } return String.format("%s [%-40s r/w=%s]", getName(), location, canWrite()); }
@Override public String tooltip(Object... target) throws Exception { if (target.length == 0) { try (Formatter f = new Formatter()) { if (stale) { f.format("[stale] Needs reload, see menu\n"); } f.format("Name : %s\n", getName()); f.format("Cache : %s\n", getRoot()); f.format("Max stale (secs) : %s\n", config.max_stale(YEAR)); f.format("\n" + "URLs :\n"); for (URI uri : getIndex().getURIs()) { f.format(" %s\n", uri); } return f.toString(); } } return getIndex().getBridge() .tooltip(target); }
@Override public String title(Object... target) throws Exception { if (target.length == 0 && stale) { return getName() + " [stale]"; } return getIndex().getBridge() .title(target); }
@Override public String title(Object... target) throws Exception { if (target.length == 0 && stale) { return getName() + " [stale]"; } return getIndex().getBridge() .title(target); }
@Override public String tooltip(Object... target) throws Exception { if (target.length == 0) { try (Formatter f = new Formatter()) { if (stale) { f.format("[stale] Needs reload, see menu\n"); } f.format("Name : %s\n", getName()); f.format("Cache : %s\n", getRoot()); f.format("Max stale (secs) : %s\n", config.max_stale(YEAR)); f.format("\n" + "URLs :\n"); for (URI uri : getIndex().getURIs()) { f.format(" %s\n", uri); } return f.toString(); } } return getIndex().getBridge() .tooltip(target); }