Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 7 of 7 for new (0.23 sec)

  1. src/test/java/org/codelibs/curl/io/IOIntegrationTest.java

            @Override
            public InputStream getInputStream() throws IOException {
                return new ByteArrayInputStream(new byte[100]); // dummy payload
            }
        }
    
        @Test
        public void test_TmpFileHasBeenDeletedAfterResponseWasClosed() throws Exception {
            // ## Arrange ##
            CurlRequest req = new MockCurlRequest(Curl.Method.POST, "http://dummy");
            req.threshold(0); // always create tmp file
    
    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)
  2. src/main/java/org/codelibs/curl/io/ContentCache.java

                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)
  3. src/main/java/org/codelibs/curl/CurlResponse.java

            return parser.apply(this);
        }
    
        public String getContentAsString() {
            final byte[] bytes = new byte[4096];
            try (BufferedInputStream bis = new BufferedInputStream(getContentAsStream());
                    ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
                int length = bis.read(bytes);
                while (length != -1) {
                    if (length != 0) {
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 4K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/curl/io/ContentOutputStreamTest.java

            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 {
            ContentOutputStream cos = new ContentOutputStream(10, Curl.tmpDir);
    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

                fail();
            });
        }
    
        /*
        @Test
        public void test_Get_ssl() throws Exception {
            final String filename = "config/certs/http_ca.crt";
            try (InputStream in = new FileInputStream(filename)) {
                Certificate certificate = CertificateFactory.getInstance("X.509").generateCertificate(in);
    
                KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
    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

            if (paramList == null) {
                paramList = new ArrayList<>();
            }
            paramList.add(encode(key) + "=" + encode(value));
            return this;
        }
    
        public CurlRequest header(final String key, final String value) {
            if (headerList == null) {
                headerList = new ArrayList<>();
            }
            headerList.add(new String[] { key, value });
            return this;
        }
    
    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/Curl.java

            return new CurlRequest(Method.PUT, url);
        }
    
        public static CurlRequest delete(final String url) {
            return new CurlRequest(Method.DELETE, url);
        }
    
        public static CurlRequest head(final String url) {
            return new CurlRequest(Method.HEAD, url);
        }
    
        public static CurlRequest options(final String url) {
            return new CurlRequest(Method.OPTIONS, url);
        }
    
    Java
    - Registered: Thu May 09 15:34:10 GMT 2024
    - Last Modified: Mon Nov 14 21:05:19 GMT 2022
    - 1.7K bytes
    - Viewed (0)
Back to top