public final class AbstractFileSystem
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
AbstractFileSystem.OpenDirectory |
protected class |
AbstractFileSystem.OpenFile |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
AUTHORIZED_KEYS_STORE |
protected AbstractFileFactory<?> |
fileFactory |
static int |
OPEN_APPEND
File open flag, forces all writes to append data at the end of the file.
|
static int |
OPEN_CREATE
File open flag, if specified a new file will be created if one does not
already exist.
|
static int |
OPEN_EXCLUSIVE
File open flag, causes an open request to fail if the named file already
exists.
|
static int |
OPEN_READ
File open flag, opens the file for reading.
|
static int |
OPEN_TEXT
Indicates the server should treat the file as text and convert
it to the canoncial newline convention in use.
|
static int |
OPEN_TRUNCATE
File open flag, forces an existing file with the same name to be
truncated to zero length when creating a file by specifying OPEN_CREATE.
|
static int |
OPEN_WRITE
File open flag, opens the file for writing.
|
protected java.util.Map<java.lang.String,AbstractFileSystem.OpenDirectory> |
openDirectories |
protected java.util.Map<java.lang.String,AbstractFileSystem.OpenFile> |
openFiles |
static java.lang.String |
SCP |
static java.lang.String |
SFTP |
static java.lang.String |
SHELL |
| Constructor and Description |
|---|
AbstractFileSystem(SshConnection con,
java.lang.String protocolInUse) |
| Modifier and Type | Method and Description |
|---|---|
void |
closeFile(byte[] handle) |
boolean |
closeFile(byte[] handle,
boolean remove) |
protected boolean |
closeFile(java.lang.String handle,
boolean remove) |
void |
closeFilesystem() |
void |
copyFile(java.lang.String oldpath,
java.lang.String newpath,
boolean overwrite) |
void |
createSymbolicLink(java.lang.String link,
java.lang.String target) |
boolean |
fileExists(java.lang.String path) |
SshConnection |
getConnection() |
java.lang.String |
getDefaultPath() |
SftpFileAttributes |
getFileAttributes(byte[] handle) |
SftpFileAttributes |
getFileAttributes(java.lang.String path) |
AbstractFileFactory<?> |
getFileFactory() |
AbstractFile |
getFileForHandle(byte[] handle) |
protected java.lang.String |
getHandle(byte[] b) |
protected byte[] |
getHandle(java.lang.String handle) |
java.lang.String |
getPathForHandle(byte[] handle) |
java.lang.String |
getRealPath(java.lang.String path) |
void |
init(SshConnection con,
java.lang.String protocolInUse) |
boolean |
makeDirectory(java.lang.String path,
SftpFileAttributes attrs) |
byte[] |
openDirectory(java.lang.String path) |
byte[] |
openDirectory(java.lang.String path,
SftpFileFilter filter) |
byte[] |
openFile(java.lang.String path,
com.sshtools.common.util.UnsignedInteger32 flags,
SftpFileAttributes attrs) |
void |
populateEvent(Event evt) |
SftpFile[] |
readDirectory(byte[] handle) |
int |
readFile(byte[] handle,
com.sshtools.common.util.UnsignedInteger64 offset,
byte[] buf,
int start,
int numBytesToRead) |
SftpFile |
readSymbolicLink(java.lang.String link) |
void |
removeDirectory(java.lang.String path) |
void |
removeFile(java.lang.String path) |
void |
renameFile(java.lang.String oldpath,
java.lang.String newpath) |
protected AbstractFile |
resolveFile(java.lang.String path,
SshConnection con) |
void |
setFileAttributes(byte[] handle,
SftpFileAttributes attrs) |
void |
setFileAttributes(java.lang.String path,
SftpFileAttributes attrs) |
void |
writeFile(byte[] handle,
com.sshtools.common.util.UnsignedInteger64 offset,
byte[] data,
int off,
int len) |
public static final int OPEN_READ
public static final int OPEN_WRITE
public static final int OPEN_APPEND
public static final int OPEN_CREATE
public static final int OPEN_TRUNCATE
public static final int OPEN_EXCLUSIVE
public static final int OPEN_TEXT
public static final java.lang.String AUTHORIZED_KEYS_STORE
public static final java.lang.String SFTP
public static final java.lang.String SCP
public static final java.lang.String SHELL
protected java.util.Map<java.lang.String,AbstractFileSystem.OpenFile> openFiles
protected java.util.Map<java.lang.String,AbstractFileSystem.OpenDirectory> openDirectories
protected AbstractFileFactory<?> fileFactory
public AbstractFileSystem(SshConnection con, java.lang.String protocolInUse) throws java.io.IOException, PermissionDeniedException
java.io.IOExceptionPermissionDeniedExceptionpublic AbstractFileFactory<?> getFileFactory()
public void init(SshConnection con, java.lang.String protocolInUse)
protected AbstractFile resolveFile(java.lang.String path, SshConnection con) throws PermissionDeniedException, java.io.IOException
PermissionDeniedExceptionjava.io.IOExceptionpublic void closeFilesystem()
public boolean makeDirectory(java.lang.String path,
SftpFileAttributes attrs)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic SftpFileAttributes getFileAttributes(byte[] handle) throws java.io.IOException, InvalidHandleException, PermissionDeniedException
java.io.IOExceptionInvalidHandleExceptionPermissionDeniedExceptionpublic SftpFileAttributes getFileAttributes(java.lang.String path) throws java.io.IOException, java.io.FileNotFoundException, PermissionDeniedException
java.io.IOExceptionjava.io.FileNotFoundExceptionPermissionDeniedExceptionpublic byte[] openDirectory(java.lang.String path)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic byte[] openDirectory(java.lang.String path,
SftpFileFilter filter)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionprotected byte[] getHandle(java.lang.String handle)
protected java.lang.String getHandle(byte[] b)
public SftpFile[] readDirectory(byte[] handle) throws InvalidHandleException, java.io.EOFException, java.io.IOException, PermissionDeniedException
InvalidHandleExceptionjava.io.EOFExceptionjava.io.IOExceptionPermissionDeniedExceptionpublic byte[] openFile(java.lang.String path,
com.sshtools.common.util.UnsignedInteger32 flags,
SftpFileAttributes attrs)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic int readFile(byte[] handle,
com.sshtools.common.util.UnsignedInteger64 offset,
byte[] buf,
int start,
int numBytesToRead)
throws InvalidHandleException,
java.io.EOFException,
java.io.IOException,
PermissionDeniedException
InvalidHandleExceptionjava.io.EOFExceptionjava.io.IOExceptionPermissionDeniedExceptionpublic void writeFile(byte[] handle,
com.sshtools.common.util.UnsignedInteger64 offset,
byte[] data,
int off,
int len)
throws InvalidHandleException,
java.io.IOException,
PermissionDeniedException
InvalidHandleExceptionjava.io.IOExceptionPermissionDeniedExceptionpublic void closeFile(byte[] handle)
throws InvalidHandleException,
java.io.IOException
InvalidHandleExceptionjava.io.IOExceptionpublic boolean closeFile(byte[] handle,
boolean remove)
throws InvalidHandleException,
java.io.IOException
InvalidHandleExceptionjava.io.IOExceptionprotected boolean closeFile(java.lang.String handle,
boolean remove)
throws InvalidHandleException,
java.io.IOException
InvalidHandleExceptionjava.io.IOExceptionpublic void removeFile(java.lang.String path)
throws PermissionDeniedException,
java.io.IOException,
java.io.FileNotFoundException
PermissionDeniedExceptionjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic void renameFile(java.lang.String oldpath,
java.lang.String newpath)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void copyFile(java.lang.String oldpath,
java.lang.String newpath,
boolean overwrite)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic java.lang.String getDefaultPath()
throws java.io.IOException,
PermissionDeniedException
java.io.IOExceptionPermissionDeniedExceptionpublic void removeDirectory(java.lang.String path)
throws PermissionDeniedException,
java.io.FileNotFoundException,
java.io.IOException
PermissionDeniedExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionpublic void setFileAttributes(java.lang.String path,
SftpFileAttributes attrs)
throws PermissionDeniedException,
java.io.IOException,
java.io.FileNotFoundException
PermissionDeniedExceptionjava.io.IOExceptionjava.io.FileNotFoundExceptionpublic void setFileAttributes(byte[] handle,
SftpFileAttributes attrs)
throws PermissionDeniedException,
java.io.IOException,
InvalidHandleException
PermissionDeniedExceptionjava.io.IOExceptionInvalidHandleExceptionpublic SftpFile readSymbolicLink(java.lang.String link) throws UnsupportedFileOperationException, java.io.FileNotFoundException, java.io.IOException, PermissionDeniedException
UnsupportedFileOperationExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionPermissionDeniedExceptionpublic void createSymbolicLink(java.lang.String link,
java.lang.String target)
throws UnsupportedFileOperationException,
java.io.FileNotFoundException,
java.io.IOException,
PermissionDeniedException
UnsupportedFileOperationExceptionjava.io.FileNotFoundExceptionjava.io.IOExceptionPermissionDeniedExceptionpublic boolean fileExists(java.lang.String path)
throws java.io.IOException,
PermissionDeniedException
java.io.IOExceptionPermissionDeniedExceptionpublic java.lang.String getRealPath(java.lang.String path)
throws java.io.IOException,
java.io.FileNotFoundException,
PermissionDeniedException
java.io.IOExceptionjava.io.FileNotFoundExceptionPermissionDeniedExceptionpublic AbstractFile getFileForHandle(byte[] handle) throws java.io.IOException, InvalidHandleException
java.io.IOExceptionInvalidHandleExceptionpublic void populateEvent(Event evt)
public SshConnection getConnection()
public java.lang.String getPathForHandle(byte[] handle)
throws java.io.IOException,
InvalidHandleException
java.io.IOExceptionInvalidHandleExceptionCopyright © 2022. All rights reserved.