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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn alternative toSupplierthat allows throwing anIOException. -
Constructor Summary
ConstructorsConstructorDescriptionLazyInputStreamResource(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, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.springframework.core.io.Resource
getContentAsByteArray, getContentAsString
-
Constructor Details
-
LazyInputStreamResource
public LazyInputStreamResource(LazyInputStreamResource.IOThrowingSupplier<InputStream> inputStreamSupplier)
-
-
Method Details
-
getDescription
-
getInputStream
- Throws:
IOException
-
equals
- Overrides:
equalsin classorg.springframework.core.io.AbstractResource
-
canEqual
-
hashCode
public int hashCode()- Overrides:
hashCodein classorg.springframework.core.io.AbstractResource
-