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 implements RangeAwareResource
in order to provide
random access to content (range content queries).- Author:
- avasquez
-
Constructor Summary
ConstructorDescriptionRangeAwareUrlResource
(String path) RangeAwareUrlResource
(String protocol, String location) RangeAwareUrlResource
(String protocol, String location, String fragment) RangeAwareUrlResource
(URI uri) RangeAwareUrlResource
(URL url) -
Method Summary
Modifier and TypeMethodDescriptiongetInputStream
(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
Methods inherited from class org.springframework.core.io.AbstractResource
isOpen, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.core.io.InputStreamSource
getInputStream
Methods inherited from interface org.springframework.core.io.Resource
contentLength, createRelative, exists, getDescription, getFile, getFilename, getURI, getURL, isFile, isOpen, isReadable, lastModified, readableChannel
-
Constructor Details
-
RangeAwareUrlResource
- Throws:
MalformedURLException
-
RangeAwareUrlResource
-
RangeAwareUrlResource
- Throws:
MalformedURLException
-
RangeAwareUrlResource
- Throws:
MalformedURLException
-
RangeAwareUrlResource
public RangeAwareUrlResource(String protocol, String location, String fragment) throws MalformedURLException - Throws:
MalformedURLException
-
-
Method Details
-
getInputStream
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
-