https://github.com/nicennnnnnnlee/fileuploader4github
pure java. GitHub文件上传工具,支持批量拖拽,可用于图床、批量上传等用途。仅需Java环境即可运行
https://github.com/nicennnnnnnlee/fileuploader4github
Last synced: about 1 month ago
JSON representation
pure java. GitHub文件上传工具,支持批量拖拽,可用于图床、批量上传等用途。仅需Java环境即可运行
- Host: GitHub
- URL: https://github.com/nicennnnnnnlee/fileuploader4github
- Owner: nICEnnnnnnnLee
- License: apache-2.0
- Created: 2019-09-10T06:50:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2020-04-15T11:02:15.000Z (about 5 years ago)
- Last Synced: 2025-03-21T20:46:36.538Z (about 2 months ago)
- Language: Java
- Homepage:
- Size: 1.27 MB
- Stars: 14
- Watchers: 1
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FileUploader4Github





基于GitHub API的GitHub文件上传工具
===============================
**仅需Java环境即可运行**## :smile:如何配置
+ 配置释义
因为是上传到Github仓库,故而需要`owner`、`repo`,在仓库中的位置`path`,以及授权用的`token`。
这些都应该实现保存在jar包同目录下的`app.config`文件中。举例如下:
```
owner = nICEnnnnnnnLee
repo = AbcTest
path = /note/hello/
token = 06495cbd3c86f38dd4b1e5a75249b14804d08tt5
```+ 注意事项
+ `path`应该以`/`开头,并且以`/`结尾,如根目录,`path = /`
+ `path`应当不包含中文等特殊字符
+ `path`在上传前可以不存在,上传文件时自动建立
+ `token`请在[这里](https://github.com/settings/tokens)设置并获取,`repo`相关权限打勾即可
+ 仅支持上传新文件,若路径存在同名文件,将上传失败## :smile:如何使用
+ 独立运行
+ `Release`页下载、解压,并配置好`app.config`
+ 双击`FileUp4Github.jar`
+ 确认上传至云端时是否保存为原来的文件名/根据时间重命名
+ 选择想要上传的文件
+ 通过窗口选择(单个文件)
+ 通过拖拽选择(单个或多个文件均可)

+ 控制台查看结果(上传完毕后,文件链接将复制到系统剪贴板)
+ 嵌入第三方程序
以下为示例,
```
// 构造url链接 https://api.github.com/repos/:owner/:repo/contents/:path
String url = "https://api.github.com/repos/nICEnnnnnnnLee/AbcTest/contents/note/test.jpg";// 获取想要上传的文件
File file = new File("D:\\Workspace\\sources\\pics\\test.jpg");// 上传,并获取结果
boolean result = FileUploader.create(url, file, ":token");
```## :smile:其它
* **下载地址**: [https://github.com/nICEnnnnnnnLee/FileUploader4Github/releases](https://github.com/nICEnnnnnnnLee/FileUploader4Github/releases)
* [**更新日志**](https://github.com/nICEnnnnnnnLee/FileUploader4Github/blob/master/UPDATE.md)LICENSE
```
Copyright (C) 2019 NiceLee. All Rights Reserved.Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```