use of com.zhouzifei.tool.config.FileProperties in project simpleFS by shengdingbox.
the class FastDfsOssApiClient method init.
@Override
public FastDfsOssApiClient init(FileProperties fileProperties) {
final FastDfsFileProperties fastDfsFileProperties = fileProperties.getFast();
this.serverUrl = fastDfsFileProperties.getServerUrl();
this.domainUrl = fastDfsFileProperties.getUrl();
checkDomainUrl(domainUrl);
Properties props = new Properties();
props.put(ClientGlobal.PROP_KEY_TRACKER_SERVERS, serverUrl);
try {
ClientGlobal.initByProperties(props);
} catch (IOException e) {
throw new ServiceException("[" + this.storageType + "]尚未配置阿里云FastDfs,文件上传功能暂时不可用!");
}
return this;
}
use of com.zhouzifei.tool.config.FileProperties in project simpleFS by shengdingbox.
the class AwsS3ApiClient method main.
public static void main(String[] args) {
final FileProperties fileProperties = new FileProperties();
final AwsFileProperties awsFileProperties = fileProperties.getAws();
awsFileProperties.setAccessKey("LTAI5tFpTDE26XYiPmH9dxDz");
awsFileProperties.setSecretKey("9gC7gs5kEJJmZec6a6QupoefIL82Kr");
awsFileProperties.setEndpoint("oss-cn-beijing.aliyuncs.com");
awsFileProperties.setBucketName("simple-fs");
awsFileProperties.setDomainUrl("https://simple-fs.oss-cn-beijing.aliyuncs.com/");
final AwsS3ApiClient awsS3ApiClient = new AwsS3ApiClient(fileProperties);
final File file = new File("/Users/Dabao/Downloads/videoplayback.mp4");
final VirtualFile virtualFile = awsS3ApiClient.uploadFile(file);
System.out.println(virtualFile);
System.out.println(1);
}
use of com.zhouzifei.tool.config.FileProperties 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);
}
use of com.zhouzifei.tool.config.FileProperties in project simpleFS by shengdingbox.
the class M3u8DownloadFactory method main.
public static void main(String[] args) {
M3u8DTO m3u8Download = M3u8DTO.builder().m3u8Url("https://cdn.oss-cn-hangzhou.myqcloud.com.xuetuiguang.cn/m3u8video/shouquan.m3u8").fileName("miaozhun").filePath("/Users/Dabao/mp4").retryCount("3").threadCount("3").timeout("5").build();
M3u8DownloadFactory.M3u8Download instance = M3u8DownloadFactory.getInstance(m3u8Download);
// 开始下载
final String tsUrl = instance.runM3u8ToCloudTask(new FileProperties());
// final Set<String> tsSet = instance.getTsSet();
// System.out.println(tsSet);
}
use of com.zhouzifei.tool.config.FileProperties in project simpleFS by shengdingbox.
the class XMLYApiClient method main.
public static void main(String[] args) {
final FileProperties fileProperties = new FileProperties();
fileProperties.getXmly().setCookies("Hm_lvt_4a7d8ec50cfd6af753c4f8aee3425070=1639114684; login_type=password_mobile; _xmLog=h5&9ea2efdf-7a5a-4f8d-8269-d9934707ef09&2.4.7-alpha.3; xm-page-viewid=ximalaya-web; x_xmly_traffic=utm_source%253A%2526utm_medium%253A%2526utm_campaign%253A%2526utm_content%253A%2526utm_term%253A%2526utm_from%253A; fds_otp=6230401576727727914; 1&remember_me=y; 1&_token=296993092&6B46C2A0340N0CBC4A6620979932BB1AF9474CD57A95BFBAEA25D9FDEE7710FBF352868FED80140M28D23A81E28D8FF_; 1_l_flag=296993092&6B46C2A0340N0CBC4A6620979932BB1AF9474CD57A95BFBAEA25D9FDEE7710FBF352868FED80140M28D23A81E28D8FF__2021-12-1015:49:16; Hm_lpvt_4a7d8ec50cfd6af753c4f8aee3425070=1639122558\n" + "origin: https://www.ximalaya.com");
final XMLYApiClient init = new XMLYApiClient(fileProperties);
final VirtualFile virtualFile = init.uploadFile(new File("/Users/Dabao/Downloads/qrcode_for_gh_da74abc7de78_258.jpg"));
System.out.println(virtualFile);
// final String s1 = "username=17600004572&password=zhoudabao521.";
// final String s = HttpUtils.DataPost(requestUrl + "/token", s1);
// final JSONObject jsonObject = JSONObject.parseObject(s);
}
Aggregations