Fixes https://github.com/eclipse/sisu.inject/pull/4

Add a new system property 'sisu.url.caches' to explicitly turn off
URL caching regardless of the OS. If this property is not set then
caching is only turned off on Windows.

Co-authored-by: Aleksey Dobrynin
diff --git a/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/Streams.java b/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/Streams.java
index 2362f3d..476bfa7 100644
--- a/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/Streams.java
+++ b/org.eclipse.sisu.inject/src/org/eclipse/sisu/space/Streams.java
@@ -27,23 +27,32 @@
 
     static
     {
-        boolean onWindows;
+        boolean useCaches;
         try
         {
-            onWindows = System.getProperty( "os.name" ).toLowerCase( Locale.US ).contains( "windows" );
+            String urlCaches = System.getProperty( "sisu.url.caches" );
+            if ( null != urlCaches && !urlCaches.isEmpty() )
+            {
+                useCaches = Boolean.parseBoolean( urlCaches );
+            }
+            else
+            {
+                String osName = System.getProperty( "os.name" ).toLowerCase( Locale.US );
+                useCaches = !osName.contains( "windows" );
+            }
         }
         catch ( final RuntimeException e )
         {
-            onWindows = false;
+            useCaches = true;
         }
-        ON_WINDOWS = onWindows;
+        USE_CACHES = useCaches;
     }
 
     // ----------------------------------------------------------------------
     // Constants
     // ----------------------------------------------------------------------
 
-    private static final boolean ON_WINDOWS;
+    private static final boolean USE_CACHES;
 
     // ----------------------------------------------------------------------
     // Constructors
@@ -59,17 +68,19 @@
     // ----------------------------------------------------------------------
 
     /**
-     * Opens an input stream to the given URL; disables JAR caching on Windows.
+     * Opens an input stream to the given URL; disables JAR caching on Windows
+     * or when the 'sisu.url.caches' system property is set to {@code false}.
      */
     public static InputStream open( final URL url )
         throws IOException
     {
-        if ( ON_WINDOWS )
+        if ( USE_CACHES )
         {
-            final URLConnection conn = url.openConnection();
-            conn.setUseCaches( false );
-            return conn.getInputStream();
+            return url.openStream();
         }
-        return url.openStream();
+
+        final URLConnection conn = url.openConnection();
+        conn.setUseCaches( false );
+        return conn.getInputStream();
     }
 }