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 org.apache.sshd.common.util.logging.AbstractLoggingBean implements ScpFileOpener
- Author:
- Apache MINA SSHD Project
-
-
Field Summary
Fields Modifier and Type Field Description static DefaultScpFileOpenerINSTANCE
-
Constructor Summary
Constructors Constructor Description DefaultScpFileOpener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ScpSourceStreamResolvercreateScpSourceStreamResolver(Session session, Path path)ScpTargetStreamResolvercreateScpTargetStreamResolver(Session session, Path path)InputStreamopenRead(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options)Create an input stream to read from a fileOutputStreamopenWrite(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 Detail
-
INSTANCE
public static final DefaultScpFileOpener INSTANCE
-
-
Method Detail
-
openRead
public InputStream openRead(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException
Description copied from interface:ScpFileOpenerCreate an input stream to read from a file- Specified by:
openReadin interfaceScpFileOpener- Parameters:
session- TheSessionrequesting the accessfile- The requested local filePathsize- The expected transfer bytes countpermissions- The requested file permissionsoptions- TheOpenOptions - may benull/empty- Returns:
- The open
InputStreamnevernull - 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:ScpFileOpenerCreate an output stream to write to a file- Specified by:
openWritein interfaceScpFileOpener- Parameters:
session- TheSessionrequesting the accessfile- The requested local filePathsize- The expected transfer byte countpermissions- The requested file permissionsoptions- TheOpenOptions - may benull/empty- Returns:
- The open
OutputStreamnevernull - 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:
createScpSourceStreamResolverin interfaceScpFileOpener- Throws:
IOException
-
createScpTargetStreamResolver
public ScpTargetStreamResolver createScpTargetStreamResolver(Session session, Path path) throws IOException
- Specified by:
createScpTargetStreamResolverin interfaceScpFileOpener- Throws:
IOException
-
-