X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2Fdbsources%2Fdas%2Fdatamodel%2FDasSourceRegistry.java;h=88d9db1a25d98600d731a7775f11a00e554245e2;hb=ab43013b7e357b84b4abade0dba949668dfb2a0e;hp=9d044bc5cf94a0ade1a9dd83c99de45787c16b80;hpb=ad20cd92225f2ee8c251d39b00b90555d382a616;p=jalview.git diff --git a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java index 9d044bc..88d9db1 100644 --- a/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java +++ b/src/jalview/ws/dbsources/das/datamodel/DasSourceRegistry.java @@ -1,19 +1,22 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8) - * Copyright (C) 2012 J Procter, AM Waterhouse, LM Lui, J Engelhardt, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1) + * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * as published by the Free Software Foundation, either version 3 + * of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * You should have received a copy of the GNU General Public License + * along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.ws.dbsources.das.datamodel; @@ -178,13 +181,21 @@ public class DasSourceRegistry implements DasSourceRegistryI, { // get local sources from properties and initialise the local source list String local = jalview.bin.Cache.getProperty("DAS_LOCAL_SOURCE"); + if (local != null) { + int n = 1; StringTokenizer st = new StringTokenizer(local, "\t"); while (st.hasMoreTokens()) { String token = st.nextToken(); int bar = token.indexOf("|"); + if (bar == -1) + { + System.err + .println("Warning: DAS user local source appears to have no nickname (expected a '|' followed by nickname)\nOffending definition: '" + + token + "'"); + } String url = token.substring(bar + 1); boolean features = true, sequence = false; if (url.startsWith("sequence:")) @@ -193,8 +204,25 @@ public class DasSourceRegistry implements DasSourceRegistryI, // this source also serves sequences as well as features sequence = true; } - createLocalSource(url, token.substring(0, bar), sequence, - features); + try + { + if (bar > -1) + { + createLocalSource(url, token.substring(0, bar), sequence, + features); + } + else + { + createLocalSource(url, "User Source" + n, sequence, features); + } + } catch (Exception q) + { + System.err + .println("Unexpected exception when creating local source from '" + + token + "'"); + q.printStackTrace(); + } + n++; } } }