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   View source code 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   View source code 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   View source code 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   View source code 5 votes vote down vote up
@Streaming
@POST
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 5
Project: JavaAyo   File: BuiltInConverters.java   View source code 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   View source code 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   View source code 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 8
Project: GitHub   File: DownloadApi.java   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 4 votes vote down vote up
@Streaming
@GET
Flowable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 20
Project: RxEasyHttp   File: ApiService.java   View source code 4 votes vote down vote up
@Streaming
@GET
Observable<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 21
Project: DOUSalaries   File: SalaryApiService.java   View source code 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadDouFile(@Url String fileUrl);
 
Example 22
Project: Auto.js   File: DownloadApi.java   View source code 4 votes vote down vote up
@GET
@Streaming
Observable<ResponseBody> download(@Url String url);
 
Example 23
Project: Plamber-Android   File: PlamberAPI.java   View source code 4 votes vote down vote up
@Streaming
@GET
Call<ResponseBody> downloadFile(@Url String fileUrl);
 
Example 24
Project: FastEc   File: RestService.java   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 4 votes vote down vote up
@GET
@Streaming
Flowable<ResponseBody> downloadFile(@Url String url);