Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for throw (0.15 sec)

  1. src/main/java/org/codelibs/curl/CurlResponse.java

            } catch (final Exception e) {
                throw new CurlException("Failed to access the content.", e);
            }
        }
    
        public InputStream getContentAsStream() throws IOException {
            if (contentCache == null) {
                if (contentException != null) {
                    throw new CurlException("The content does not exist.", contentException);
                } else {
                    throw new CurlException("The content does not exist.");
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 4K bytes
    - Viewed (0)
  2. src/test/java/org/codelibs/curl/io/IOIntegrationTest.java

                return false;
            }
    
            @Override
            public void connect() throws IOException {
                // Do Nothing
            }
    
            @Override
            public int getResponseCode() throws IOException {
                return 200;
            }
    
            @Override
            public InputStream getInputStream() throws IOException {
                return new ByteArrayInputStream(new byte[100]); // dummy payload
            }
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 3.4K bytes
    - Viewed (0)
  3. src/main/java/org/codelibs/curl/io/ContentCache.java

            this.data = null;
            this.file = file;
        }
    
        @Override
        public void close() throws IOException {
            if (file != null) {
                Files.delete(file.toPath());
            }
        }
    
        public InputStream getInputStream() throws IOException {
            if (file != null) {
                return new FileInputStream(file);
            }
            return new ByteArrayInputStream(data);
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 1.6K bytes
    - Viewed (1)
  4. src/test/java/org/codelibs/curl/io/ContentOutputStreamTest.java

        @Test
        public void inMemory() throws IOException {
            ContentOutputStream cos = new ContentOutputStream(10, Curl.tmpDir);
            cos.write(new byte[] { 0, 1, 2, 3, 4 });
            assertFalse(cos.done);
            assertTrue(cos.isInMemory());
            cos.close();
            assertFalse(cos.done);
        }
    
        @Test
        public void inFile() throws IOException {
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 2K bytes
    - Viewed (0)
  5. src/test/java/org/codelibs/curl/CurlTest.java

                assertTrue(content.length() > 0);
            }, e -> {
                logger.log(Level.SEVERE, "error", e);
                fail();
            });
        }
    
        /*
        @Test
        public void test_Get_ssl() throws Exception {
            final String filename = "config/certs/http_ca.crt";
            try (InputStream in = new FileInputStream(filename)) {
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 2.5K bytes
    - Viewed (1)
  6. src/main/java/org/codelibs/curl/CurlRequest.java

        public CurlRequest body(final String body) {
            if (bodyStream != null) {
                throw new CurlException("body method is already called.");
            }
            this.body = body;
            return this;
        }
    
        public CurlRequest body(final InputStream stream) {
            if (body != null) {
                throw new CurlException("body method is already called.");
            }
            this.bodyStream = stream;
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Sun Feb 12 12:21:25 GMT 2023
    - 12.3K bytes
    - Viewed (0)
  7. src/main/java/org/codelibs/curl/io/ContentOutputStream.java

            super(threshold, PREFIX, SUFFIX, tmpDir);
        }
    
        @Override
        public File getFile() {
            done = true;
            return super.getFile();
        }
    
        @Override
        public void close() throws IOException {
            try {
                super.close();
            } finally {
                if (!isInMemory() && !done) {
                    final File file = super.getFile();
                    if (file != null) {
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 1.9K bytes
    - Viewed (0)
Back to top