@Test public void canDownloadFile() throws Exception { Retrofit retrofit = new Retrofit.Builder().baseUrl("http://microsoft.com").addCallAdapterFactory(RxJavaCallAdapterFactory.create()).build(); byte[] content = Utils.downloadFileAsync("http://google.com/humans.txt", retrofit).toBlocking().single(); String contentString = new String(content); Assert.assertNotNull(contentString); } }
Observable<Void> pfxBytes = Observable.just(null); if (pfxFileUrl != null) { pfxBytes = Utils.downloadFileAsync(pfxFileUrl, this.manager().restClient().retrofit()) .map(new Func1<byte[], Void>() { @Override