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
ConstructorsConstructorDescriptionRangeAwareUrlResource(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, customizeConnection, equals, from, from, getDescription, getFile, getFilename, getInputStream, getURI, getURL, hashCode, isFileMethods inherited from class org.springframework.core.io.AbstractFileResolvingResource
contentLength, customizeConnection, exists, getFile, getFileForLastModifiedCheck, isFile, isReadable, lastModified, readableChannelMethods inherited from class org.springframework.core.io.AbstractResource
isOpen, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.InputStreamSource
getInputStreamMethods inherited from interface org.springframework.core.io.Resource
contentLength, createRelative, exists, getContentAsByteArray, getContentAsString, 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:RangeAwareResourceReturns a range of bytes from the resource's content.- Specified by:
getInputStreamin 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
-