import org.biojava.dasobert.dasregistry.*;
import org.xml.sax.*;
-public class DasSourceReaderImpl
- implements DasSourceReader
+public class DasSourceReaderImpl implements DasSourceReader
{
Exception loggedException;
// open the stream to a server and then parse the result ...
}
- private InputStream open(URL url)
- throws java.io.IOException, java.net.ConnectException
+ private InputStream open(URL url) throws java.io.IOException,
+ java.net.ConnectException
{
InputStream inStream = null;
InputStream stream = open(url);
sources = readDasSource(stream);
- }
- catch (Exception e)
+ } catch (Exception e)
{
+ System.err.println("Exception for url:"+url);
e.printStackTrace();
loggedException = e;
}
return sources;
}
- /** read a DAS2 sources response and return a list of DAS sources.
- *
+ /**
+ * read a DAS2 sources response and return a list of DAS sources.
+ *
*/
public DasSource[] readDasSource(InputStream stream)
{
try
{
- SAXParserFactory spfactory =
- SAXParserFactory.newInstance();
+ SAXParserFactory spfactory = SAXParserFactory.newInstance();
spfactory.setValidating(false);
try
{
- saxParser =
- spfactory.newSAXParser();
- }
- catch (ParserConfigurationException e)
+ saxParser = spfactory.newSAXParser();
+ } catch (ParserConfigurationException e)
{
e.printStackTrace();
loggedException = e;
XMLReader xmlreader = saxParser.getXMLReader();
- //XMLReader xmlreader = XMLReaderFactory.createXMLReader();
+ // XMLReader xmlreader = XMLReaderFactory.createXMLReader();
try
{
xmlreader.setFeature("http://xml.org/sax/features/validation",
- validation);
- }
- catch (SAXException e)
+ validation);
+ } catch (SAXException e)
{
- //logger.log(Level.FINE,"Cannot set validation " + validation);
+ // logger.log(Level.FINE,"Cannot set validation " + validation);
}
try
{
- xmlreader.setFeature(
- "http://apache.org/xml/features/nonvalidating/load-external-dtd",
- validation);
- }
- catch (SAXNotRecognizedException e)
+ xmlreader
+ .setFeature(
+ "http://apache.org/xml/features/nonvalidating/load-external-dtd",
+ validation);
+ } catch (SAXNotRecognizedException e)
{
e.printStackTrace();
- //logger.log(Level.FINE,"Cannot set load-external-dtd "+validation);
+ // logger.log(Level.FINE,"Cannot set load-external-dtd "+validation);
}
xmlreader.parse(insource);
sources = cont_handle.getSources();
- }
- catch (Exception e)
+ } catch (Exception e)
{
e.printStackTrace();
loggedException = e;
System.out.println(ds.toString());
}
- }
- catch (Exception e)
+ } catch (Exception e)
{
e.printStackTrace();
}