- Sort Score
- Result 10 results
- Languages All
Results 1 - 9 of 9 for CloseableUtil (0.41 sec)
-
src/main/java/org/codelibs/core/io/CloseableUtil.java
/** * Utility class for {@link Closeable} operations. * * @author koichik */ public abstract class CloseableUtil { /** * Do not instantiate. */ protected CloseableUtil() { } private static final Logger logger = Logger.getLogger(CloseableUtil.class); /** * Closes a {@link Closeable}. * <p>
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Thu Jul 31 08:16:49 UTC 2025 - 2.5K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/ResourceTraversalTest.java
} assertThat(path1, is(notNullValue())); assertThat(is, is(notNullValue())); count++; } finally { CloseableUtil.close(is); } }); assertTrue(count > 0); } /** * @throws Exception */ @Test public void testForEachJarFile() throws Exception {
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Sat May 10 01:32:17 UTC 2025 - 6K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/PropertiesUtilTest.java
final File file = tempFolder.newFile("hoge.properties"); final FileOutputStream outputStream = OutputStreamUtil.create(file); PropertiesUtil.store(outProperties, outputStream, "comments"); CloseableUtil.close(outputStream); final Properties properties = new Properties(); PropertiesUtil.load(properties, file); assertThat(properties.getProperty("a"), is("A")); } /**
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Sat May 10 01:32:17 UTC 2025 - 9.6K bytes - Viewed (0) -
src/test/java/org/codelibs/core/io/CloseableUtilTest.java
public void testClose() throws Exception { final NotifyOutputStream out = new NotifyOutputStream(); CloseableUtil.close(out); assertThat(out.getNotify(), is("closed")); } /** * @throws Exception */ @Test public void testCloseNull() throws Exception { CloseableUtil.close((OutputStream) null); } /** * @throws Exception */ @Test
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Sat May 10 01:32:17 UTC 2025 - 2.2K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/PropertiesUtil.java
try { props.load(reader); } catch (final IOException e) { throw new IORuntimeException(e); } finally { CloseableUtil.close(reader); } } /** * Loads the specified file into the {@link Properties} using the platform default encoding (wraps exception handling). * * @param props
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Thu Jul 31 08:16:49 UTC 2025 - 7.9K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/FileUtil.java
final ByteBuffer buffer = ByteBuffer.allocate((int) ChannelUtil.size(channel)); ChannelUtil.read(channel, buffer); return buffer.array(); } finally { CloseableUtil.close(is); } } /** * Reads text from a file using the default encoding. * * @param path * The file path. Must not be {@literal null} or empty.
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Thu Jul 31 08:16:49 UTC 2025 - 8.8K bytes - Viewed (0) -
src/main/java/org/codelibs/core/net/MimeTypeUtil.java
import java.io.IOException; import java.io.InputStream; import java.net.URLConnection; import org.codelibs.core.exception.IORuntimeException; import org.codelibs.core.io.CloseableUtil; import org.codelibs.core.io.ResourceUtil; /** * Utility class for MIME types. * * @author shot */ public abstract class MimeTypeUtil { /** * Do not instantiate. */
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Thu Jul 31 08:16:49 UTC 2025 - 1.9K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/ResourceTraversalUtil.java
try { handler.processResource(entryName.substring(pos), is); } finally { CloseableUtil.close(is); } } } } /** * Traverses resources contained in a ZIP file input stream. * * @param zipInputStream
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Thu Jul 31 08:16:49 UTC 2025 - 9.2K bytes - Viewed (0) -
src/main/java/org/codelibs/core/io/SerializeUtil.java
final ObjectInputStream ois = new ObjectInputStream(bais); try { return ois.readObject(); } finally { CloseableUtil.close(ois); } } catch (final IOException ex) { throw new IORuntimeException(ex); } catch (final ClassNotFoundException ex) {
Registered: Fri Sep 05 20:58:11 UTC 2025 - Last Modified: Thu Jul 31 08:16:49 UTC 2025 - 3.2K bytes - Viewed (0)