# commons-net **Repository Path**: seaboot/commons-net ## Basic Information - **Project Name**: commons-net - **Description**: 就是单纯的二次封装,目的不在于封装了多么强劲的功能,而是为了方便维护, 在项目的代码, 与第三方框架之间,建立一个缓冲地带, 如果有一天,第三方框架需要进行升级,我们只需要少量的调整即可。 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2022-09-22 - **Last Updated**: 2026-07-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: HttpClient, FTP ## README # commons-net 内部封装了 ftp 协议与 http 协议的工具代码。 #### 简介 就是单纯的二次封装,目的不在于封装了多么强劲的功能,而是为了方便维护, 在项目的代码, 与第三方框架之间,建立一个缓冲地带, 如果有一天,第三方框架需要进行升级,我们只需要少量的调整即可。 Apache 的 Httpclient 的问题尤为明显,在 3 到 4 的版本切换过程中,我们几乎重构了全部的代码。 当然,使用这一套代码,肯定也能节省更多的代码。 ```java public class HttpClientExample { public static void main(String[] args) throws IOException, ParseException { HttpClient httpClient = new HttpClient(); HttpRequest request = httpClient.get(URI.create("https://www.baidu.com/")); String text = request.execute(new TextHandler(StandardCharsets.UTF_8)); System.out.println(text); httpClient.close(); } } ```