public class SftpFileSystem extends SftpSession implements IWritableFileSystem<SftpFileRef>
SftpSession.TransportType
Constructor and Description |
---|
SftpFileSystem() |
Modifier and Type | Method and Description |
---|---|
OutputStream |
appendFile(SftpFileRef f) |
void |
close() |
SftpFileRef |
copyFile(SftpFileRef f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Copies the file to a another folder.
|
OutputStream |
createFile(SftpFileRef f) |
void |
createFolder(String folder) |
void |
deleteFile(SftpFileRef f) |
boolean |
exists(SftpFileRef file) |
boolean |
folderExists(String folder) |
Map<String,Object> |
getAdditionalFileProperties(SftpFileRef f) |
String |
getCanonicalName(SftpFileRef f) |
long |
getFileSize(SftpFileRef f) |
Date |
getModificationTime(SftpFileRef f) |
String |
getName(SftpFileRef file)
Get a string representation of an identification of a file.
|
int |
getNumberOfFilesInFolder(String folder) |
String |
getParentFolder(SftpFileRef file) |
String |
getPhysicalDestinationName() |
boolean |
isOpen() |
DirectoryStream<SftpFileRef> |
listFiles(String folder)
Lists all files in 'folder' or in the 'root' of the filesystem (when folder is null).
|
SftpFileRef |
moveFile(SftpFileRef f,
String destinationFolder,
boolean createFolder,
boolean resultantMustBeReturned)
Moves the file to a another folder.
|
void |
open() |
Message |
readFile(SftpFileRef f,
String charset) |
void |
removeFolder(String folder,
boolean removeNonEmptyFolder) |
SftpFileRef |
renameFile(SftpFileRef source,
SftpFileRef destination)
Renames the file to a new name, possibly in a another folder.
|
void |
setRemoteDirectory(String remoteDirectory)
pathname of the file or directory to list.
|
SftpFileRef |
toFile(String filename)
Get a file 'F' representation of an identification of a file.
|
SftpFileRef |
toFile(String folder,
String filename)
Creates a reference to a file.
|
close, configure, openClient, setAuthAlias, setHost, setKnownHostsPath, setName, setPassword, setPort, setPrefCSEncryption, setPrefSCEncryption, setPrivateKeyAuthAlias, setPrivateKeyFilePath, setPrivateKeyPassword, setProxyAuthAlias, setProxyHost, setProxyPassword, setProxyPort, setProxyTransportType, setProxyUsername, setStrictHostKeyChecking, setUsername
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
configure
getDomain
getName
getApplicationContext, getName
getConfigurationClassLoader
public void open() throws FileSystemException
open
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public void close()
close
in interface IBasicFileSystem<SftpFileRef>
close
in class SftpSession
public boolean isOpen()
isOpen
in interface IBasicFileSystem<SftpFileRef>
public SftpFileRef toFile(String filename) throws FileSystemException
IBasicFileSystem
IBasicFileSystem.getName(Object)
.toFile
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public SftpFileRef toFile(String folder, String filename) throws FileSystemException
IBasicFileSystem
toFile
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public int getNumberOfFilesInFolder(String folder) throws FileSystemException
getNumberOfFilesInFolder
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public DirectoryStream<SftpFileRef> listFiles(String folder) throws FileSystemException
IBasicFileSystem
listFiles
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public boolean exists(SftpFileRef file) throws FileSystemException
exists
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public OutputStream createFile(SftpFileRef f) throws FileSystemException, IOException
createFile
in interface IWritableFileSystem<SftpFileRef>
FileSystemException
IOException
public OutputStream appendFile(SftpFileRef f) throws FileSystemException
appendFile
in interface IWritableFileSystem<SftpFileRef>
FileSystemException
public Message readFile(SftpFileRef f, String charset) throws FileSystemException
readFile
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public void deleteFile(SftpFileRef f) throws FileSystemException
deleteFile
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public boolean folderExists(String folder) throws FileSystemException
folderExists
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public void createFolder(String folder) throws FileSystemException
createFolder
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public void removeFolder(String folder, boolean removeNonEmptyFolder) throws FileSystemException
removeFolder
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public SftpFileRef renameFile(SftpFileRef source, SftpFileRef destination) throws FileSystemException
IWritableFileSystem
renameFile
in interface IWritableFileSystem<SftpFileRef>
FileSystemException
public SftpFileRef moveFile(SftpFileRef 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<SftpFileRef>
resultantMustBeReturned
- TODOFileSystemException
public SftpFileRef copyFile(SftpFileRef 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<SftpFileRef>
resultantMustBeReturned
- TODOFileSystemException
public long getFileSize(SftpFileRef f) throws FileSystemException
getFileSize
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public String getName(SftpFileRef file)
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<SftpFileRef>
public String getParentFolder(SftpFileRef file) throws FileSystemException
getParentFolder
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public String getCanonicalName(SftpFileRef f)
getCanonicalName
in interface IBasicFileSystem<SftpFileRef>
public Date getModificationTime(SftpFileRef f) throws FileSystemException
getModificationTime
in interface IBasicFileSystem<SftpFileRef>
FileSystemException
public Map<String,Object> getAdditionalFileProperties(SftpFileRef f)
getAdditionalFileProperties
in interface IBasicFileSystem<SftpFileRef>
public String getPhysicalDestinationName()
getPhysicalDestinationName
in interface HasPhysicalDestination
public void setRemoteDirectory(String remoteDirectory)
Copyright © 2023 Frank!Framework. All rights reserved.