make pathHelper final + renamed exists() -> statExistence()

This commit is contained in:
Shikhar Bhushan
2010-03-26 00:49:07 +01:00
parent 53389e6989
commit 25a18c6fd7
2 changed files with 6 additions and 6 deletions

View File

@@ -33,7 +33,7 @@ public class SFTPClient {
private final SFTPEngine sftp;
private final SFTPFileTransfer xfer;
private PathHelper pathHelper;
private final PathHelper pathHelper;
public SFTPClient(SessionFactory ssh)
throws IOException {
@@ -91,7 +91,7 @@ public class SFTPClient {
final Stack<String> dirsToMake = new Stack<String>();
for (PathComponents current = pathHelper.getComponents(path); ; current = pathHelper
.getComponents(current.getParent())) {
final FileAttributes attrs = exists(current.getPath());
final FileAttributes attrs = statExistence(current.getPath());
if (attrs == null) {
dirsToMake.push(current.getPath());
} else if (attrs.getType() != FileMode.Type.DIRECTORY) {
@@ -105,7 +105,7 @@ public class SFTPClient {
}
}
public FileAttributes exists(String path)
public FileAttributes statExistence(String path)
throws IOException {
try {
return sftp.stat(path);

View File

@@ -40,7 +40,7 @@ public class StatefulSFTPClient
public synchronized void cd(String dirname)
throws IOException {
cwd = cwdify(dirname);
if (exists(cwd) == null) {
if (statExistence(cwd) == null) {
throw new SFTPException(cwd + ": does not exist");
}
log.info("CWD = " + cwd);
@@ -109,9 +109,9 @@ public class StatefulSFTPClient
}
@Override
public FileAttributes exists(String path)
public FileAttributes statExistence(String path)
throws IOException {
return super.exists(cwdify(path));
return super.statExistence(cwdify(path));
}
@Override