Console: Add build date to version info

This commit is contained in:
zzz
2023-01-26 09:23:50 -05:00
parent 2dfe05d682
commit 33a07f811e
2 changed files with 27 additions and 7 deletions

View File

@@ -23,6 +23,9 @@ import net.i2p.util.UIMessages;
public class LogsHelper extends HelperBase {
// cache so we only load once
Attributes att;
private static final String _jstlVersion = jstlVersion();
private static final int MAX_WRAPPER_LINES = 250;
@@ -206,23 +209,39 @@ public class LogsHelper extends HelperBase {
rv[2] = DataHelper.escapeHTML(f.getName()).replace(" ", "%20");
return rv;
}
/**
* @since 0.9.35
*/
public String getBuiltBy() {
File libDir = _context.getLibDir();
File f = new File(libDir, "i2p.jar");
Attributes att = FileDumpHelper.attributes(f);
return getAtt("Built-By");
}
/**
* @since 0.9.58
*/
public String getBuildDate() {
return getAtt("Build-Date");
}
/**
* @since 0.9.58 pulled out from above
*/
private String getAtt(String a) {
if (att == null) {
File libDir = _context.getLibDir();
File f = new File(libDir, "i2p.jar");
att = FileDumpHelper.attributes(f);
}
if (att != null) {
String s = FileDumpHelper.getAtt(att, "Built-By");
String s = FileDumpHelper.getAtt(att, a);
if (s != null) {
return s;
}
}
return "Undefined";
}
private final static String NL = System.getProperty("line.separator");
/** formats in forward order */