Package play.mvc
Class RangeResults
- Object
-
- play.mvc.RangeResults
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RangeResults.SourceAndOffset
static interface
RangeResults.SourceFunction
-
Constructor Summary
Constructors Constructor Description RangeResults()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Result
ofFile(Http.Request request, File file)
Returns the file as a result considering "Range" header.static Result
ofFile(Http.Request request, File file, String fileName)
Returns the file as a result considering "Range" header.static Result
ofFile(Http.Request request, File file, String fileName, FileMimeTypes fileMimeTypes)
Returns the file as a result considering "Range" header.static Result
ofFile(Http.Request request, File file, FileMimeTypes fileMimeTypes)
Returns the file as a result considering "Range" header.static Result
ofPath(Http.Request request, Path path)
Returns the path as a result considering "Range" header.static Result
ofPath(Http.Request request, Path path, String fileName)
Returns the path as a result considering "Range" header.static Result
ofPath(Http.Request request, Path path, String fileName, FileMimeTypes fileMimeTypes)
Returns the path as a result considering "Range" header.static Result
ofPath(Http.Request request, Path path, FileMimeTypes fileMimeTypes)
Returns the path as a result considering "Range" header.static Result
ofSource(Http.Request request, Long entityLength, Source<ByteString,?> source, String fileName, String contentType)
Returns the stream as a result considering "Range" header.static Result
ofSource(Http.Request request, Long entityLength, RangeResults.SourceFunction getSource, String fileName, String contentType)
static Result
ofStream(Http.Request request, InputStream stream)
Returns the stream as a result considering "Range" header.static Result
ofStream(Http.Request request, InputStream stream, long contentLength)
Returns the stream as a result considering "Range" header.static Result
ofStream(Http.Request request, InputStream stream, long contentLength, String filename)
Returns the stream as a result considering "Range" header.static Result
ofStream(Http.Request request, InputStream stream, long contentLength, String filename, String contentType)
Returns the stream as a result considering "Range" header.
-
-
-
Method Detail
-
ofStream
public static Result ofStream(Http.Request request, InputStream stream)
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.- Parameters:
request
- the request from which to retrieve the range header.stream
- the content stream- Returns:
- range result if "Range" header is present and regular result if not
-
ofStream
public static Result ofStream(Http.Request request, InputStream stream, long contentLength)
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.- Parameters:
request
- the request from which to retrieve the range header.stream
- the content streamcontentLength
- the entity length- Returns:
- range result if "Range" header is present and regular result if not
-
ofStream
public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename)
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.- Parameters:
request
- the request from which to retrieve the range header.stream
- the content streamcontentLength
- the entity lengthfilename
- filename used at the Content-Disposition header- Returns:
- range result if "Range" header is present and regular result if not
-
ofStream
public static Result ofStream(Http.Request request, InputStream stream, long contentLength, String filename, String 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.- Parameters:
request
- the request from which to retrieve the range header.stream
- the content streamcontentLength
- the entity lengthfilename
- filename used at the Content-Disposition headercontentType
- the content type for this stream- Returns:
- range result if "Range" header is present and regular result if not
-
ofPath
public static Result ofPath(Http.Request request, Path path)
Returns the path 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.- Parameters:
request
- the request from which to retrieve the range header.path
- the content path- Returns:
- range result if "Range" header is present and regular result if not
-
ofPath
public static Result ofPath(Http.Request request, Path path, FileMimeTypes fileMimeTypes)
Returns the path 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.- Parameters:
request
- the request from which to retrieve the range header.path
- the content pathfileMimeTypes
- Used for file type mapping.- Returns:
- range result if "Range" header is present and regular result if not
-
ofPath
public static Result ofPath(Http.Request request, Path path, String fileName)
Returns the path 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.- Parameters:
request
- the request from which to retrieve the range header.path
- the content pathfileName
- filename used at the Content-Disposition header.- Returns:
- range result if "Range" header is present and regular result if not
-
ofPath
public static Result ofPath(Http.Request request, Path path, String fileName, FileMimeTypes fileMimeTypes)
Returns the path 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.- Parameters:
request
- the request from which to retrieve the range header.path
- the content pathfileName
- filename used at the Content-Disposition header.fileMimeTypes
- Used for file type mapping.- Returns:
- range result if "Range" header is present and regular result if not
-
ofFile
public static Result ofFile(Http.Request request, File file)
Returns the file 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.- Parameters:
request
- the request from which to retrieve the range header.file
- the content file- Returns:
- range result if "Range" header is present and regular result if not
-
ofFile
public static Result ofFile(Http.Request request, File file, FileMimeTypes fileMimeTypes)
Returns the file 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.- Parameters:
request
- the request from which to retrieve the range header.file
- the content filefileMimeTypes
- Used for file type mapping.- Returns:
- range result if "Range" header is present and regular result if not
-
ofFile
public static Result ofFile(Http.Request request, File file, String fileName)
Returns the file 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.- Parameters:
request
- the request from which to retrieve the range header.file
- the content filefileName
- filename used at the Content-Disposition header- Returns:
- range result if "Range" header is present and regular result if not
-
ofFile
public static Result ofFile(Http.Request request, File file, String fileName, FileMimeTypes fileMimeTypes)
Returns the file 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.- Parameters:
request
- the request from which to retrieve the range header.file
- the content filefileName
- filename used at the Content-Disposition headerfileMimeTypes
- Used for file type mapping.- Returns:
- range result if "Range" header is present and regular result if not
-
ofSource
public static Result ofSource(Http.Request request, Long entityLength, Source<ByteString,?> source, String fileName, String 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.- Parameters:
request
- the request from which to retrieve the range header.entityLength
- the entityLengthsource
- source of the entityfileName
- filename used at the Content-Disposition headercontentType
- the content type for this stream- Returns:
- range result if "Range" header is present and regular result if not
-
ofSource
@ApiMayChange public static Result ofSource(Http.Request request, Long entityLength, RangeResults.SourceFunction getSource, String fileName, String contentType)
-
-