// Copyright (C) 2008-2009 Christian M. Zmasek
// Copyright (C) 2008-2009 Burnham Institute for Medical Research
// All rights reserved
-//
+//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
-//
+//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
package org.forester.io.parsers.tol;
break;
}
}
+ try {
+ zip_file.close();
+ }
+ catch ( final Exception e ) {
+ // Ignore.
+ }
return reader;
}
return _zipped_inputstream;
}
+ @Override
public Phylogeny[] parse() throws IOException, PhylogenyParserException {
reset();
final TolXmlHandler handler = new TolXmlHandler();
final Reader reader = getReaderFromZipFile();
if ( reader == null ) {
throw new PhylogenyParserException( "Zip file \"" + getSource()
- + "\" appears not to contain any entries" );
+ + "\" appears not to contain any entries" );
}
xml_reader.parse( new InputSource( reader ) );
}
final Reader reader = new InputStreamReader( zip_is );
if ( reader == null ) {
throw new PhylogenyParserException( "Zip input stream \"" + getSource()
- + "\" appears not to contain any data" );
+ + "\" appears not to contain any data" );
}
xml_reader.parse( new InputSource( reader ) );
}
}
catch ( final ParserConfigurationException parser_config_exception ) {
throw new PhylogenyParserException( "Failed to parse [" + getSource()
- + "] Problem with xml parser _configuration: " + parser_config_exception.getMessage() );
+ + "] Problem with xml parser _configuration: " + parser_config_exception.getMessage() );
}
catch ( final IOException e ) {
throw new PhylogenyParserException( "Problem with input source [" + getSource() + "]: \n" + e.getMessage() );
_warning_messages = new StringBuffer();
}
+ @Override
public void setSource( final Object source ) {
_source = source;
}
_warning_messages.append( "[line: " + e.getLineNumber() + "] " + e.getMessage() );
}
}
+
+ @Override
+ public String getName() {
+ return "ToL Parser";
+ }
}
\ No newline at end of file