You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
Java
62 lines
1.5 KiB
Java
package de.unibremen.informatik.hets.graphviz;
|
|
|
|
//import org.apache.log4j.Logger;
|
|
|
|
import java.io.*;
|
|
|
|
/**
|
|
* User: matthewhorridge<br>
|
|
* The Univeristy Of Manchester<br>
|
|
* Medical Informatics Group<br>
|
|
* Date: May 18, 2004<br><br>
|
|
* <p/>
|
|
* matthew.horridge@cs.man.ac.uk<br>
|
|
* www.cs.man.ac.uk/~horridgm<br><br>
|
|
*/
|
|
public class DotPreParser
|
|
{
|
|
//private static Logger logger = Logger.getLogger(DotPreParser.class);
|
|
|
|
public static String preParse(InputStream is) {
|
|
try {
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
|
|
StringWriter sr = new StringWriter();
|
|
|
|
try
|
|
{
|
|
String line = br.readLine();
|
|
|
|
while(line != null)
|
|
{
|
|
|
|
if(line.endsWith("\\"))
|
|
{
|
|
// We need to concatenate the next line
|
|
|
|
while(line.endsWith("\\"))
|
|
{
|
|
sr.write(line.substring(0, line.length() - 1));
|
|
|
|
line = br.readLine();
|
|
}
|
|
}
|
|
|
|
sr.write(line);
|
|
|
|
line = br.readLine();
|
|
}
|
|
}
|
|
catch(IOException e)
|
|
{
|
|
//logger.error(e);
|
|
}
|
|
return sr.toString();
|
|
}
|
|
catch (UnsupportedEncodingException e) {
|
|
//logger.error(e);
|
|
}
|
|
return null;
|
|
}
|
|
}
|
|
|