Search in sources :

Example 1 with UploadObject

use of com.jeesuite.filesystem.UploadObject in project jeesuite-libs by vakinge.

the class HttpDownloader method read.

public static UploadObject read(String url) throws IOException {
    Request.Builder requestBuilder = new Request.Builder().url(url);
    Response response = httpClient.newCall(requestBuilder.build()).execute();
    UploadObject item = new UploadObject(FilePathHelper.parseFileName(url), response.body().bytes());
    return item;
}
Also used : Response(okhttp3.Response) Request(okhttp3.Request) UploadObject(com.jeesuite.filesystem.UploadObject)

Aggregations

UploadObject (com.jeesuite.filesystem.UploadObject)1 Request (okhttp3.Request)1 Response (okhttp3.Response)1