Class RangeAwareUrlResource
- java.lang.Object
-
- org.springframework.core.io.AbstractResource
-
- org.springframework.core.io.AbstractFileResolvingResource
-
- org.springframework.core.io.UrlResource
-
- org.craftercms.commons.spring.resources.RangeAwareUrlResource
-
- All Implemented Interfaces:
RangeAwareResource
,org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
public class RangeAwareUrlResource extends org.springframework.core.io.UrlResource implements RangeAwareResource
UrlResource
extension that implementsRangeAwareResource
in order to provide random access to content (range content queries).- Author:
- avasquez
-
-
Constructor Summary
Constructors Constructor Description RangeAwareUrlResource(String path)
RangeAwareUrlResource(String protocol, String location)
RangeAwareUrlResource(String protocol, String location, String fragment)
RangeAwareUrlResource(URI uri)
RangeAwareUrlResource(URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
getInputStream(long start, long end)
Returns a range of bytes from the resource's content.-
Methods inherited from class org.springframework.core.io.UrlResource
createRelative, createRelativeURL, equals, getDescription, getFile, getFilename, getInputStream, getURI, getURL, hashCode, isFile
-
Methods inherited from class org.springframework.core.io.AbstractFileResolvingResource
contentLength, customizeConnection, customizeConnection, exists, getFile, getFileForLastModifiedCheck, isFile, isReadable, lastModified, readableChannel
-
-
-
-
Constructor Detail
-
RangeAwareUrlResource
public RangeAwareUrlResource(URI uri) throws MalformedURLException
- Throws:
MalformedURLException
-
RangeAwareUrlResource
public RangeAwareUrlResource(URL url)
-
RangeAwareUrlResource
public RangeAwareUrlResource(String path) throws MalformedURLException
- Throws:
MalformedURLException
-
RangeAwareUrlResource
public RangeAwareUrlResource(String protocol, String location) throws MalformedURLException
- Throws:
MalformedURLException
-
RangeAwareUrlResource
public RangeAwareUrlResource(String protocol, String location, String fragment) throws MalformedURLException
- Throws:
MalformedURLException
-
-
Method Detail
-
getInputStream
public InputStream getInputStream(long start, long end) throws IOException
Description copied from interface:RangeAwareResource
Returns a range of bytes from the resource's content.- Specified by:
getInputStream
in interfaceRangeAwareResource
- Parameters:
start
- the start of the rangeend
- the end of the range- Returns:
- an input stream with the content range
- Throws:
IOException
- if an IO error occurs
-
-