Skip to content
Snippets Groups Projects
Commit 5ddc7921 authored by tjc's avatar tjc
Browse files

encode gff

git-svn-id: svn+ssh://svn.internal.sanger.ac.uk/repos/svn/pathsoft/artemis/trunk@3239 ee4ac58c-ac51-4696-9907-e4b3aa274f04
parent 3f3a6f40
No related branches found
No related tags found
No related merge requests found
......@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFStreamFeature.java,v 1.16 2005-06-08 15:19:38 tjc Exp $
* $Header: //tmp/pathsoft/artemis/uk/ac/sanger/artemis/io/GFFStreamFeature.java,v 1.17 2005-07-20 13:28:24 tjc Exp $
*/
package uk.ac.sanger.artemis.io;
......@@ -35,7 +35,7 @@ import java.util.StringTokenizer;
* A StreamFeature that thinks it is a GFF feature.
*
* @author Kim Rutherford
* @version $Id: GFFStreamFeature.java,v 1.16 2005-06-08 15:19:38 tjc Exp $
* @version $Id: GFFStreamFeature.java,v 1.17 2005-07-20 13:28:24 tjc Exp $
**/
public class GFFStreamFeature extends SimpleDocumentFeature
......@@ -295,7 +295,7 @@ public class GFFStreamFeature extends SimpleDocumentFeature
* Add URL escaping rule (e.g. space="%20" or "+")
*
*/
private String encode(String s)
public static String encode(String s)
{
final String map[][] = {
// { " ", "%20" }, // white space
......
......@@ -24,6 +24,7 @@
package uk.ac.sanger.artemis.util;
import uk.ac.sanger.artemis.io.GFFStreamFeature;
import java.sql.*;
import java.io.*;
import java.util.Hashtable;
......@@ -264,14 +265,17 @@ public class DatabaseDocument extends Document
cdsBuffer.append("Parent="+parent_id+";");
cdsBuffer.append("timelastmodified="+timelastmodified+";");
cdsBuffer.append(propTypeName+"="+rs.getString("value")); // attributes
String value = GFFStreamFeature.encode(rs.getString("value"));
cdsBuffer.append(propTypeName+"="+value); // attributes
int rewind = 0;
while(rs.next() && rs.getString("uniquename").equals(name))
{
prop_type_id = rs.getLong("prop_type_id");
propTypeName = getCvtermName(conn,prop_type_id);
cdsBuffer.append(";"+propTypeName+"="+rs.getString("value"));
value = GFFStreamFeature.encode(rs.getString("value"));
cdsBuffer.append(";"+propTypeName+"="+value);
rewind++;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment