/** * @since 0.9.34 */ private String toTime(String action, String arg, Service serv) { String rv = toString(action, arg, serv); if (rv != null && rv.length() > 0) { try { long l = Long.parseLong(rv); rv = DataHelper.formatDuration2(l * 1000); } catch (NumberFormatException nfe) {} } return rv; }
long expires = ts.getDate() - now; if (expires > 0) buf.append(" expires in:</b> ").append(DataHelper.formatDuration2(expires)).append(" with "); else buf.append(" expired:</b> ").append(DataHelper.formatDuration2(0 - expires)).append(" ago with "); buf.append(size).append('/').append(ts.getOriginalSize()).append(" tags remaining</li>"); totalSets += sets.size(); buf.append("<tr class=\"debug_outboundtarget\"><td><div class=\"debug_targetinfo\"><b>Target public key:</b> ").append(toString(sess.getTarget())).append("<br>" + "<b>Established:</b> ").append(DataHelper.formatDuration2(now - sess.getEstablishedDate())).append(" ago<br>" + "<b>Ack Received?</b> ").append(sess.getAckReceived()).append("<br>" + "<b>Last Used:</b> ").append(DataHelper.formatDuration2(now - sess.getLastUsedDate())).append(" ago<br>" + "<b>Session key:</b> ").append(sess.getCurrentKey().toBase64()).append("</div></td>" + "<td><b># Sets:</b> ").append(sess.getTagSets().size()).append("</td></tr>" + total += size; buf.append("<li><b>ID: ").append(ts.getID()) .append(" Sent:</b> ").append(DataHelper.formatDuration2(now - ts.getDate())).append(" ago with "); buf.append(size).append('/').append(ts.getOriginalSize()).append(" tags remaining; acked? ").append(ts.getAcked()).append("</li>");
String subj = cert.getIssuerX500Principal().toString(); l.logAlways(Log.WARN, "Certificate \"" + subj + "\" in key store " + location + " will expire in " + DataHelper.formatDuration2(expiresIn).replace(" ", " ") + "\nYou should renew the certificate soon." +
out.write(">"); if (times[i] > 0) out.write(DataHelper.formatDuration2(times[i] * 1000)); else out.write(_t("Never"));
int id = _messages.addMessageNoEscape(_t("Adding torrents in {0}", DataHelper.formatDuration2(delay))); try { Thread.sleep(delay); } catch (InterruptedException ie) {}
out.write(DataHelper.formatDuration2(Math.max(remainingSeconds, 10) * 1000)); // (eta 6h) out.write("</td>\n\t"); out.write("<td align=\"right\" class=\"snarkTorrentDownloaded\">");
changed = true; _config.setProperty(PROP_STARTUP_DELAY, Integer.toString(minutes)); addMessageNoEscape(_t("Startup delay changed to {0}", DataHelper.formatDuration2(minutes * (60L * 1000)))); _config.setProperty(PROP_REFRESH_DELAY, Integer.toString(secs)); if (secs >= 0) addMessageNoEscape(_t("Refresh time changed to {0}", DataHelper.formatDuration2(secs * 1000))); else addMessage(_t("Refresh disabled"));
long time = RouterManager.getShutdownTimeRemaining(_context); if (time > 5000) { status = _t("Shutdown in {0}", DataHelper.formatDuration2(time).replace(" ", " ")); } else { status = _t("Shutdown imminent");