Class DefaultScpFileOpener
- java.lang.Object
-
- org.apache.sshd.common.util.logging.AbstractLoggingBean
-
- org.apache.sshd.scp.common.helpers.DefaultScpFileOpener
-
- All Implemented Interfaces:
ScpFileOpener
public class DefaultScpFileOpener extends AbstractLoggingBean implements ScpFileOpener
-
-
Field Summary
Fields Modifier and Type Field Description private static java.nio.file.OpenOption[]
DEFAULT_SYNC_OPTIONS
static DefaultScpFileOpener
INSTANCE
-
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
-
Constructor Summary
Constructors Constructor Description DefaultScpFileOpener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 filejava.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 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)
-
Methods inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
debug, debug, debug, debug, debug, error, error, error, error, error, getSimplifiedLogger, info, info, warn, warn, warn, warn, warn, warn, warn, warn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.sshd.scp.common.ScpFileOpener
closeRead, closeWrite, getLocalBasicFileAttributes, getLocalFilePermissions, getLocalFolderChildren, getMatchingFilesToSend, resolveIncomingFilePath, resolveIncomingReceiveLocation, resolveLocalPath, resolveOutgoingFilePath, sendAsDirectory, sendAsRegularFile
-
-
-
-
Field Detail
-
INSTANCE
public static final DefaultScpFileOpener INSTANCE
-
DEFAULT_SYNC_OPTIONS
private static final java.nio.file.OpenOption[] DEFAULT_SYNC_OPTIONS
-
-
Method Detail
-
openRead
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
Description copied from interface:ScpFileOpener
Create an input stream to read from a file- Specified by:
openRead
in interfaceScpFileOpener
- Parameters:
session
- TheSession
requesting the accessfile
- The requested local filePath
size
- The expected transfer bytes countpermissions
- The requested file permissionsoptions
- TheOpenOption
s - may benull
/empty- Returns:
- The open
InputStream
nevernull
- Throws:
java.io.IOException
- If failed to open the file
-
openWrite
public 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
Description copied from interface:ScpFileOpener
Create an output stream to write to a file- Specified by:
openWrite
in interfaceScpFileOpener
- Parameters:
session
- TheSession
requesting the accessfile
- The requested local filePath
size
- The expected transfer byte countpermissions
- The requested file permissionsoptions
- TheOpenOption
s - may benull
/empty- Returns:
- The open
OutputStream
nevernull
- Throws:
java.io.IOException
- If failed to open the file
-
resolveOpenOptions
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) throws java.io.IOException
- Throws:
java.io.IOException
-
createScpSourceStreamResolver
public ScpSourceStreamResolver createScpSourceStreamResolver(Session session, java.nio.file.Path path) throws java.io.IOException
- Specified by:
createScpSourceStreamResolver
in interfaceScpFileOpener
- Throws:
java.io.IOException
-
createScpTargetStreamResolver
public ScpTargetStreamResolver createScpTargetStreamResolver(Session session, java.nio.file.Path path) throws java.io.IOException
- Specified by:
createScpTargetStreamResolver
in interfaceScpFileOpener
- Throws:
java.io.IOException
-
-