public class FileUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
FileUtils.FileCopyResult
Keeps results of a file copy, including children and total size of the resultant files.
|
| Modifier and Type | Field and Description |
|---|---|
static com.google.common.base.Predicate<Throwable> |
IS_EXCEPTION
Useful for retry functionality that doesn't want to stop Throwables, but does want to retry on Exceptions
|
| Constructor and Description |
|---|
FileUtils() |
| Modifier and Type | Method and Description |
|---|---|
static FileUtils.FileCopyResult |
retryCopy(com.google.common.io.ByteSource byteSource,
File outFile,
com.google.common.base.Predicate<Throwable> shouldRetry,
int maxAttempts)
Copy input byte source to outFile.
|
public static final com.google.common.base.Predicate<Throwable> IS_EXCEPTION
public static FileUtils.FileCopyResult retryCopy(com.google.common.io.ByteSource byteSource, File outFile, com.google.common.base.Predicate<Throwable> shouldRetry, int maxAttempts)
byteSource - Supplier for an input stream that is to be copied. The resulting stream is closed each iterationoutFile - Where the file should be written to.shouldRetry - Predicate indicating if an error is recoverable and should be retried.maxAttempts - The maximum number of assumed recoverable attempts to try before completely failing.RuntimeException - wrapping the inner exception on failure.Copyright © 2016. All rights reserved.