/* * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) * Copyright (C) $$Year-Rel$$ 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. * * 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 . * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.util; import static jalview.util.UrlConstants.DB_ACCESSION; import static jalview.util.UrlConstants.DELIM; //import static jalview.util.UrlConstants.EMBLEBI_LABEL; //import static jalview.util.UrlConstants.EMBLEBI_STRING; import static jalview.util.UrlConstants.SEP; import static jalview.util.UrlConstants.SEQUENCE_ID; //import static jalview.util.UrlConstants.SRS_LABEL; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.StringTokenizer; import java.util.Vector; /** * * Implements the UrlProviderI interface for a UrlProvider object which serves * custom URLs defined by the user * * @author $author$ * @version $Revision$ */ public class CustomUrlProvider extends UrlProviderImpl { // minimum length of substitution in url link string private static final int MIN_SUBST_LENGTH = 4; // Default sequence URL link label for SRS private static final String SRS_LABEL = "SRS"; // map of string ids to urlLinks private HashMap urls; /** * Construct UrlProvider for custom (user-entered) URLs * * @param cachedUrlList * list of URLs in form stored in Cache. i.e. SEP delimited string */ public CustomUrlProvider(String cachedUrlList) { try { urls = new HashMap(); // cachedUrlList is in form