/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream) { return JavaRangeResult.ofStream(stream, rangeHeader(request), null, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream) { return JavaRangeResult.ofStream(stream, rangeHeader(request), null, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream) { return JavaRangeResult.ofStream(stream, rangeHeader(request), null, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @param filename filename used at the Content-Disposition header * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), filename, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), null, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), null, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), null, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @param filename filename used at the Content-Disposition header * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), filename, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @param filename filename used at the Content-Disposition header * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), filename, Optional.empty()); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @param filename filename used at the Content-Disposition header * @param contentType the content type for this stream * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename, String contentType) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), filename, Optional.ofNullable(contentType)); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @param filename filename used at the Content-Disposition header * @param contentType the content type for this stream * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename, String contentType) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), filename, Optional.ofNullable(contentType)); }
/** * Returns the stream as a result considering "Range" header. If the header is present and * it is satisfiable, then a Result containing just the requested part will be returned. * If the header is not present or is unsatisfiable, then a regular Result will be returned. * * @param request the request from which to retrieve the range header. * @param stream the content stream * @param contentLength the entity length * @param filename filename used at the Content-Disposition header * @param contentType the content type for this stream * @return range result if "Range" header is present and regular result if not */ public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename, String contentType) { return JavaRangeResult.ofStream(contentLength, stream, rangeHeader(request), filename, Optional.ofNullable(contentType)); }