add ProgressRequestTest
This commit is contained in:
@ -42,10 +42,12 @@ public class ProgressiveRequest extends FileRequest {
|
||||
return new ProgressiveRequest(Request.post(url), callback);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toFile(Path outputPath) throws IOException, NoPermissionException {
|
||||
processResponse(request.execute(), IO.getOutputStream(outputPath.toFile()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toFile(File file) throws IOException, NoPermissionException {
|
||||
processResponse(request.execute(), IO.getOutputStream(file));
|
||||
}
|
||||
@ -55,6 +57,7 @@ public class ProgressiveRequest extends FileRequest {
|
||||
return new String(asBytes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public byte[] asBytes() throws IOException {
|
||||
ByteArrayOutputStream os = new ByteArrayOutputStream();
|
||||
processResponse(request.execute(), os);
|
||||
|
||||
Reference in New Issue
Block a user