public abstract class AbstractFileInputStreamSupplier extends Object implements Supplier<InputStream>
Supplier adding the logic to check that the file size is stable.
Each subclass should give implementations of getUpdatedAttributes(), to be able to get
the size of the file, and getContentInputStream(), to get the InputStream that is
supplied.| Modifier and Type | Field and Description |
|---|---|
protected FileAttributes |
attributes |
protected static String |
FILE_NO_LONGER_EXISTS_MESSAGE |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFileInputStreamSupplier(FileAttributes attributes,
Long timeBetweenSizeCheck) |
| Modifier and Type | Method and Description |
|---|---|
InputStream |
get() |
protected abstract InputStream |
getContentInputStream()
Gets the
InputStream of the file described by the attributes passed to the constructor |
protected abstract FileAttributes |
getUpdatedAttributes()
Gets the updated attributes of the file.
|
protected void |
onFileDeleted() |
protected void |
onFileDeleted(Exception e) |
protected static final String FILE_NO_LONGER_EXISTS_MESSAGE
protected FileAttributes attributes
protected AbstractFileInputStreamSupplier(FileAttributes attributes, Long timeBetweenSizeCheck)
public InputStream get()
get in interface Supplier<InputStream>protected void onFileDeleted()
protected void onFileDeleted(Exception e)
protected abstract FileAttributes getUpdatedAttributes()
protected abstract InputStream getContentInputStream()
InputStream of the file described by the attributes passed to the constructorInputStream of the fileCopyright © 2003–2019 MuleSoft, Inc.. All rights reserved.