Skip to content

Commit

Permalink
Fix #8721.
Browse files Browse the repository at this point in the history
Former-commit-id: 88baf48cb4f6357005e3f13efe8cedbb82377023
  • Loading branch information
dkocher committed May 30, 2015
1 parent b08a652 commit e986115
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions source/ch/cyberduck/core/irods/IRODSSession.java
Expand Up @@ -97,20 +97,26 @@ protected IRODSFileSystem configure(final IRODSFileSystem client) {
return client;
}

protected String getRegion() {
if(StringUtils.contains(host.getRegion(), ':')) {
return StringUtils.splitPreserveAllTokens(host.getRegion(), ':')[0];
}
return host.getRegion();
}

protected String getResource() {
if(StringUtils.contains(host.getRegion(), ':')) {
return StringUtils.splitPreserveAllTokens(host.getRegion(), ':')[1];
}
return StringUtils.EMPTY;
}

@Override
public void login(final PasswordStore keychain, final LoginCallback prompt, final CancelCallback cancel,
final Cache<Path> cache) throws BackgroundException {
try {
final String region;
final String resource;
if(StringUtils.contains(host.getRegion(), ':')) {
region = StringUtils.splitPreserveAllTokens(host.getRegion(), ':')[0];
resource = StringUtils.splitPreserveAllTokens(host.getRegion(), ':')[1];
}
else {
region = host.getRegion();
resource = StringUtils.EMPTY;
}
final String region = this.getRegion();
final String resource = this.getResource();
final IRODSAccount account = IRODSAccount.instance(host.getHostname(), host.getPort(),
host.getCredentials().getUsername(), host.getCredentials().getPassword(),
this.workdir().getAbsolute(), region, resource);
Expand Down Expand Up @@ -189,7 +195,7 @@ public final IRODSFileSystemAO filesystem() {
@Override
public Path workdir() {
return new Path(new StringBuilder()
.append(Path.DELIMITER).append(host.getRegion())
.append(Path.DELIMITER).append(this.getRegion())
.append(Path.DELIMITER).append("home")
.append(Path.DELIMITER).append(host.getCredentials().getUsername())
.toString(), EnumSet.of(Path.Type.directory, Path.Type.volume));
Expand Down

0 comments on commit e986115

Please sign in to comment.