Java Code Examples for retrofit2.http.Streaming

The following are top voted examples for showing how to use retrofit2.http.Streaming. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: GitHub   File: BuiltInConverters.java   Source Code and License 5 votes vote down vote up
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
    Retrofit retrofit) {
  if (type == ResponseBody.class) {
    return Utils.isAnnotationPresent(annotations, Streaming.class)
        ? StreamingResponseBodyConverter.INSTANCE
        : BufferingResponseBodyConverter.INSTANCE;
  }
  if (type == Void.class) {
    return VoidResponseBodyConverter.INSTANCE;
  }
  return null;
}
 
Example 2
Project: GitHub   File: BuiltInConverters.java   Source Code and License 5 votes vote down vote up
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
    Retrofit retrofit) {
  if (type == ResponseBody.class) {
    return Utils.isAnnotationPresent(annotations, Streaming.class)
        ? StreamingResponseBodyConverter.INSTANCE
        : BufferingResponseBodyConverter.INSTANCE;
  }
  if (type == Void.class) {
    return VoidResponseBodyConverter.INSTANCE;
  }
  return null;
}
 
Example 3
Project: EvolvingNetLib   File: CCNetApiService.java   Source Code and License 5 votes vote down vote up
/**
 * 下载文件
 * @param url
 * @param headerMap
 * @param txtParamMap
 * @return
 */
@Streaming
@GET
Call<ResponseBody> executeDownload(
        @Url String url,
        @HeaderMap Map<String, String> headerMap,
        @QueryMap Map<String, String> txtParamMap
);
 
Example 4
Project: Ec2m   File: RetrofitService.java   Source Code and License 5 votes vote down vote up
@Streaming
@POST
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 5
Project: JavaAyo   File: BuiltInConverters.java   Source Code and License 5 votes vote down vote up
@Override
public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations,
    Retrofit retrofit) {
  if (type == ResponseBody.class) {
    if (Utils.isAnnotationPresent(annotations, Streaming.class)) {
      return StreamingResponseBodyConverter.INSTANCE;
    }
    return BufferingResponseBodyConverter.INSTANCE;
  }
  if (type == Void.class) {
    return VoidResponseBodyConverter.INSTANCE;
  }
  return null;
}
 
Example 6
Project: retrofit2-download-adapter   File: DownloadCallAdapterFactory.java   Source Code and License 5 votes vote down vote up
@Override
public CallAdapter<?> get(Type returnType, Annotation[] annotations, final Retrofit retrofit) {
    if (returnType != Download.Builder.class) {
        return null;
    }

    if (!Util.isAnnotationPresent(annotations, Streaming.class)) {
        throw new IllegalArgumentException("Download.Builder requires @Streaming.");
    }

    return new CallAdapter<Download.Builder>() {
        @Override
        public Type responseType() {
            return ResponseBody.class;
        }

        @SuppressWarnings("unchecked")
        @Override
        public <R> Download.Builder adapt(Call<R> call) {
            Download.Builder builder = new Download.Builder((Call<ResponseBody>) call);

            Executor callbackExecutor = retrofit.callbackExecutor();

            if (callbackExecutor != null) {
                builder.callbackExecutor(callbackExecutor);
            }

            return builder;
        }
    };
}
 
Example 7
Project: ImitateZHRB   File: ZHRBApi.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 8
Project: GitHub   File: DownloadApi.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Flowable<Response<ResponseBody>> download(@Header("Range") String range,
                                          @Url String url);
 
Example 9
Project: Clipcon-AndroidClient   File: RetrofitInterface.java   Source Code and License 4 votes vote down vote up
/** download */
@Streaming
@Headers({ "User-Agent: androidProgram" })
@GET("DownloadServlet")
Call<ResponseBody> requestFileDataDownload(@QueryMap Map<String, String> parameters);
 
Example 10
Project: TWStreaming   File: ITwitterStreamingAPI.java   Source Code and License 4 votes vote down vote up
@Streaming
@POST("statuses/filter.json")
Observable<ResponseBody> getStreamingStatuses(@Query("track") String track, @Query("filter_level") String filterLevel);
 
Example 11
Project: Bailan   File: HttpDownService.java   Source Code and License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example 12
Project: RxRetrofit-tokean   File: HttpDownService.java   Source Code and License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example 13
Project: TestChat   File: HttpService.java   Source Code and License 4 votes vote down vote up
@Streaming/*大文件需要加入这个判断,防止下载过程中写入到内存中*/
@GET
Observable<ResponseBody> download(@Header("RANGE") String start, @Url String url);
 
Example 14
Project: TestChat   File: ApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> download(@Url String url, @HeaderMap Map<String,String> headerMap);
 
Example 15
Project: filestack-java   File: CdnService.java   Source Code and License 4 votes vote down vote up
@GET("{handle}")
@Streaming
Call<ResponseBody> get(
    @Path("handle") String handle,
    @Query("policy") String policy,
    @Query("signature") String signature);
 
Example 16
Project: filestack-java   File: CdnService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET("{tasks}/{handle}")
Call<ResponseBody> transform(
    @Path("tasks") String tasks,
    @Path("handle") String handle);
 
Example 17
Project: filestack-java   File: CdnService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET("{key}/{tasks}/{url}")
Call<ResponseBody> transformExt(
    @Path("key") String key,
    @Path("tasks") String tasks,
    @Path("url") String url);
 
Example 18
Project: XSnow   File: ApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET()
Observable<ResponseBody> downFile(@Url() String url, @QueryMap Map<String, String> maps);
 
Example 19
Project: JD-Test   File: BaseApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Flowable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 20
Project: RxEasyHttp   File: ApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Observable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 21
Project: DOUSalaries   File: SalaryApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadDouFile(@Url String fileUrl);
 
Example 22
Project: Auto.js   File: DownloadApi.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Observable<ResponseBody> download(@Url String url);
 
Example 23
Project: Plamber-Android   File: PlamberAPI.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 24
Project: FastEc   File: RestService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> download(@Url String url, @QueryMap Map<String, Object> params);
 
Example 25
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getWebSiteContainerLogs" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs")
@Streaming
Observable<Response<ResponseBody>> getWebSiteContainerLogs(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 26
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getWebSiteContainerLogsZip" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download")
@Streaming
Observable<Response<ResponseBody>> getWebSiteContainerLogsZip(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 27
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getInstanceProcessDump" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump")
@Streaming
Observable<Response<ResponseBody>> getInstanceProcessDump(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("processId") String processId, @Path("instanceId") String instanceId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 28
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getProcessDump" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump")
@Streaming
Observable<Response<ResponseBody>> getProcessDump(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("processId") String processId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 29
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listPublishingProfileXmlWithSecrets" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml")
@Streaming
Observable<Response<ResponseBody>> listPublishingProfileXmlWithSecrets(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CsmPublishingProfileOptions publishingProfileOptions, @Header("User-Agent") String userAgent);
 
Example 30
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getWebSiteContainerLogsSlot" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs")
@Streaming
Observable<Response<ResponseBody>> getWebSiteContainerLogsSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 31
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getWebSiteContainerLogsZipSlot" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download")
@Streaming
Observable<Response<ResponseBody>> getWebSiteContainerLogsZipSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 32
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getInstanceProcessDumpSlot" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump")
@Streaming
Observable<Response<ResponseBody>> getInstanceProcessDumpSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("processId") String processId, @Path("slot") String slot, @Path("instanceId") String instanceId, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 33
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps getProcessDumpSlot" })
@GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump")
@Streaming
Observable<Response<ResponseBody>> getProcessDumpSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("processId") String processId, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent);
 
Example 34
Project: azure-libraries-for-java   File: WebAppsInner.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.appservice.WebApps listPublishingProfileXmlWithSecretsSlot" })
@POST("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml")
@Streaming
Observable<Response<ResponseBody>> listPublishingProfileXmlWithSecretsSlot(@Path("resourceGroupName") String resourceGroupName, @Path("name") String name, @Path("slot") String slot, @Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Body CsmPublishingProfileOptions publishingProfileOptions, @Header("User-Agent") String userAgent);
 
Example 35
Project: autorest.java   File: FilesImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyfile.Files getFile" })
@GET("files/stream/nonempty")
@Streaming
Observable<Response<ResponseBody>> getFile();
 
Example 36
Project: autorest.java   File: FilesImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyfile.Files getFileLarge" })
@GET("files/stream/verylarge")
@Streaming
Observable<Response<ResponseBody>> getFileLarge();
 
Example 37
Project: autorest.java   File: FilesImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: fixtures.bodyfile.Files getEmptyFile" })
@GET("files/stream/empty")
@Streaming
Observable<Response<ResponseBody>> getEmptyFile();
 
Example 38
Project: autorest.java   File: FormdatasImpl.java   Source Code and License 4 votes vote down vote up
@Multipart
@POST("formdata/stream/uploadfile")
@Streaming
Observable<Response<ResponseBody>> uploadFile(@Part("fileContent") RequestBody fileContent, @Part("fileName") String fileName);
 
Example 39
Project: autorest.java   File: FormdatasImpl.java   Source Code and License 4 votes vote down vote up
@Headers({ "Content-Type: application/octet-stream", "x-ms-logging-context: fixtures.bodyformdata.Formdatas uploadFileViaBody" })
@PUT("formdata/stream/uploadfile")
@Streaming
Observable<Response<ResponseBody>> uploadFileViaBody(@Body RequestBody fileContent);
 
Example 40
Project: KTools   File: FileDownloadService.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Flowable<ResponseBody> downloadFile(@Url String url);
 
Example 41
Project: KTools   File: FileDownloadService.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Flowable<ResponseBody> downloadFile(@Url String url, @Header("Range") String range);
 
Example 42
Project: AndroidRequest   File: RetrofitHttpService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET()
Observable<ResponseBody> Obdownload(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
 
Example 43
Project: AndroidRequest   File: RetrofitHttpService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET()
Call<ResponseBody> download(@HeaderMap Map<String, String> headers, @Url String url, @QueryMap Map<String, String> params);
 
Example 44
Project: Clipcon-Client   File: RetrofitInterface.java   Source Code and License 4 votes vote down vote up
/** download */
@Streaming
@Headers({ "User-Agent: pcProgram" })
@GET("DownloadServlet")
Call<ResponseBody> requestFileDataDownload(@QueryMap Map<String, String> parameters);
 
Example 45
Project: AvenueNet   File: ClientService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Observable<ResponseBody> download(@Url String url, @QueryMap Map<String, Object> params, @HeaderMap Map<String, Object> header);
 
Example 46
Project: Bing   File: RestService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> download(@Url String url, @QueryMap WeakHashMap<String, Object> params);
 
Example 47
Project: Bing   File: RxRestService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Observable<ResponseBody> download(@Url String url, @QueryMap WeakHashMap<String, Object> params);
 
Example 48
Project: LoggingInterceptor   File: Api.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET("http://che.org.il/wp-content/uploads/2016/12/pdf-sample.pdf")
Observable<ResponseBody> pdf();
 
Example 49
Project: mining   File: StreamingService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET("/api/v1/streaming/home")
Observable<ResponseBody> home(@NonNull @Header("Authorization") String authorization);
 
Example 50
Project: mining   File: StreamingService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET("/api/v1/streaming/public")
Observable<ResponseBody> pub(@NonNull @Header("Authorization") String authorization);
 
Example 51
Project: mining   File: StreamingService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET("/api/v1/streaming/tags")
Observable<ResponseBody> tags(@NonNull @Header("Authorization") String authorization);
 
Example 52
Project: LittleLight   File: RetrofitDestinyApiFacade.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Call<ResponseBody> downloadManifestWithDynamicUrl(@Url String manifestUrl);
 
Example 53
Project: AndroidModulePattern   File: ApiService.java   Source Code and License 4 votes vote down vote up
/**
 * 流式下载,不加这个注解的话,会整个文件字节数组全部加载进内存,可能导致oom
 */
@Streaming
@GET
Call<ResponseBody> download(@Url String fileUrl, @HeaderMap Map<String, String> headers);
 
Example 54
Project: SuperHttp   File: ApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET()
Observable<ResponseBody> downFile(@Url() String url, @QueryMap Map<String, String> maps);
 
Example 55
Project: RetrofitClient   File: BaseApiService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET
Observable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 56
Project: percolate-java-sdk   File: VariantsService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET(Endpoints.API_V5_PATH + "/variant/{variant_id}/download")
Call<ResponseBody> download(@Path("asset_id") String assetId, @QueryMap Map<String, Object> params);
 
Example 57
Project: percolate-java-sdk   File: AssetsService.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET(Endpoints.API_V5_PATH + "/asset/{asset_id}/download")
Call<ResponseBody> download(@Path("asset_id") String assetId, @QueryMap Map<String, Object> params);
 
Example 58
Project: percolate-java-sdk   File: VariantsServiceRx.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET(Endpoints.API_V5_PATH + "/variant/{variant_id}/download")
Observable<ResponseBody> download(@Path("asset_id") String assetId, @QueryMap Map<String, Object> params);
 
Example 59
Project: percolate-java-sdk   File: AssetsServiceRx.java   Source Code and License 4 votes vote down vote up
@Streaming
@GET(Endpoints.API_V5_PATH + "/asset/{asset_id}/download")
Observable<ResponseBody> download(@Path("asset_id") String assetId, @QueryMap Map<String, Object> params);
 
Example 60
Project: redux-android-sample   File: RetrofitBuilder.java   Source Code and License 4 votes vote down vote up
@GET
@Streaming
Call<ResponseBody> downloadFileWithDynamicUrlSync(@Url String fileUrl);