X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fws%2FDbSourceProxyImpl.java;fp=src%2Fjalview%2Fws%2FDbSourceProxyImpl.java;h=0000000000000000000000000000000000000000;hb=6b406c397d41a0f2d84b75f13e7ab478932bf57d;hp=17040d4360a66fef68edf8ec44e9667dfe574270;hpb=ce886100c1eae01eac7d59c961e694f4493d4bcb;p=jalview.git diff --git a/src/jalview/ws/DbSourceProxyImpl.java b/src/jalview/ws/DbSourceProxyImpl.java deleted file mode 100644 index 17040d4..0000000 --- a/src/jalview/ws/DbSourceProxyImpl.java +++ /dev/null @@ -1,96 +0,0 @@ -package jalview.ws; - -import jalview.datamodel.Alignment; -import jalview.datamodel.DBRefSource; -import jalview.io.FormatAdapter; -import jalview.io.IdentifyFile; - -import java.util.Hashtable; - -/** - * common methods for implementations of the DbSourceProxy interface. - * - * @author JimP - * - */ -public abstract class DbSourceProxyImpl implements DbSourceProxy -{ - public DbSourceProxyImpl() - { - // default constructor - do nothing probably. - } - private Hashtable props=null; - /* (non-Javadoc) - * @see jalview.ws.DbSourceProxy#getDbSourceProperties() - */ - public Hashtable getDbSourceProperties() - { - return props; - } - protected void addDbSourceProperty(Object propname) - { - addDbSourceProperty(propname, propname); - } - - protected void addDbSourceProperty(Object propname, Object propvalue) - { - if (props==null) - { - props = new Hashtable(); - } - props.put(propname, propvalue); - } - boolean queryInProgress=false; - protected StringBuffer results = null; - /* - * (non-Javadoc) - * - * @see jalview.ws.DbSourceProxy#getRawRecords() - */ - public StringBuffer getRawRecords() - { - return results; - } - - /* (non-Javadoc) - * @see jalview.ws.DbSourceProxy#queryInProgress() - */ - public boolean queryInProgress() - { - return queryInProgress; - } - /** - * call to set the queryInProgress flag - * - */ - protected void startQuery() - { - queryInProgress=true; - } - /** - * call to clear the queryInProgress flag - * - */ - protected void stopQuery() - { - queryInProgress=false; - } - - /** - * create an alignment from raw text file... - * @param result - * @return null or a valid alignment - * @throws Exception - */ - protected Alignment parseResult(String result) throws Exception { - Alignment sequences = null; - String format = new IdentifyFile().Identify(result, "Paste"); - if (FormatAdapter.isValidFormat(format)) - { - sequences = new FormatAdapter().readFile(result.toString(), "Paste", - format); - } - return sequences; - } - -}