mirror of
https://github.com/TeamAmaze/AmazeFileManager.git
synced 2026-10-17 05:08:00 +08:00
Changed per codacy feedback
- changed variable scope in SshConnectionPool.ConnectionInfo - use extra temp variable for SshClientUtils.deriveSftpPathFrom()
This commit is contained in:
@@ -296,10 +296,11 @@ public abstract class SshClientUtils {
|
||||
@Nullable String password,
|
||||
@Nullable KeyPair selectedParsedKeyPair) {
|
||||
// FIXME: should be caller's responsibility
|
||||
if (defaultPath == null) defaultPath = "/";
|
||||
String pathSuffix = defaultPath;
|
||||
if (pathSuffix == null) pathSuffix = "/";
|
||||
return (selectedParsedKeyPair != null || password == null)
|
||||
? String.format("ssh://%s@%s:%d%s", username, hostname, port, defaultPath)
|
||||
: String.format("ssh://%s:%s@%s:%d%s", username, password, hostname, port, defaultPath);
|
||||
? String.format("ssh://%s@%s:%d%s", username, hostname, port, pathSuffix)
|
||||
: String.format("ssh://%s:%s@%s:%d%s", username, password, hostname, port, pathSuffix);
|
||||
}
|
||||
|
||||
public static boolean isDirectory(@NonNull SFTPClient client, @NonNull RemoteResourceInfo info)
|
||||
|
||||
@@ -260,11 +260,11 @@ public class SshConnectionPool {
|
||||
*/
|
||||
static final class ConnectionInfo {
|
||||
|
||||
final String host;
|
||||
final int port;
|
||||
final String username;
|
||||
final String password;
|
||||
final String defaultPath;
|
||||
protected final String host;
|
||||
protected final int port;
|
||||
protected final String username;
|
||||
protected final String password;
|
||||
protected final String defaultPath;
|
||||
|
||||
// FIXME: Crude assumption
|
||||
ConnectionInfo(@NonNull String url) {
|
||||
|
||||
Reference in New Issue
Block a user