public class DefaultScpFileOpener extends AbstractLoggingBean implements ScpFileOpener
Modifier and Type | Field and Description |
---|---|
private static java.nio.file.OpenOption[] |
DEFAULT_SYNC_OPTIONS |
static DefaultScpFileOpener |
INSTANCE |
log
DEFAULT_AUTO_SYNC_FILE_ON_WRITE, PROP_AUTO_SYNC_FILE_ON_WRITE
Constructor and Description |
---|
DefaultScpFileOpener() |
Modifier and Type | Method and Description |
---|---|
ScpSourceStreamResolver |
createScpSourceStreamResolver(Session session,
java.nio.file.Path path) |
ScpTargetStreamResolver |
createScpTargetStreamResolver(Session session,
java.nio.file.Path path) |
java.io.InputStream |
openRead(Session session,
java.nio.file.Path file,
long size,
java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
java.nio.file.OpenOption... options)
Create an input stream to read from a file
|
java.io.OutputStream |
openWrite(Session session,
java.nio.file.Path file,
long size,
java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
java.nio.file.OpenOption... options)
Create an output stream to write to a file
|
protected java.nio.file.OpenOption[] |
resolveOpenOptions(Session session,
java.nio.file.Path file,
long size,
java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions,
java.nio.file.OpenOption... options) |
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
closeRead, closeWrite, getLocalBasicFileAttributes, getLocalFilePermissions, getLocalFolderChildren, getMatchingFilesToSend, resolveIncomingFilePath, resolveIncomingReceiveLocation, resolveLocalPath, resolveOutgoingFilePath, sendAsDirectory, sendAsRegularFile, updateFileProperties
public static final DefaultScpFileOpener INSTANCE
private static final java.nio.file.OpenOption[] DEFAULT_SYNC_OPTIONS
public java.io.InputStream openRead(Session session, java.nio.file.Path file, long size, java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions, java.nio.file.OpenOption... options) throws java.io.IOException
ScpFileOpener
openRead
in interface ScpFileOpener
session
- The Session
requesting the accessfile
- The requested local file Path
size
- The expected transfer bytes countpermissions
- The requested file permissionsoptions
- The OpenOption
s - may be null
/emptyInputStream
never null
java.io.IOException
- If failed to open the filepublic java.io.OutputStream openWrite(Session session, java.nio.file.Path file, long size, java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions, java.nio.file.OpenOption... options) throws java.io.IOException
ScpFileOpener
openWrite
in interface ScpFileOpener
session
- The Session
requesting the accessfile
- The requested local file Path
size
- The expected transfer byte countpermissions
- The requested file permissionsoptions
- The OpenOption
s - may be null
/emptyOutputStream
never null
java.io.IOException
- If failed to open the fileprotected java.nio.file.OpenOption[] resolveOpenOptions(Session session, java.nio.file.Path file, long size, java.util.Set<java.nio.file.attribute.PosixFilePermission> permissions, java.nio.file.OpenOption... options) throws java.io.IOException
java.io.IOException
public ScpSourceStreamResolver createScpSourceStreamResolver(Session session, java.nio.file.Path path) throws java.io.IOException
createScpSourceStreamResolver
in interface ScpFileOpener
java.io.IOException
public ScpTargetStreamResolver createScpTargetStreamResolver(Session session, java.nio.file.Path path) throws java.io.IOException
createScpTargetStreamResolver
in interface ScpFileOpener
java.io.IOException