Home / Function/ writeHttpData() — netty Function Reference

writeHttpData() — netty Function Reference

Architecture documentation for the writeHttpData() function in HttpUploadServerHandler.java from the netty codebase.

Function java Buffer Search called by 1

Entity Profile

Dependency Diagram

graph TD
  95539507_6c78_9bf4_0be2_a7f34f92df2c["writeHttpData()"]
  15610e19_8d3a_d230_9604_65cc0397e9e9["HttpUploadServerHandler"]
  95539507_6c78_9bf4_0be2_a7f34f92df2c -->|defined in| 15610e19_8d3a_d230_9604_65cc0397e9e9
  d050c74a_76ad_11ea_4f73_932ffdd57807["readHttpDataChunkByChunk()"]
  d050c74a_76ad_11ea_4f73_932ffdd57807 -->|calls| 95539507_6c78_9bf4_0be2_a7f34f92df2c
  style 95539507_6c78_9bf4_0be2_a7f34f92df2c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java lines 256–305

    private void writeHttpData(InterfaceHttpData data) {
        if (data.getHttpDataType() == HttpDataType.Attribute) {
            Attribute attribute = (Attribute) data;
            String value;
            try {
                value = attribute.getValue();
            } catch (IOException e1) {
                // Error while reading data from File, only print name and error
                e1.printStackTrace();
                responseContent.append("\r\nBODY Attribute: " + attribute.getHttpDataType().name() + ": "
                        + attribute.getName() + " Error while reading value: " + e1.getMessage() + "\r\n");
                return;
            }
            if (value.length() > 100) {
                responseContent.append("\r\nBODY Attribute: " + attribute.getHttpDataType().name() + ": "
                        + attribute.getName() + " data too long\r\n");
            } else {
                responseContent.append("\r\nBODY Attribute: " + attribute.getHttpDataType().name() + ": "
                        + attribute + "\r\n");
            }
        } else {
            responseContent.append("\r\nBODY FileUpload: " + data.getHttpDataType().name() + ": " + data
                    + "\r\n");
            if (data.getHttpDataType() == HttpDataType.FileUpload) {
                FileUpload fileUpload = (FileUpload) data;
                if (fileUpload.isCompleted()) {
                    if (fileUpload.length() < 10000) {
                        responseContent.append("\tContent of file\r\n");
                        try {
                            responseContent.append(fileUpload.getString(fileUpload.getCharset()));
                        } catch (IOException e1) {
                            // do nothing for the example
                            e1.printStackTrace();
                        }
                        responseContent.append("\r\n");
                    } else {
                        responseContent.append("\tFile too long to be printed out:" + fileUpload.length() + "\r\n");
                    }
                    // fileUpload.isInMemory();// tells if the file is in Memory
                    // or on File
                    // fileUpload.renameTo(dest); // enable to move into another
                    // File dest
                    // decoder.removeFileUploadFromClean(fileUpload); //remove
                    // the File of to delete file
                } else {
                    responseContent.append("\tFile to be continued but should not!\r\n");
                }
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does writeHttpData() do?
writeHttpData() is a function in the netty codebase, defined in example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java.
Where is writeHttpData() defined?
writeHttpData() is defined in example/src/main/java/io/netty/example/http/upload/HttpUploadServerHandler.java at line 256.
What calls writeHttpData()?
writeHttpData() is called by 1 function(s): readHttpDataChunkByChunk.

Analyze Your Own Codebase

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

Try Supermodel Free