我正在成功扩展导入我的库的类。一切都运行良好,直到我尝试使用自定义类扩展它,在请求BasicNameValuePair时出错。该文件接近
的直接复制粘贴public class CustomFilePart extends StreamPart {
File file;
public CustomFilePart(String name, final File file) {
super(name, (int)file.length(), new ArrayList<NameValuePair>() {
{
add(new BasicNameValuePair("filename", file.getName()));
}
});
getRawHeaders().set("Content-Type", "video/*");
this.file = file;
}
@Override
protected InputStream getInputStream() throws IOException {
return new FileInputStream(file);
}
}
摇篮
compile 'com.koushikdutta.ion:ion:2.1.7'
compile 'com.koushikdutta.async:androidasync:2.1.7'