final URLConnection url_connection = url.openConnection();
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Tue, 20 May 2014 22:31:55 +0000 (22:31 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Tue, 20 May 2014 22:31:55 +0000 (22:31 +0000)
        url_connection.setDefaultUseCaches( false );

forester/java/src/org/forester/archaeopteryx/AptxUtil.java
forester/java/src/org/forester/msa_compactor/MsaCompactor.java
forester/java/src/org/forester/util/ForesterUtil.java

index c56d068..1a6b0a5 100644 (file)
@@ -40,6 +40,7 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.net.URI;
 import java.net.URL;
+import java.net.URLConnection;
 import java.text.ParseException;
 import java.util.Arrays;
 import java.util.HashSet;
@@ -680,7 +681,9 @@ public final class AptxUtil {
             }
         }
         AptxUtil.printAppletMessage( "Archaeopteryx", "parser is " + parser.getName() );
-        final InputStream i = url.openStream();
+        final URLConnection url_connection = url.openConnection();
+        url_connection.setDefaultUseCaches( false );
+        final InputStream i = url_connection.getInputStream();
         final Phylogeny[] phys = factory.create( i, parser );
         i.close();
         if ( phys != null ) {
index 81f22da..8f0ea1b 100644 (file)
@@ -556,6 +556,12 @@ public class MsaCompactor {
         return gappiness;
     }
 
+    private final Phylogeny collapse( final Msa msa, final int threshold ) {
+        final BasicSymmetricalDistanceMatrix m = PairwiseDistanceCalculator.calcFractionalDissimilarities( msa );
+        //TODO
+        return null;
+    }
+
     private final Phylogeny inferNJphylogeny( final PWD_DISTANCE_METHOD pwd_distance_method,
                                               final Msa msa,
                                               final boolean write_matrix,
index 899e775..84be63a 100644 (file)
@@ -41,6 +41,7 @@ import java.io.StringReader;
 import java.io.Writer;
 import java.math.BigDecimal;
 import java.net.URL;
+import java.net.URLConnection;
 import java.text.DateFormat;
 import java.text.DecimalFormat;
 import java.text.DecimalFormatSymbols;
@@ -463,7 +464,9 @@ public final class ForesterUtil {
             reader = new BufferedReader( new StringReader( source.toString() ) );
         }
         else if ( source instanceof URL ) {
-            reader = new BufferedReader( new InputStreamReader( ( ( URL ) source ).openStream() ) );
+            final URLConnection url_connection = ( ( URL ) source ).openConnection();
+            url_connection.setDefaultUseCaches( false );
+            reader = new BufferedReader( new InputStreamReader( url_connection.getInputStream() ) );
         }
         else {
             throw new IllegalArgumentException( "dont know how to read [" + source.getClass() + "]" );