public class FileSystemUtils extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.logging.log4j.Logger |
log |
Constructor and Description |
---|
FileSystemUtils() |
Modifier and Type | Method and Description |
---|---|
static <F> void |
checkSource(IBasicFileSystem<F> fileSystem,
F source,
FileSystemActor.FileSystemAction action)
Check if a source file exists.
|
static <F> F |
copyFile(IBasicFileSystem<F> fileSystem,
F file,
String destinationFolder,
boolean overwrite,
int numOfBackups,
boolean createFolders,
boolean destinationMustBeReturned) |
static <F> MessageContext |
getContext(IBasicFileSystem<F> fileSystem,
F file) |
static <F> MessageContext |
getContext(IBasicFileSystem<F> fileSystem,
F file,
String charset) |
static <F> DirectoryStream<F> |
getDirectoryStream(Iterable<F> iterable) |
static <F> DirectoryStream<F> |
getDirectoryStream(Iterator<F> iterator) |
static <F> DirectoryStream<F> |
getDirectoryStream(Iterator<F> iterator,
AutoCloseable resourceToCloseOnClose) |
static <F> DirectoryStream<F> |
getDirectoryStream(Iterator<F> iterator,
Runnable onClose) |
static <F> DirectoryStream<F> |
getDirectoryStream(Iterator<F> iterator,
Supplier<IOException> onClose) |
static <F,FS extends IBasicFileSystem<F>> |
getFileInfo(FS fileSystem,
F f,
DocumentFormat format) |
static <F,FS extends IBasicFileSystem<F>> |
getFileInfo(FS fileSystem,
F f,
INodeBuilder nodeBuilder) |
static <F> Stream<F> |
getFilteredStream(IBasicFileSystem<F> fileSystem,
String folder,
String wildCard,
String excludeWildCard) |
static <F> F |
moveFile(IBasicFileSystem<F> fileSystem,
F file,
String destinationFolder,
boolean overwrite,
int numOfBackups,
boolean createFolders,
boolean destinationMustBeReturned) |
static <F> void |
prepareDestination(IBasicFileSystem<F> fileSystem,
F source,
String destinationFolder,
boolean overwrite,
int numOfBackups,
boolean createFolders,
FileSystemActor.FileSystemAction action)
Prepares the destination folder, e.g.
|
static <F> void |
prepareDestination(IWritableFileSystem<F> fileSystem,
F destination,
boolean overwrite,
int numOfBackups,
FileSystemActor.FileSystemAction action)
Prepares the destination of a file:
- if the file exists, checks overwrite, or performs rollover
|
static <F> F |
renameFile(IWritableFileSystem<F> fileSystem,
F source,
F destination,
boolean overwrite,
int numOfBackups) |
static <F> void |
rolloverByDay(IWritableFileSystem<F> fileSystem,
F file,
String folder,
int rotateDays) |
static <F> void |
rolloverByNumber(IWritableFileSystem<F> fileSystem,
F file,
int numberOfBackups) |
static <F> void |
rolloverBySize(IWritableFileSystem<F> fileSystem,
F file,
int rotateSize,
int numberOfBackups) |
public static <F> void checkSource(IBasicFileSystem<F> fileSystem, F source, FileSystemActor.FileSystemAction action) throws FileNotFoundException, FileSystemException
public static <F> void prepareDestination(IWritableFileSystem<F> fileSystem, F destination, boolean overwrite, int numOfBackups, FileSystemActor.FileSystemAction action) throws FileSystemException
FileSystemException
public static <F> void prepareDestination(IBasicFileSystem<F> fileSystem, F source, String destinationFolder, boolean overwrite, int numOfBackups, boolean createFolders, FileSystemActor.FileSystemAction action) throws FileSystemException
FileSystemException
public static <F> F renameFile(IWritableFileSystem<F> fileSystem, F source, F destination, boolean overwrite, int numOfBackups) throws FileSystemException
FileSystemException
public static <F> F moveFile(IBasicFileSystem<F> fileSystem, F file, String destinationFolder, boolean overwrite, int numOfBackups, boolean createFolders, boolean destinationMustBeReturned) throws FileSystemException
FileSystemException
public static <F> F copyFile(IBasicFileSystem<F> fileSystem, F file, String destinationFolder, boolean overwrite, int numOfBackups, boolean createFolders, boolean destinationMustBeReturned) throws FileSystemException
FileSystemException
public static <F> MessageContext getContext(IBasicFileSystem<F> fileSystem, F file) throws FileSystemException
FileSystemException
public static <F> MessageContext getContext(IBasicFileSystem<F> fileSystem, F file, String charset) throws FileSystemException
FileSystemException
public static <F> void rolloverByNumber(IWritableFileSystem<F> fileSystem, F file, int numberOfBackups) throws FileSystemException
FileSystemException
public static <F> void rolloverBySize(IWritableFileSystem<F> fileSystem, F file, int rotateSize, int numberOfBackups) throws FileSystemException
FileSystemException
public static <F> DirectoryStream<F> getDirectoryStream(Iterable<F> iterable)
public static <F> DirectoryStream<F> getDirectoryStream(Iterator<F> iterator)
public static <F> DirectoryStream<F> getDirectoryStream(Iterator<F> iterator, Runnable onClose)
public static <F> DirectoryStream<F> getDirectoryStream(Iterator<F> iterator, AutoCloseable resourceToCloseOnClose)
public static <F> DirectoryStream<F> getDirectoryStream(Iterator<F> iterator, Supplier<IOException> onClose)
public static <F> void rolloverByDay(IWritableFileSystem<F> fileSystem, F file, String folder, int rotateDays) throws FileSystemException
FileSystemException
@Nonnull public static <F> Stream<F> getFilteredStream(IBasicFileSystem<F> fileSystem, String folder, String wildCard, String excludeWildCard) throws FileSystemException, IOException
FileSystemException
IOException
public static <F,FS extends IBasicFileSystem<F>> String getFileInfo(FS fileSystem, F f, DocumentFormat format) throws FileSystemException
FileSystemException
public static <F,FS extends IBasicFileSystem<F>> void getFileInfo(FS fileSystem, F f, INodeBuilder nodeBuilder) throws FileSystemException, SAXException
FileSystemException
SAXException
Copyright © 2023 Frank!Framework. All rights reserved.