diff options
author | Simon Rettberg | 2014-10-09 18:07:44 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-10-09 18:07:44 +0200 |
commit | c755bec0c80cafcc9f68f4a86d4603fdb54567a1 (patch) | |
tree | 4ecd82cfe87d365ec56fcb23a5ff995ba01aeb78 /src/main/java/org/openslx/satellitedaemon/util | |
parent | Updated config examples (diff) | |
download | satellite-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.java | 17 |
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 ) { + } + } + } + } |