Chrome v1.0版本的 MD5 值为:405851bc70a6a4b73dd62e46c8304601
以下内容为反编译后的 FileApi.java 源代码,内容仅作参考
package com.pengrad.telegrambot.impl;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
public class FileApi {
public static final String FILE_API = "https://api.telegram.org/file/bot";
private final String apiUrl;
public FileApi(String token) {
this(FILE_API, token);
}
public FileApi(String apiUrl, String token) {
this.apiUrl = apiUrl + token + "/";
}
public String getFullFilePath(String filePath) {
int slash = filePath.lastIndexOf(47) + 1;
String path = filePath.substring(0, slash);
String fileName = filePath.substring(slash);
try {
return this.apiUrl + path + URLEncoder.encode(fileName, "UTF-8").replace("+", "%20");
} catch (UnsupportedEncodingException e) {
return this.apiUrl + filePath;
}
}
}