if (format instanceof RGroupQueryFormat ) {
cor = new RGroupQueryReader();
cor.setReader(input);
}
else if (format instanceof CMLFormat ) {
cor = new CMLReader(urlString);
cor.setReader(url.openStream());
}
else if (format instanceof MDLV2000Format ) {
cor = new MDLV2000Reader(getReader(url));
cor.setReader(input);
}
// SMILES format is never guessed :(
//else if (format instanceof SMILESFormat ) {
// cor = new SMILESReader(getReader(url));
// cor.setReader(input);
//}
//InChI format is never guessed :(
//else if (format instanceof INChIPlainTextFormat ) {
// cor = new INChIPlainTextReader(getReader(url));
// cor.setReader(input);
//}
}
} catch (Exception exc) {
exc.printStackTrace();
}
if (cor == null) {
// try to determine from user's guess
type = ext;
if (type.equals(JCPFileFilter.cml)|| type.equals(JCPFileFilter.xml)) {
cor = new CMLReader(urlString);
} else if (type.equals(JCPFileFilter.sdf)) {
cor = new MDLV2000Reader(getReader(url));
} else if (type.equals(JCPFileFilter.mol)) {
cor = new MDLV2000Reader(getReader(url));