Clover coverage report -
Coverage timestamp: Fri Nov 19 2004 13:41:51 PST
file stats: LOC: 37   Methods: 2
NCLOC: 31   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
RdfTools.java 0% 20% 50% 16%
coverage coverage
 1    package photospace.meta.rdf;
 2   
 3    import java.io.*;
 4    import org.apache.commons.logging.*;
 5    import com.hp.hpl.jena.rdf.model.*;
 6   
 7    public class RdfTools
 8    implements java.io.Serializable
 9    {
 10    private static final Log log = LogFactory.getLog(RdfTools.class);
 11   
 12    public static final String RDF_START = "<rdf:RDF";
 13    public static final String RDF_END = "</rdf:RDF>";
 14   
 15  0 public static String getRdfString(String str)
 16    {
 17  0 if (str == null) return null;
 18  0 int start = str.indexOf(RDF_START);
 19  0 int end = str.indexOf(RDF_END);
 20  0 if (start == -1) return null;
 21  0 if (end == -1) return null;
 22  0 if (end < start)
 23    {
 24  0 log.warn(RDF_END + " is before " + RDF_START);
 25  0 return null;
 26    }
 27  0 return str.substring(start, end + RDF_END.length());
 28    }
 29   
 30  1 public static String toString(Model model)
 31    {
 32  1 ByteArrayOutputStream out = new ByteArrayOutputStream();
 33  1 model.write(out, "RDF/XML-ABBREV");
 34  1 return out.toString();
 35    }
 36   
 37    }