Top Fields Constructors Methods
org.apache.sshd.scp.common.helpers

public Class DefaultScpFileOpener

extends AbstractLoggingBean
implements ScpFileOpener
Class Inheritance
All Implemented Interfaces
org.apache.sshd.scp.common.ScpFileOpener
Imports
java.io.IOException, .InputStream, .OutputStream, java.nio.file.Files, .OpenOption, .Path, .StandardOpenOption, java.nio.file.attribute.PosixFilePermission, java.util.Arrays, .Set, java.util.stream.Stream, org.apache.sshd.common.session.Session, org.apache.sshd.common.util.GenericUtils, org.apache.sshd.common.util.logging.AbstractLoggingBean, org.apache.sshd.scp.ScpModuleProperties, org.apache.sshd.scp.common.ScpFileOpener, .ScpSourceStreamResolver, .ScpTargetStreamResolver

Author
Apache MINA SSHD Project

Field Summary

Modifier and TypeField and Description
private static final OpenOption[]
public static final DefaultScpFileOpener
Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
log

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public ScpSourceStreamResolver
public ScpTargetStreamResolver
public InputStream
openRead(Session
The Session requesting the access
session
,
Path
The requested local file Path
file
,
long
The expected transfer bytes count
size
,
Set<PosixFilePermission>
The requested file permissions
permissions
,
OpenOption...
The OpenOptions - may be null/empty
options
)

Implements org.apache.sshd.scp.common.ScpFileOpener.openRead.

Create an input stream to read from a file

public OutputStream
openWrite(Session
The Session requesting the access
session
,
Path
The requested local file Path
file
,
long
The expected transfer byte count
size
,
Set<PosixFilePermission>
The requested file permissions
permissions
,
OpenOption...
The OpenOptions - may be null/empty
options
)

Implements org.apache.sshd.scp.common.ScpFileOpener.openWrite.

Create an output stream to write to a file

protected OpenOption[]
resolveOpenOptions(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options)

Inherited from org.apache.sshd.common.util.logging.AbstractLoggingBean:
debugdebugdebugdebugdebugerrorerrorerrorerrorerrorgetSimplifiedLoggerinfoinfowarnwarnwarnwarnwarnwarnwarnwarn

Field Detail

DEFAULT_SYNC_OPTIONSback to summary
private static final OpenOption[] DEFAULT_SYNC_OPTIONS
INSTANCEback to summary
public static final DefaultScpFileOpener INSTANCE

Constructor Detail

DefaultScpFileOpenerback to summary
public DefaultScpFileOpener()

Method Detail

createScpSourceStreamResolverback to summary
public ScpSourceStreamResolver createScpSourceStreamResolver(Session session, Path path) throws IOException

Implements org.apache.sshd.scp.common.ScpFileOpener.createScpSourceStreamResolver.

Annotations
@Override
createScpTargetStreamResolverback to summary
public ScpTargetStreamResolver createScpTargetStreamResolver(Session session, Path path) throws IOException

Implements org.apache.sshd.scp.common.ScpFileOpener.createScpTargetStreamResolver.

Annotations
@Override
openReadback to summary
public InputStream openRead(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException

Implements org.apache.sshd.scp.common.ScpFileOpener.openRead.

Doc from org.apache.sshd.scp.common.ScpFileOpener.openRead.

Create an input stream to read from a file

Parameters
session:Session

The Session requesting the access

file:Path

The requested local file Path

size:long

The expected transfer bytes count

permissions:Set<PosixFilePermission>

The requested file permissions

options:OpenOption[]

The OpenOptions - may be null/empty

Returns:InputStream

The open InputStream never null

Annotations
@Override
Exceptions
IOException:
If failed to open the file
openWriteback to summary
public OutputStream openWrite(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException

Implements org.apache.sshd.scp.common.ScpFileOpener.openWrite.

Doc from org.apache.sshd.scp.common.ScpFileOpener.openWrite.

Create an output stream to write to a file

Parameters
session:Session

The Session requesting the access

file:Path

The requested local file Path

size:long

The expected transfer byte count

permissions:Set<PosixFilePermission>

The requested file permissions

options:OpenOption[]

The OpenOptions - may be null/empty

Returns:OutputStream

The open OutputStream never null

Annotations
@Override
Exceptions
IOException:
If failed to open the file
resolveOpenOptionsback to summary
protected OpenOption[] resolveOpenOptions(Session session, Path file, long size, Set<PosixFilePermission> permissions, OpenOption... options) throws IOException