Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for ContentCache (0.59 sec)

  1. src/main/java/org/codelibs/curl/io/ContentCache.java

     * {@code
     * // In-memory caching
     * byte[] data = "example data".getBytes();
     * try (ContentCache cache = new ContentCache(data)) {
     *     InputStream inputStream = cache.getInputStream();
     *     // Read from inputStream
     * }
     *
     * // File-based caching
     * File file = new File("example.txt");
     * try (ContentCache cache = new ContentCache(file)) {
     *     InputStream inputStream = cache.getInputStream();
     *     // Read from inputStream
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Sat Jul 05 01:38:18 UTC 2025
    - 3.8K bytes
    - Viewed (0)
  2. src/main/java/org/codelibs/curl/CurlResponse.java

         *
         * @param contentCache the content cache to set.
         */
        public void setContentCache(final ContentCache contentCache) {
            this.contentCache = contentCache;
        }
    
        /**
         * Gets the HTTP status code of the response.
         *
         * @return the HTTP status code.
         */
        public int getHttpStatusCode() {
            return httpStatusCode;
        }
    
        /**
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Sat Jul 05 01:38:18 UTC 2025
    - 6.8K bytes
    - Viewed (0)
  3. src/test/java/org/codelibs/curl/CurlResponseTest.java

        @Test
        public void testContentCache() {
            CurlResponse response = new CurlResponse();
            byte[] data = "test content".getBytes();
            ContentCache cache = new ContentCache(data);
    
            response.setContentCache(cache);
    
            // ContentCache is not directly accessible, but we can test through content methods
            assertNotNull(response);
        }
    
        @Test
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Thu Jul 31 01:01:12 UTC 2025
    - 11.5K bytes
    - Viewed (0)
  4. src/test/java/org/codelibs/curl/io/ContentCacheTest.java

            byte[] data = "Hello, World!".getBytes();
            ContentCache cache = new ContentCache(data);
    
            assertNotNull(cache);
        }
    
        @Test
        public void testFileBasedCacheConstructor() throws IOException {
            tempFile = File.createTempFile("test", ".tmp", Curl.tmpDir);
            ContentCache cache = new ContentCache(tempFile);
    
            assertNotNull(cache);
        }
    
        @Test
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Thu Jul 31 01:01:12 UTC 2025
    - 10.3K bytes
    - Viewed (0)
  5. src/main/java/org/codelibs/curl/CurlRequest.java

                    }
                    dfos.flush();
                    final ContentCache contentCache;
                    logger.fine(() -> "Response in " + (dfos.isInMemory() ? "Memory" : "File"));
                    if (dfos.isInMemory()) {
                        contentCache = new ContentCache(dfos.getData());
                    } else {
                        contentCache = new ContentCache(dfos.getFile());
                    }
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Sat Jul 05 01:38:18 UTC 2025
    - 17.8K bytes
    - Viewed (0)
  6. README.md

    - `org.codelibs.curl.CurlRequest`: builder for HTTP requests.
    - `org.codelibs.curl.CurlResponse`: wrapper for HTTP responses.
    - `org.codelibs.curl.CurlException`: unchecked exception for errors.
    - `org.codelibs.curl.io.ContentCache` and `ContentOutputStream`: internal utilities for streaming and caching.
    
    Refer to the Javadoc for full API details.
    
    ## Building and Testing
    
    ```bash
    git clone https://github.com/codelibs/curl4j.git
    cd curl4j
    Registered: Thu Sep 04 15:34:10 UTC 2025
    - Last Modified: Sat Jul 05 01:11:14 UTC 2025
    - 2.5K bytes
    - Viewed (0)
Back to top