Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 1 - 10 of 24 for CloseableUtil (0.21 seconds)

  1. 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>
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Thu Jul 31 08:16:49 GMT 2025
    - 2.5K bytes
    - Click Count (0)
  2. README.md

    - **Type safety** - Extensive use of generics and null-safe operations throughout the API
    - **Resource management** - Proper handling of resources with utilities like `CloseableUtil` and `DisposableUtil`
    
    ### Key Architectural Patterns
    - **Factory Pattern** - `BeanDescFactory` for creating bean descriptors, `ParameterizedClassDescFactory` for generic type handling
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Sun Aug 31 02:56:02 GMT 2025
    - 12.7K bytes
    - Click Count (0)
  3. 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 {
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Sat May 10 01:32:17 GMT 2025
    - 6K bytes
    - Click Count (0)
  4. src/main/java/org/codelibs/core/io/CopyUtil.java

                final FileOutputStream os = OutputStreamUtil.create(out);
                try {
                    return copyInternal(is, os);
                } finally {
                    CloseableUtil.close(os);
                }
            } finally {
                CloseableUtil.close(is);
            }
        }
    
        /**
         * Copies from a file with the specified encoding to a file with the platform default encoding.
         *
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Thu Jul 31 08:16:49 GMT 2025
    - 45.2K bytes
    - Click Count (0)
  5. 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
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Sat May 10 01:32:17 GMT 2025
    - 2.2K bytes
    - Click Count (0)
  6. 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.
         */
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Thu Jul 31 08:16:49 GMT 2025
    - 1.9K bytes
    - Click Count (0)
  7. 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"));
        }
    
        /**
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Sat May 10 01:32:17 GMT 2025
    - 9.6K bytes
    - Click Count (0)
  8. 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
    Created: Fri Apr 03 20:58:12 GMT 2026
    - Last Modified: Thu Jul 31 08:16:49 GMT 2025
    - 7.9K bytes
    - Click Count (0)
  9. src/main/java/org/codelibs/fess/helper/ProcessHelper.java

    import java.util.concurrent.TimeUnit;
    import java.util.function.Consumer;
    
    import org.apache.commons.io.IOUtils;
    import org.apache.logging.log4j.LogManager;
    import org.apache.logging.log4j.Logger;
    import org.codelibs.core.io.CloseableUtil;
    import org.codelibs.fess.Constants;
    import org.codelibs.fess.exception.JobNotFoundException;
    import org.codelibs.fess.exception.JobProcessingException;
    import org.codelibs.fess.util.InputStreamThread;
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Nov 20 06:54:47 GMT 2025
    - 10.9K bytes
    - Click Count (0)
  10. src/main/java/org/codelibs/fess/thumbnail/impl/CommandGenerator.java

                        try {
                            CloseableUtil.closeQuietly(p.getInputStream());
                        } catch (final Exception e) {
                            logger.warn("Could not close a process input stream.", e);
                        }
                    });
                    CommonPoolUtil.execute(() -> {
                        try {
                            CloseableUtil.closeQuietly(p.getErrorStream());
    Created: Tue Mar 31 13:07:34 GMT 2026
    - Last Modified: Thu Jan 01 12:47:47 GMT 2026
    - 16.6K bytes
    - Click Count (0)
Back to Top