public class LocalFileSystem extends FileSystemBase<Path> implements IWritableFileSystem<Path>
FileSystem
representation of the local filesystem.Modifier and Type | Field and Description |
---|---|
protected org.apache.logging.log4j.Logger |
log |
Constructor and Description |
---|
LocalFileSystem() |
Modifier and Type | Method and Description |
---|---|
OutputStream |
appendFile(Path f) |
void |
configure() |
Path |
copyFile(Path f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Copies the file to a another folder.
|
OutputStream |
createFile(Path f) |
void |
createFolder(String folder) |
void |
deleteFile(Path f) |
boolean |
exists(Path f) |
boolean |
folderExists(String folder) |
Map<String,Object> |
getAdditionalFileProperties(Path f) |
String |
getCanonicalName(Path f) |
long |
getFileSize(Path f) |
Date |
getModificationTime(Path f) |
String |
getName(Path f)
Get a string representation of an identification of a file.
|
String |
getParentFolder(Path f) |
String |
getPhysicalDestinationName() |
String |
getRoot() |
boolean |
isFolder(Path f) |
DirectoryStream<Path> |
listFiles(String folder)
Lists all files in 'folder' or in the 'root' of the filesystem (when folder is null).
|
Path |
moveFile(Path f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Moves the file to a another folder.
|
Message |
readFile(Path f,
String charset) |
void |
removeFolder(String folder,
boolean removeNonEmptyFolder) |
Path |
renameFile(Path source,
Path destination)
Renames the file to a new name, possibly in a another folder.
|
void |
setRoot(String root)
Path to the folder that serves as the root of this virtual filesystem.
|
Path |
toFile(String filename)
Get a file 'F' representation of an identification of a file.
|
Path |
toFile(String folder,
String filename)
Creates a reference to a file.
|
close, getMaxNumberOfMessagesToList, getNumberOfFilesInFolder, isOpen, open, setMaxNumberOfMessagesToList
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getNumberOfFilesInFolder, isOpen, open
getDomain
public void configure() throws ConfigurationException
configure
in interface IBasicFileSystem<Path>
ConfigurationException
public Path toFile(String filename)
IBasicFileSystem
IBasicFileSystem.getName(Object)
.toFile
in interface IBasicFileSystem<Path>
public Path toFile(String folder, String filename)
IBasicFileSystem
toFile
in interface IBasicFileSystem<Path>
public DirectoryStream<Path> listFiles(String folder) throws FileSystemException
IBasicFileSystem
listFiles
in interface IBasicFileSystem<Path>
FileSystemException
public boolean exists(Path f)
exists
in interface IBasicFileSystem<Path>
public OutputStream createFile(Path f) throws IOException
createFile
in interface IWritableFileSystem<Path>
IOException
public OutputStream appendFile(Path f) throws IOException
appendFile
in interface IWritableFileSystem<Path>
IOException
public Message readFile(Path f, String charset) throws IOException, FileSystemException
readFile
in interface IBasicFileSystem<Path>
IOException
FileSystemException
public void deleteFile(Path f) throws FileSystemException
deleteFile
in interface IBasicFileSystem<Path>
FileSystemException
public boolean isFolder(Path f)
public boolean folderExists(String folder) throws FileSystemException
folderExists
in interface IBasicFileSystem<Path>
FileSystemException
public void createFolder(String folder) throws FileSystemException
createFolder
in interface IBasicFileSystem<Path>
FileSystemException
public void removeFolder(String folder, boolean removeNonEmptyFolder) throws FileSystemException
removeFolder
in interface IBasicFileSystem<Path>
FileSystemException
public Path renameFile(Path source, Path destination) throws FileSystemException
IWritableFileSystem
renameFile
in interface IWritableFileSystem<Path>
FileSystemException
public Path moveFile(Path f, String destinationFolder, boolean createFolder, boolean resultantMustBeReturned) throws FileSystemException
IBasicFileSystem
resultantMustBeReturned
is set, then an Exception must be thrown, preferably before the file is moved;resultantMustBeReturned
is not set, then a null result returned might also mean the file was moved successfully, but with unknown destination;moveFile
in interface IBasicFileSystem<Path>
resultantMustBeReturned
- TODOFileSystemException
public Path copyFile(Path f, String destinationFolder, boolean createFolder, boolean resultantMustBeReturned) throws FileSystemException
IBasicFileSystem
resultantMustBeReturned
is set, then an Exception must be thrown, preferably before the file is copied;resultantMustBeReturned
is not set, then a null result returned might also mean the file was copied successfully, but with unknown destination;copyFile
in interface IBasicFileSystem<Path>
resultantMustBeReturned
- TODOFileSystemException
public long getFileSize(Path f) throws FileSystemException
getFileSize
in interface IBasicFileSystem<Path>
FileSystemException
public String getName(Path f)
IBasicFileSystem
IBasicFileSystem.toFile(String)
.
Can reflect name a file has in its folder, is not expected to be unique over folders.getName
in interface IBasicFileSystem<Path>
public String getParentFolder(Path f) throws FileSystemException
getParentFolder
in interface IBasicFileSystem<Path>
FileSystemException
public String getCanonicalName(Path f) throws FileSystemException
getCanonicalName
in interface IBasicFileSystem<Path>
FileSystemException
public Date getModificationTime(Path f) throws FileSystemException
getModificationTime
in interface IBasicFileSystem<Path>
FileSystemException
public Map<String,Object> getAdditionalFileProperties(Path f)
getAdditionalFileProperties
in interface IBasicFileSystem<Path>
public String getPhysicalDestinationName()
getPhysicalDestinationName
in interface HasPhysicalDestination
public void setRoot(String root)
public String getRoot()
Copyright © 2023 Frank!Framework. All rights reserved.