Class DefaultScpFileOpener
java.lang.Object
org.apache.sshd.common.util.logging.AbstractLoggingBean
org.apache.sshd.scp.common.helpers.DefaultScpFileOpener
- All Implemented Interfaces:
ScpFileOpener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final OpenOption[]
static final DefaultScpFileOpener
Fields inherited from class org.apache.sshd.common.util.logging.AbstractLoggingBean
log
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateScpSourceStreamResolver
(Session session, Path path) createScpTargetStreamResolver
(Session session, Path path) openRead
(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) Create an input stream to read from a fileopenWrite
(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) Create an output stream to write to a fileprotected OpenOption[]
resolveOpenOptions
(Session session, Path file, long size, Set<PosixFilePermission> permissions, 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 Details
-
INSTANCE
-
DEFAULT_SYNC_OPTIONS
-
-
Constructor Details
-
DefaultScpFileOpener
public DefaultScpFileOpener()
-
-
Method Details
-
openRead
public InputStream openRead(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws 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:
IOException
- If failed to open the file
-
openWrite
public OutputStream openWrite(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws 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:
IOException
- If failed to open the file
-
resolveOpenOptions
protected OpenOption[] resolveOpenOptions(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException - Throws:
IOException
-
createScpSourceStreamResolver
public ScpSourceStreamResolver createScpSourceStreamResolver(Session session, Path path) throws IOException - Specified by:
createScpSourceStreamResolver
in interfaceScpFileOpener
- Throws:
IOException
-
createScpTargetStreamResolver
public ScpTargetStreamResolver createScpTargetStreamResolver(Session session, Path path) throws IOException - Specified by:
createScpTargetStreamResolver
in interfaceScpFileOpener
- Throws:
IOException
-