From 7f6a75230f6a811e2409dc710aac2189f28351f5 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Tue, 20 May 2014 22:31:55 +0000 Subject: [PATCH] final URLConnection url_connection = url.openConnection(); url_connection.setDefaultUseCaches( false ); --- forester/java/src/org/forester/archaeopteryx/AptxUtil.java | 5 ++++- forester/java/src/org/forester/msa_compactor/MsaCompactor.java | 6 ++++++ forester/java/src/org/forester/util/ForesterUtil.java | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java index c56d068..1a6b0a5 100644 --- a/forester/java/src/org/forester/archaeopteryx/AptxUtil.java +++ b/forester/java/src/org/forester/archaeopteryx/AptxUtil.java @@ -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 ) { diff --git a/forester/java/src/org/forester/msa_compactor/MsaCompactor.java b/forester/java/src/org/forester/msa_compactor/MsaCompactor.java index 81f22da..8f0ea1b 100644 --- a/forester/java/src/org/forester/msa_compactor/MsaCompactor.java +++ b/forester/java/src/org/forester/msa_compactor/MsaCompactor.java @@ -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, diff --git a/forester/java/src/org/forester/util/ForesterUtil.java b/forester/java/src/org/forester/util/ForesterUtil.java index 899e775..84be63a 100644 --- a/forester/java/src/org/forester/util/ForesterUtil.java +++ b/forester/java/src/org/forester/util/ForesterUtil.java @@ -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() + "]" ); -- 1.7.10.2