Search in sources :

Example 1 with GithubFileProperties

use of com.zhouzifei.tool.config.GithubFileProperties in project simpleFS by shengdingbox.

the class GithubApiClient method main.

public static void main(String[] args) throws IOException {
    final FileInputStream fileInputStream = new FileInputStream("/Users/Dabao/Downloads/123.png");
    final FileProperties fileProperties = new FileProperties();
    final GithubFileProperties githubFileProperties = fileProperties.getGithub();
    githubFileProperties.setToken("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");
    githubFileProperties.setUser("shengdingbox");
    githubFileProperties.setRepository("static");
    final GithubApiClient githubApiClient = new GithubApiClient(fileProperties);
    final String s = githubApiClient.uploadInputStream(fileInputStream, "123.png");
    System.out.println(s);
}
Also used : GithubFileProperties(com.zhouzifei.tool.config.GithubFileProperties) FileProperties(com.zhouzifei.tool.config.FileProperties) GithubFileProperties(com.zhouzifei.tool.config.GithubFileProperties) FileInputStream(java.io.FileInputStream)

Example 2 with GithubFileProperties

use of com.zhouzifei.tool.config.GithubFileProperties in project simpleFS by shengdingbox.

the class GithubApiClient method init.

@Override
public GithubApiClient init(FileProperties fileProperties) {
    final GithubFileProperties githubFileProperties = fileProperties.getGithub();
    this.repository = githubFileProperties.getRepository();
    this.token = githubFileProperties.getToken();
    this.user = githubFileProperties.getUser();
    return this;
}
Also used : GithubFileProperties(com.zhouzifei.tool.config.GithubFileProperties)

Aggregations

GithubFileProperties (com.zhouzifei.tool.config.GithubFileProperties)2 FileProperties (com.zhouzifei.tool.config.FileProperties)1 FileInputStream (java.io.FileInputStream)1