Interface IWritableFileSystem<F>
- Type Parameters:
F- File representation
- All Superinterfaces:
AutoCloseable, HasPhysicalDestination, IBasicFileSystem<F>
- All Known Implementing Classes:
AmazonS3FileSystem, FtpFileSystem, LocalFileSystem, Samba1FileSystem, Samba2FileSystem, SftpFileSystem
Extension to
IBasicFileSystem that can be implemented to allow creation of files and folders.
For writable filesystems, the name of a file can be freely chosen, and: - moving or copying a file to a folder probably will not change its name - moving or copying a file to a folder can 'overwrite' a file already present in the folder To accommodate these situations, for writable filesystems we support overwrite protection and rollover. This requires that writeableFileSystem.getName() returns the name of the file in the directory, not the full name including the folder name.
- Author:
- Gerrit van Brakel
-
Method Summary
Modifier and TypeMethodDescriptionvoidappendFile(@NonNull F file, @Nullable InputStream content) voidcreateFile(@NonNull F file, @Nullable InputStream content) Create a file with the given content inputstreamrenameFile(@NonNull F source, @NonNull F destination) Renames the file to a new name, possibly in another folder.Methods inherited from interface HasPhysicalDestination
getPhysicalDestinationNameMethods inherited from interface IBasicFileSystem
close, configure, copyFile, createFolder, deleteFile, exists, folderExists, getAdditionalFileProperties, getCanonicalName, getCanonicalNameOrErrorMessage, getFileSize, getModificationTime, getName, getParentFolder, isFolder, isOpen, list, list, moveFile, open, readFile, removeFolder, toFile, toFile
-
Method Details
-
createFile
void createFile(@NonNull F file, @Nullable InputStream content) throws FileSystemException, IOException Create a file with the given content inputstream- Parameters:
file- FileSystem file referencecontent- to write or NULL. When NULL existing files should be overwritten, and new files should be created.- Throws:
FileSystemExceptionIOException
-
appendFile
void appendFile(@NonNull F file, @Nullable InputStream content) throws FileSystemException, IOException - Throws:
FileSystemExceptionIOException
-
renameFile
Renames the file to a new name, possibly in another folder. Does not need to check for the existence of the source or non-existence of the destination.- Throws:
FileSystemException
-