Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 25 for CloseableUtil (0.73 sec)

  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>
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Thu Jul 31 08:16:49 UTC 2025
    - 2.5K bytes
    - Viewed (0)
  2. 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)
  3. 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.
         *
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Thu Jul 31 08:16:49 UTC 2025
    - 45.2K bytes
    - Viewed (0)
  4. 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)
  5. src/main/java/org/codelibs/fess/dict/mapping/CharMappingFile.java

    import java.util.List;
    import java.util.regex.Matcher;
    import java.util.regex.Pattern;
    
    import org.apache.logging.log4j.LogManager;
    import org.apache.logging.log4j.Logger;
    import org.codelibs.core.io.CloseableUtil;
    import org.codelibs.core.lang.StringUtil;
    import org.codelibs.curl.CurlResponse;
    import org.codelibs.fess.Constants;
    import org.codelibs.fess.dict.DictionaryException;
    import org.codelibs.fess.dict.DictionaryFile;
    Registered: Thu Sep 04 12:52:25 UTC 2025
    - Last Modified: Thu Jul 17 08:28:31 UTC 2025
    - 14.9K bytes
    - Viewed (0)
  6. 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)
  7. 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;
    Registered: Thu Sep 04 12:52:25 UTC 2025
    - Last Modified: Thu Jul 17 08:28:31 UTC 2025
    - 9.8K bytes
    - Viewed (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
    Registered: Fri Sep 05 20:58:11 UTC 2025
    - Last Modified: Thu Jul 31 08:16:49 UTC 2025
    - 7.9K bytes
    - Viewed (0)
  9. 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)
  10. 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)
Back to top