summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satserver
diff options
context:
space:
mode:
authorSimon Rettberg2021-04-20 16:41:03 +0200
committerSimon Rettberg2021-04-20 16:41:03 +0200
commit8522c314bdb4bd87e265e1c943169c13ed9d8b0e (patch)
tree52d1066d238c6f7d09378f2db110709e37776c25 /src/main/java/org/openslx/satserver
parent[RemoteExec/RemoteReboot] switch to fork of JSch to support more key formats (diff)
downloadtmlite-bwlp-8522c314bdb4bd87e265e1c943169c13ed9d8b0e.tar.gz
tmlite-bwlp-8522c314bdb4bd87e265e1c943169c13ed9d8b0e.tar.xz
tmlite-bwlp-8522c314bdb4bd87e265e1c943169c13ed9d8b0e.zip
Add ipxe version selection, use bwlp config for ipxe
Diffstat (limited to 'src/main/java/org/openslx/satserver')
-rw-r--r--src/main/java/org/openslx/satserver/util/Util.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/org/openslx/satserver/util/Util.java b/src/main/java/org/openslx/satserver/util/Util.java
index 262fd56..2ffe261 100644
--- a/src/main/java/org/openslx/satserver/util/Util.java
+++ b/src/main/java/org/openslx/satserver/util/Util.java
@@ -118,6 +118,24 @@ public class Util
}
/**
+ * Parse the given String as a base10 long.
+ * If the string does not represent a valid long, return the given
+ * default value.
+ *
+ * @param value string representation to parse to an long
+ * @param defaultValue fallback value if given string can't be parsed
+ * @return
+ */
+ public static long parseLong( String value, long defaultValue )
+ {
+ try {
+ return Long.parseLong( value );
+ } catch ( Exception e ) {
+ return defaultValue;
+ }
+ }
+
+ /**
* Compare two strings for equality.
* null and "" are not considered equal.
*/