Class LazyInputStreamResource
java.lang.Object
org.springframework.core.io.AbstractResource
com.broadleafcommerce.dataimport.service.support.LazyInputStreamResource
- All Implemented Interfaces:
org.springframework.core.io.InputStreamSource
,org.springframework.core.io.Resource
public class LazyInputStreamResource
extends org.springframework.core.io.AbstractResource
An alternative to
InputStreamResource
that only creates the InputStream
when
getInputStream()
is invoked.
This is based on the suggestion outlined in this issue.
- Author:
- Samarth Dhruva (samarthd)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
An alternative toSupplier
that allows throwing anIOException
. -
Constructor Summary
ConstructorDescriptionLazyInputStreamResource
(LazyInputStreamResource.IOThrowingSupplier<InputStream> inputStreamSupplier) -
Method Summary
Methods inherited from class org.springframework.core.io.AbstractResource
contentLength, createRelative, exists, getFile, getFileForLastModifiedCheck, getFilename, getURI, getURL, isFile, isOpen, isReadable, lastModified, readableChannel, toString
-
Constructor Details
-
LazyInputStreamResource
public LazyInputStreamResource(LazyInputStreamResource.IOThrowingSupplier<InputStream> inputStreamSupplier)
-
-
Method Details
-
getDescription
-
getInputStream
- Throws:
IOException
-
equals
- Overrides:
equals
in classorg.springframework.core.io.AbstractResource
-
canEqual
-
hashCode
public int hashCode()- Overrides:
hashCode
in classorg.springframework.core.io.AbstractResource
-