Fixed creation of store URIs when a "path" was used.

This commit is contained in:
cketti 2011-11-29 21:45:52 +01:00
parent 9350a3b1b6
commit d6fbeb2913
2 changed files with 4 additions and 4 deletions

View file

@ -280,9 +280,9 @@ public class ImapStore extends Store {
String userInfo = authType.toString() + ":" + userEnc + ":" + passwordEnc; String userInfo = authType.toString() + ":" + userEnc + ":" + passwordEnc;
try { try {
Map<String, String> extra = server.getExtra(); Map<String, String> extra = server.getExtra();
String prefix = (extra != null) ? extra.get(ImapStoreSettings.PATH_PREFIX_KEY) : null; String path = (extra != null) ? "/" + extra.get(ImapStoreSettings.PATH_PREFIX_KEY) : null;
return new URI(scheme, userInfo, server.host, server.port, return new URI(scheme, userInfo, server.host, server.port,
prefix, path,
null, null).toString(); null, null).toString();
} catch (URISyntaxException e) { } catch (URISyntaxException e) {
throw new IllegalArgumentException("Can't create ImapStore URI", e); throw new IllegalArgumentException("Can't create ImapStore URI", e);

View file

@ -242,9 +242,9 @@ public class WebDavStore extends Store {
authPath = (authPath != null) ? authPath : ""; authPath = (authPath != null) ? authPath : "";
String mailboxPath = extra.get(WebDavStoreSettings.MAILBOX_PATH_KEY); String mailboxPath = extra.get(WebDavStoreSettings.MAILBOX_PATH_KEY);
mailboxPath = (mailboxPath != null) ? mailboxPath : ""; mailboxPath = (mailboxPath != null) ? mailboxPath : "";
uriPath = path + "|" + authPath + "|" + mailboxPath; uriPath = "/" + path + "|" + authPath + "|" + mailboxPath;
} else { } else {
uriPath = "||"; uriPath = "/||";
} }
try { try {