@Test public void closeQuietlyClosesResourceAndSwallowsException() throws Exception { Closeable<Exception> closeable = mock(Closeable.class); Mockito.doThrow(new Exception("test exception")).when(closeable).close(); LDFusionToolUtils.closeQuietly(closeable); Mockito.verify(closeable).close(); }
public static <E extends Exception> void closeQuietly(Closeable<E> resource) { if (resource != null) { try { resource.close(); } catch (Exception ignore) { } } }
LDFusionToolUtils { public static <E extends Exception> void closeQuietly(Closeable<E> resource) { if (resource != null) { try { resource.close(); } catch (Exception ignore) { } } } }
LDFusionToolUtils { public static <E extends Exception> void closeQuietly(Closeable<E> resource) { if (resource != null) { try { resource.close(); } catch (Exception ignore) { } } } private  LDFusionToolUtils(); }
LDFusionToolUtils { public static <E extends Exception> void closeQuietly(Closeable<E> resource) { if (resource != null) { try { resource.close(); } catch (Exception ignore) { } } } private  LDFusionToolUtils(); static String humanReadableSize(long byteCount); static String formatTime(long timeInMs); static File ensureParentsExists(File file); static String getVirtuosoConnectionString(String host, String port); static RDFFormat getSesameSerializationFormat(String serializationFormat, String fileName); static File createTempFile(File directory, String filePrefix); static void closeQuietly(Closeable<E> resource); static Set<URI> getResourceDescriptionProperties(ConfigConflictResolution config); static String buildPrefixDecl(Map<String, String> prefixes); }
LDFusionToolUtils { public static <E extends Exception> void closeQuietly(Closeable<E> resource) { if (resource != null) { try { resource.close(); } catch (Exception ignore) { } } } private  LDFusionToolUtils(); static String humanReadableSize(long byteCount); static String formatTime(long timeInMs); static File ensureParentsExists(File file); static String getVirtuosoConnectionString(String host, String port); static RDFFormat getSesameSerializationFormat(String serializationFormat, String fileName); static File createTempFile(File directory, String filePrefix); static void closeQuietly(Closeable<E> resource); static Set<URI> getResourceDescriptionProperties(ConfigConflictResolution config); static String buildPrefixDecl(Map<String, String> prefixes); static final int KB_BYTES; static final long MB_BYTES; static final long GB_BYTES; }