Home / Function/ setSetContentFromFileExceptionally() — netty Function Reference

setSetContentFromFileExceptionally() — netty Function Reference

Architecture documentation for the setSetContentFromFileExceptionally() function in DiskFileUploadTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  0eef7355_44d9_afcd_0f0a_d4ea9854f5b7["setSetContentFromFileExceptionally()"]
  453c587b_ec9f_a761_a22b_ccf63aa13d1f["DiskFileUploadTest"]
  0eef7355_44d9_afcd_0f0a_d4ea9854f5b7 -->|defined in| 453c587b_ec9f_a761_a22b_ccf63aa13d1f
  style 0eef7355_44d9_afcd_0f0a_d4ea9854f5b7 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/multipart/DiskFileUploadTest.java lines 256–289

    @Test
    public void setSetContentFromFileExceptionally() throws Exception {
        final long maxSize = 4;
        DiskFileUpload f1 = new DiskFileUpload("file5", "file5", "application/json", null, null, 0);
        f1.setMaxSize(maxSize);
        try {
            f1.setContent(Unpooled.wrappedBuffer(new byte[(int) maxSize]));
            File originalFile = f1.getFile();
            assertNotNull(originalFile);
            assertEquals(maxSize, originalFile.length());
            assertEquals(maxSize, f1.length());
            byte[] bytes = new byte[8];
            ThreadLocalRandom.current().nextBytes(bytes);
            File tmpFile = PlatformDependent.createTempFile(UUID.randomUUID().toString(), ".tmp", null);
            tmpFile.deleteOnExit();
            FileOutputStream fos = new FileOutputStream(tmpFile);
            try {
                fos.write(bytes);
                fos.flush();
            } finally {
                fos.close();
            }
            try {
                f1.setContent(tmpFile);
                fail("should not reach here!");
            } catch (IOException e) {
                assertNotNull(f1.getFile());
                assertEquals(originalFile, f1.getFile());
                assertEquals(maxSize, f1.length());
            }
        } finally {
            f1.delete();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does setSetContentFromFileExceptionally() do?
setSetContentFromFileExceptionally() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/DiskFileUploadTest.java.
Where is setSetContentFromFileExceptionally() defined?
setSetContentFromFileExceptionally() is defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/DiskFileUploadTest.java at line 256.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free