summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/openslx/satellitedaemon/util
diff options
context:
space:
mode:
authorSimon Rettberg2014-10-09 18:07:44 +0200
committerSimon Rettberg2014-10-09 18:07:44 +0200
commitc755bec0c80cafcc9f68f4a86d4603fdb54567a1 (patch)
tree4ecd82cfe87d365ec56fcb23a5ff995ba01aeb78 /src/main/java/org/openslx/satellitedaemon/util
parentUpdated config examples (diff)
downloadsatellite-daemon-c755bec0c80cafcc9f68f4a86d4603fdb54567a1.tar.gz
satellite-daemon-c755bec0c80cafcc9f68f4a86d4603fdb54567a1.tar.xz
satellite-daemon-c755bec0c80cafcc9f68f4a86d4603fdb54567a1.zip
Cleanup of AsymKeyHolder, Globals and Identity classes
Diffstat (limited to 'src/main/java/org/openslx/satellitedaemon/util')
-rw-r--r--src/main/java/org/openslx/satellitedaemon/util/Util.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/main/java/org/openslx/satellitedaemon/util/Util.java b/src/main/java/org/openslx/satellitedaemon/util/Util.java
index 24f9883..986ff73 100644
--- a/src/main/java/org/openslx/satellitedaemon/util/Util.java
+++ b/src/main/java/org/openslx/satellitedaemon/util/Util.java
@@ -1,5 +1,7 @@
package org.openslx.satellitedaemon.util;
+import java.io.Closeable;
+
import org.apache.log4j.Logger;
public class Util
@@ -29,7 +31,7 @@ public class Util
System.exit( 2 );
}
}
-
+
public static void notNullOrEmptyFatal( String something, String message )
{
if ( something == null || something.isEmpty() ) {
@@ -39,4 +41,17 @@ public class Util
System.exit( 2 );
}
}
+
+ public static void streamClose( Closeable... closeable )
+ {
+ for ( Closeable c : closeable ) {
+ if ( c == null )
+ continue;
+ try {
+ c.close();
+ } catch ( Throwable t ) {
+ }
+ }
+ }
+
}