Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 252 for finally (0.22 sec)

  1. src/main/java/org/codelibs/core/crypto/CachedCipher.java

                offerEncryptoCipher(cipher);
            }
            return encrypted;
        }
    
        public byte[] encrypto(final byte[] data, final Key key) {
            final Cipher cipher = pollEncryptoCipher(key);
            byte[] encrypted;
            try {
                encrypted = cipher.doFinal(data);
            } catch (final IllegalBlockSizeException e) {
                throw new IllegalBlockSizeRuntimeException(e);
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  2. src/test/java/org/codelibs/core/io/InputStreamUtilTest.java

        /**
         * @throws Exception
         */
        public void testGetBytes() throws Exception {
            final InputStream is = ResourceUtil.getResourceAsStream(StringUtil.replace(getClass().getName(), ".", "/") + ".class");
            try {
                assertNotNull("1", InputStreamUtil.getBytes(is));
            } finally {
                is.close();
            }
        }
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 1.2K bytes
    - Viewed (0)
  3. src/test/java/org/codelibs/core/io/ResourceTraversalTest.java

        }
    
        /**
         * @throws Exception
         */
        @Test
        public void testForEachFile() throws Exception {
            final File rootDir = ResourceUtil.getBuildDir(getClass());
            final String path = ResourceUtil.getResourcePath(getClass());
            final int pos = path.lastIndexOf("/");
            final String baseDirectory = path.substring(0, pos);
            ResourceTraversalUtil.forEach(rootDir, baseDirectory, (ResourceHandler) (path1, is) -> {
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 6K bytes
    - Viewed (0)
  4. src/main/java/org/codelibs/core/concurrent/CommonPoolUtil.java

    public class CommonPoolUtil {
        private static final Logger logger = Logger.getLogger(CommonPoolUtil.class);
    
        private CommonPoolUtil() {
            // nothing
        }
    
        public static void execute(final Runnable task) {
            ForkJoinPool.commonPool().execute(() -> {
                final Thread currentThread = Thread.currentThread();
                final ClassLoader orignal = currentThread.getContextClassLoader();
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 1.5K bytes
    - Viewed (1)
  5. src/main/java/org/codelibs/core/io/CopyUtil.java

            assertArgumentNotNull("in", in);
            assertArgumentNotNull("out", out);
    
            final InputStream is = URLUtil.openStream(in);
            try {
                final FileOutputStream os = OutputStreamUtil.create(out);
                try {
                    return copyInternal(wrap(is), os);
                } finally {
                    CloseableUtil.close(os);
                }
            } finally {
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 52.4K bytes
    - Viewed (0)
  6. src/test/java/org/codelibs/core/lang/ClassLoaderUtilTest.java

            final ClassLoader context = Thread.currentThread().getContextClassLoader();
            try {
                final ClassLoader cl = new URLClassLoader(new URL[0], getClass().getClassLoader());
                Thread.currentThread().setContextClassLoader(cl);
                assertThat(ClassLoaderUtil.getClassLoader(TestCase.class), is(sameInstance(cl)));
            } finally {
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 3K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/core/io/CloseableUtil.java

         * <p>
         * {@literal try}ブロックで例外が発生した場合、{@literal finally}ブロックの
         * {@link #close(Closeable)}でも 例外が発生する可能性があります。その場合に{@literal finally}
         * ブロックから例外をスローすると、 {@literal try}ブロックで発生した元の例外が失われてしまいます。
         * </p>
         *
         * @param closeable
         *            クローズ可能なオブジェクト
         * @see Closeable#close()
         */
        public static void close(final Closeable closeable) {
            if (closeable == null) {
                return;
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 2.5K bytes
    - Viewed (0)
  8. 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) {
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 3.5K bytes
    - Viewed (0)
  9. src/main/java/org/codelibs/core/io/FileUtil.java

         * @return ファイルの内容を読み込んだバイト配列
         */
        public static byte[] readBytes(final File file) {
            assertArgumentNotNull("file", file);
    
            final FileInputStream is = InputStreamUtil.create(file);
            try {
                final FileChannel channel = is.getChannel();
                final ByteBuffer buffer = ByteBuffer.allocate((int) ChannelUtil.size(channel));
                ChannelUtil.read(channel, buffer);
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 9K bytes
    - Viewed (0)
  10. src/main/java/org/codelibs/core/timer/TimeoutManager.java

                } catch (final InterruptedException e) {
                    if (logger.isDebugEnabled()) {
                        logger.debug("Interrupted.", e);
                    }
                } finally {
                    executorService.shutdownNow();
                }
            }
        }
    
        private void processTask(final ExecutorService executorService, final TimeoutTask task) {
            try {
    Java
    - Registered: Fri May 03 20:58:11 GMT 2024
    - Last Modified: Thu Mar 07 01:59:08 GMT 2024
    - 8K bytes
    - Viewed (0)
Back to top