{"id":20713018,"url":"https://github.com/carolcoral/commonutil","last_synced_at":"2025-10-11T11:02:46.911Z","repository":{"id":35560903,"uuid":"198966426","full_name":"carolcoral/CommonUtil","owner":"carolcoral","description":"Common utils for Java. Welcome to put your issues in issues.","archived":false,"fork":false,"pushed_at":"2023-04-17T19:51:35.000Z","size":259,"stargazers_count":5,"open_issues_count":7,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-23T07:55:19.513Z","etag":null,"topics":["async","date","http","java","kafka","redis","spring","springboot","ssh"],"latest_commit_sha":null,"homepage":"https://carolcoral.github.io/CommonUtil/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/carolcoral.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-07-26T07:12:28.000Z","updated_at":"2024-01-10T15:05:31.000Z","dependencies_parsed_at":"2025-04-23T07:55:21.903Z","dependency_job_id":"945da034-d52e-4de3-9668-6274b3b691b1","html_url":"https://github.com/carolcoral/CommonUtil","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/carolcoral/CommonUtil","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carolcoral%2FCommonUtil","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carolcoral%2FCommonUtil/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carolcoral%2FCommonUtil/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carolcoral%2FCommonUtil/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/carolcoral","download_url":"https://codeload.github.com/carolcoral/CommonUtil/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/carolcoral%2FCommonUtil/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006916,"owners_count":26084217,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["async","date","http","java","kafka","redis","spring","springboot","ssh"],"created_at":"2024-11-17T02:23:03.673Z","updated_at":"2025-10-11T11:02:46.892Z","avatar_url":"https://github.com/carolcoral.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CommonUtil\n* \u003cb\u003eDesc: A common utils jar for using redis elasticsearch Rest and file even more these.\u003c/b\u003e\n\n## [WIKI](https://github.com/carolcoral/CommonUtil/wiki)\n\n## Download\n* [CommonUtil.jar](https://github.com/carolcoral/CommonUtil/releases/download/2.0.2/CommonUtil-2.0.2.jar)\n* [CommonUtil-javadoc.jar](https://github.com/carolcoral/CommonUtil/releases/download/2.0.2/CommonUtil-2.0.2-javadoc.jar)\n* [CommonUtil-sources.jar](https://github.com/carolcoral/CommonUtil/releases/download/2.0.2/CommonUtil-2.0.2-sources.jar)\n\n## Log\n\u003e `2021-10-29 13:51:03` add and fix some methods.Update version to 2.1.0.\n\n\u003e `2021-3-24 11:24:53` fix some bugs and change mongoClient init. [Use MongoClientInit](https://github.com/carolcoral/CommonUtil/wiki/MongoClientInit).\n\n\u003e `2021-2-9 11:09:13` change folder and fix some bug.\n\n\u003e `2020-8-20 16:49:23` new class [MongoClientsInit](https://github.com/carolcoral/CommonUtil/blob/master/src/main/java/site/cnkj/utils/MongoClientsInit.java) for create muti mongoClient.More info to see [How to use MongoClientsInit](https://carolcoral.github.io/Article/JAVA/Java%E6%9E%84%E5%BB%BA%E5%A4%9Amongo%E6%95%B0%E6%8D%AE%E6%BA%90%E5%AE%A2%E6%88%B7%E7%AB%AF)\n\n\u003e `2020-7-21 11:20:14` fix some expire bug from [RedisUtil](https://github.com/carolcoral/CommonUtil/blob/master/src/main/java/site/cnkj/utils/RedisUtil.java).\n\n\u003e `2020-7-20 14:17:00` New date function `String formatDateByReg(String date_format, int parseInt)` for format date by The date-format [DateUtil](https://github.com/carolcoral/CommonUtil/blob/master/src/main/java/site/cnkj/utils/DateUtil.java) .For example like this:\n\n```java\npublic static void main(String[] args) {\n    List\u003cString\u003e date_list = Arrays.asList(\n            \"YYYY\",\n            \"YYYY-MM\",\n            \"YYYY-MM-dd\",\n            \"YYYY-MM-dd HH\",\n            \"YYYY-MM-dd HH:mm\",\n            \"YYYY-MM-dd HH:mm:ss\"\n    );\n    int parseInt = -1;\n    for (String date_format : date_list) {\n        System.out.println(\"current date_format is: \"+date_format);\n        String formatDateByReg = formatDateByReg(date_format, parseInt);\n        System.out.println(\"current format result is:\"+formatDateByReg);\n    }\n}\ncurrent date_format is: YYYY\ncurrent format result is:2019\ncurrent date_format is: YYYY-MM\ncurrent format result is:2020-06\ncurrent date_format is: YYYY-MM-dd\ncurrent format result is:2020-07-19\ncurrent date_format is: YYYY-MM-dd HH\ncurrent format result is:2020-07-20 13\ncurrent date_format is: YYYY-MM-dd HH:mm\ncurrent format result is:2020-07-20 14:14\ncurrent date_format is: YYYY-MM-dd HH:mm:ss\ncurrent format result is:2020-07-20 14:15:08\n```\n\n\u003e `2019-12-27 17:20:34` Demo to show how to operation Protobuf in java.[Java中使用ProtoBuf数据](https://github.com/carolcoral/CommonUtil/wiki/Java中使用ProtoBuf数据)\n\n\u003e `2019-12-05 14:33:23` New class for remotely connect to the server and execute the script.[SSH2Util](https://github.com/carolcoral/CommonUtil/blob/master/src/main/java/site/cnkj/utils/SSH2Util.java)\n\n## How to use\n### Import it in your pom\n#### Import jar into your maven\n```shell\nmvn install:install-file -Dfile=\u003cpath-to-file\u003e -DgroupId=site.cnkj -DartifactId=CommonUtil -Dversion=1.0 -Dpackaging=jar\n```\n\u003e Note:\u003cpath-to-file\u003e is your local jar of full path.\n\n\u003e For example:\n```shell\nmvn install:install-file -Dfile=/User/carol/Desktop/CommonUtil-1.0.jar -DgroupId=site.cnkj -DartifactId=CommonUtil -Dversion=1.0 -Dpackaging=jar\n```\n\n#### Import dependency into your pom.xml\n```yaml\n\u003cdependency\u003e\n    \u003cgroupId\u003esite.cnkj\u003c/groupId\u003e\n    \u003cartifactId\u003eCommonUtil\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.2\u003c/version\u003e\n\u003c/dependency\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarolcoral%2Fcommonutil","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcarolcoral%2Fcommonutil","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcarolcoral%2Fcommonutil/lists"}