keep it as close with archy.js as possible...
[jalview.git] / forester / java / src / org / forester / io / parsers / tol / TolParser.java
index de48b4c..7801c38 100644 (file)
@@ -96,6 +96,12 @@ public class TolParser implements PhylogenyParser {
                 break;
             }
         }
+        try {
+            zip_file.close();
+        }
+        catch ( final Exception e ) {
+            // Ignore.
+        }
         return reader;
     }
 
@@ -174,7 +180,7 @@ public class TolParser implements PhylogenyParser {
                     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 ) );
                 }
@@ -194,7 +200,7 @@ public class TolParser implements PhylogenyParser {
                     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 ) );
                 }
@@ -218,7 +224,7 @@ public class TolParser implements PhylogenyParser {
         }
         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() );
@@ -285,4 +291,9 @@ public class TolParser implements PhylogenyParser {
             _warning_messages.append( "[line: " + e.getLineNumber() + "] " + e.getMessage() );
         }
     }
+
+    @Override
+    public String getName() {
+        return "ToL Parser";
+    }
 }
\ No newline at end of file