1

I am extending a class imported into my library successfully. Everything works perfectly until I try to extend it using a custom class which errors out when requesting the BasicNameValuePair. The file is near a direct copy paste of

https://github.com/koush/AndroidAsync/blob/8120535ef5cb053059b55f8e1c4fbe6c627ab160/AndroidAsync/src/com/koushikdutta/async/http/body/FilePart.java

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);
    }
}

Gradle

    compile 'com.koushikdutta.ion:ion:2.1.7'
    compile 'com.koushikdutta.async:androidasync:2.1.7'
Mark Ro
  • 11
  • 1

0 Answers0