Package net.solarnetwork.io
Class ConcatenatingResource
java.lang.Object
org.springframework.core.io.AbstractResource
net.solarnetwork.io.ConcatenatingResource
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource,org.springframework.core.io.Resource
public class ConcatenatingResource
extends org.springframework.core.io.AbstractResource
implements org.springframework.core.io.Resource
A collection of resources concatenated together into one virtual resource.
The InputStream returned by this resource will be a concatenating
stream of all the configured resources. Other methods will delegate to the
first resource only, such as lastModified().
- Since:
- 1.44
- Version:
- 1.0
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionConcatenatingResource(Collection<org.springframework.core.io.Resource> resources) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionlongGet the total length of all configured resources combined.Get a concatenating input stream of all configured resources combined.longGet the modification date of the first resource.toString()Methods inherited from class org.springframework.core.io.AbstractResource
createRelative, equals, exists, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, hashCode, isOpen, isReadableMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.Resource
createRelative, exists, getFile, getFilename, getURI, getURL, isOpen, isReadable
-
Constructor Details
-
ConcatenatingResource
Constructor.- Parameters:
resources- the resources to concatenate
-
-
Method Details
-
getInputStream
Get a concatenating input stream of all configured resources combined.- Specified by:
getInputStreamin interfaceorg.springframework.core.io.InputStreamSource- Throws:
IOException
-
contentLength
Get the total length of all configured resources combined.- Specified by:
contentLengthin interfaceorg.springframework.core.io.Resource- Overrides:
contentLengthin classorg.springframework.core.io.AbstractResource- Throws:
IOException
-
lastModified
Get the modification date of the first resource.- Specified by:
lastModifiedin interfaceorg.springframework.core.io.Resource- Overrides:
lastModifiedin classorg.springframework.core.io.AbstractResource- Throws:
IOException
-
getDescription
- Specified by:
getDescriptionin interfaceorg.springframework.core.io.Resource
-
toString
- Overrides:
toStringin classorg.springframework.core.io.AbstractResource
-