- public URL getCanonicalUrl(URL source) throws IOException {
- if (source.getPath().startsWith("/view")) {
- source = new URL(source.toString() + "/guest");
- InputStream in = Instance.getCache().open(source, this, false);
- String line = getLine(in, "/browse/folder/", 0);
- if (line != null) {
- String[] tab = line.split("\"");
- if (tab.length > 1) {
- String groupUrl = source.getProtocol() + "://"
- + source.getHost() + tab[1];
- return guest(groupUrl);
+ public URL getCanonicalUrl(URL source) {
+ try {
+ if (source.getPath().startsWith("/view")) {
+ source = guest(source.toString());
+ // NO CACHE because we don't want the NotLoggedIn message later
+ InputStream in = Instance.getInstance().getCache().openNoCache(source, this, null, null, null);
+ String line = getLine(in, "/browse/folder/", 0);
+ if (line != null) {
+ String[] tab = line.split("\"");
+ if (tab.length > 1) {
+ String groupUrl = source.getProtocol() + "://"
+ + source.getHost() + tab[1];
+ return guest(groupUrl);
+ }