X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fws%2Frest%2FRestServiceDescription.java;h=311a9222547004a99a8087928cb40c40fc5bc925;hb=eb9c652416a69e6db0531e956dd2011012eac898;hp=e7c861f48d1f243187790055747ce4875dd241db;hpb=10e637daad8983c41db8679baabea5563d7371f4;p=jalview.git diff --git a/src/jalview/ws/rest/RestServiceDescription.java b/src/jalview/ws/rest/RestServiceDescription.java index e7c861f..311a922 100644 --- a/src/jalview/ws/rest/RestServiceDescription.java +++ b/src/jalview/ws/rest/RestServiceDescription.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.9.0b1) + * Copyright (C) 2015 The Jalview Authors * * This file is part of Jalview. * @@ -20,6 +20,13 @@ */ package jalview.ws.rest; +import jalview.datamodel.SequenceI; +import jalview.io.packed.DataProvider.JvDataType; +import jalview.util.StringUtils; +import jalview.ws.rest.params.Alignment; +import jalview.ws.rest.params.AnnotationFile; +import jalview.ws.rest.params.SeqGroupIndexVector; + import java.net.URL; import java.util.ArrayList; import java.util.HashMap; @@ -31,16 +38,10 @@ import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; -import jalview.datamodel.SequenceI; -import jalview.io.packed.DataProvider.JvDataType; -import jalview.util.StringUtils; -import jalview.ws.rest.params.Alignment; -import jalview.ws.rest.params.AnnotationFile; -import jalview.ws.rest.params.SeqGroupIndexVector; - public class RestServiceDescription { - private static final Pattern PARAM_ENCODED_URL_PATTERN = Pattern.compile("([?&])([A-Za-z0-9_]+)=\\$([^$]+)\\$"); + private static final Pattern PARAM_ENCODED_URL_PATTERN = Pattern + .compile("([?&])([A-Za-z0-9_]+)=\\$([^$]+)\\$"); /** * create a new rest service description ready to be configured @@ -490,7 +491,8 @@ public class RestServiceDescription ; vls.add(new String("gapCharacter='" + gapCharacter + "'")); vls.add(new String("returns='" + _genOutputFormatString() + "'")); - return StringUtils.arrayToSeparatorList(vls.toArray(new String[0]), ","); + return StringUtils + .arrayToSeparatorList(vls.toArray(new String[0]), ","); } public String toString() @@ -634,8 +636,8 @@ public class RestServiceDescription url.append("$"); url.append(param.getValue().getURLtokenPrefix()); url.append(":"); - url.append(StringUtils.arrayToSeparatorList(vals.toArray(new String[0]), - ",")); + url.append(StringUtils.arrayToSeparatorList( + vals.toArray(new String[0]), ",")); url.append("$"); } } @@ -661,8 +663,7 @@ public class RestServiceDescription boolean valid = true; int lastp = 0; String url = new String(); - Matcher prms = PARAM_ENCODED_URL_PATTERN - .matcher(ipurl); + Matcher prms = PARAM_ENCODED_URL_PATTERN.matcher(ipurl); Map iparams = new Hashtable(); InputType jinput; while (prms.find()) @@ -704,8 +705,7 @@ public class RestServiceDescription public static Class[] getInputTypes() { // TODO - find a better way of maintaining this classlist - return new Class[] - { jalview.ws.rest.params.Alignment.class, + return new Class[] { jalview.ws.rest.params.Alignment.class, jalview.ws.rest.params.AnnotationFile.class, SeqGroupIndexVector.class, jalview.ws.rest.params.SeqIdVector.class, @@ -727,7 +727,8 @@ public class RestServiceDescription if (iprm.equalsIgnoreCase(jinput.getURLtokenPrefix())) { ArrayList al = new ArrayList(); - for (String prprm : StringUtils.separatorListToArray(iprmparams, ",")) + for (String prprm : StringUtils.separatorListToArray(iprmparams, + ",")) { // hack to ensure that strings like "sep=','" containing unescaped // commas as values are concatenated