Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 43 for Closeable (0.24 sec)

  1. android/guava/src/com/google/common/io/Closeables.java

       *     IOException}.
       */
      public static void close(@CheckForNull Closeable closeable, boolean swallowIOException)
          throws IOException {
        if (closeable == null) {
          return;
        }
        try {
          closeable.close();
        } catch (IOException e) {
          if (swallowIOException) {
            logger.log(Level.WARNING, "IOException thrown while closing Closeable.", e);
          } else {
            throw e;
          }
        }
      }
    
    Java
    - Registered: Fri Apr 26 12:43:10 GMT 2024
    - Last Modified: Wed May 17 14:35:11 GMT 2023
    - 4.7K bytes
    - Viewed (0)
  2. android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java

                  @Override
                  public Closeable call(DeferredCloser closer) throws Exception {
                    return closer.eventuallyClose(mockCloseable, executor);
                  }
                },
                executor);
        FluentFuture<Closeable> unused = closingFuture.finishToFuture();
        assertThrows(
            IllegalStateException.class,
            () -> {
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  3. android/guava-tests/test/com/google/common/io/CloseablesTest.java

        }
      }
    
      private void doClose(Closeable closeable, boolean swallowException) throws IOException {
        doClose(closeable, swallowException, !swallowException);
      }
    
      // Close the closeable using the Closeables, passing in the swallowException
      // parameter. expectThrown determines whether we expect an exception to
      // be thrown by Closeables.close;
      private void doClose(Closeable closeable, boolean swallowException, boolean expectThrown)
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4K bytes
    - Viewed (0)
  4. guava-tests/test/com/google/common/io/CloseablesTest.java

        }
      }
    
      private void doClose(Closeable closeable, boolean swallowException) throws IOException {
        doClose(closeable, swallowException, !swallowException);
      }
    
      // Close the closeable using the Closeables, passing in the swallowException
      // parameter. expectThrown determines whether we expect an exception to
      // be thrown by Closeables.close;
      private void doClose(Closeable closeable, boolean swallowException, boolean expectThrown)
    Java
    - Registered: Fri Apr 19 12:43:09 GMT 2024
    - Last Modified: Mon Dec 04 17:37:03 GMT 2017
    - 4K bytes
    - Viewed (0)
  5. guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToFutureTest.java

                  @Override
                  public Closeable call(DeferredCloser closer) throws Exception {
                    return closer.eventuallyClose(mockCloseable, executor);
                  }
                },
                executor);
        FluentFuture<Closeable> unused = closingFuture.finishToFuture();
        assertThrows(
            IllegalStateException.class,
            () -> {
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.7K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/core/io/CloseableUtil.java

         * {@link #close(Closeable)}でも 例外が発生する可能性があります。その場合に{@literal finally}
         * ブロックから例外をスローすると、 {@literal try}ブロックで発生した元の例外が失われてしまいます。
         * </p>
         *
         * @param closeable
         *            クローズ可能なオブジェクト
         * @see Closeable#close()
         */
        public static void close(final Closeable closeable) {
            if (closeable == null) {
                return;
            }
            try {
    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)
  7. android/guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java

        ClosingFuture<Closeable> closingFuture =
            ClosingFuture.submit(
                new ClosingCallable<Closeable>() {
                  @Override
                  public Closeable call(DeferredCloser closer) throws Exception {
                    return closer.eventuallyClose(mockCloseable, executor);
                  }
                },
                executor);
        FluentFuture<Closeable> unused = closingFuture.finishToFuture();
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  8. guava-tests/test/com/google/common/util/concurrent/ClosingFutureFinishToValueAndCloserTest.java

        ClosingFuture<Closeable> closingFuture =
            ClosingFuture.submit(
                new ClosingCallable<Closeable>() {
                  @Override
                  public Closeable call(DeferredCloser closer) throws Exception {
                    return closer.eventuallyClose(mockCloseable, executor);
                  }
                },
                executor);
        FluentFuture<Closeable> unused = closingFuture.finishToFuture();
    Java
    - Registered: Fri Apr 12 12:43:09 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 5.7K bytes
    - Viewed (0)
  9. okhttp-testing-support/src/main/kotlin/okhttp3/OkHttpDebugLogging.kt

            }
        }
    
      fun enable(
        loggerClass: String,
        handler: Handler = logHandler(),
      ): Closeable {
        val logger = Logger.getLogger(loggerClass)
        if (configuredLoggers.add(logger)) {
          logger.addHandler(handler)
          logger.level = Level.FINEST
        }
        return Closeable {
          logger.removeHandler(handler)
        }
      }
    
      fun enable(loggerClass: KClass<*>) = enable(loggerClass.java.name)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 1.9K bytes
    - Viewed (0)
  10. android/guava-tests/test/com/google/common/io/AppendableWriterTest.java

    import static org.junit.Assert.assertThrows;
    
    import java.io.Closeable;
    import java.io.Flushable;
    import java.io.IOException;
    import java.io.Writer;
    
    /**
     * Unit test for {@link AppendableWriter}.
     *
     * @author Alan Green
     */
    public class AppendableWriterTest extends IoTestCase {
    
      /** Helper class for testing behavior with Flushable and Closeable targets. */
    Java
    - Registered: Fri May 03 12:43:13 GMT 2024
    - Last Modified: Wed Sep 06 17:04:31 GMT 2023
    - 3.2K bytes
    - Viewed (0)
Back to top