FELIX-1787: fileinstall relies on location to be a valid URL for update to be successful

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@828014 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
index b7c82e9..e670363 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/internal/DirectoryWatcher.java
@@ -903,6 +903,7 @@
             // if the listener is an url transformer
             else if (artifact.getListener() instanceof ArtifactUrlTransformer)
             {
+                URL transformed = artifact.getTransformedUrl();
                 bundle = context.getBundle(artifact.getBundleId());
                 if (bundle == null)
                 {
@@ -913,7 +914,15 @@
                     return null;
                 }
                 Util.storeChecksum(bundle, artifact.getChecksum(), context);
-                bundle.update();
+                InputStream in = (transformed != null) ? transformed.openStream() : new FileInputStream(path);
+                try
+                {
+                    bundle.update(in);
+                }
+                finally
+                {
+                    in.close();
+                }
             }
             // else we need to ask for an update on the bundle
             else if (artifact.getListener() instanceof ArtifactTransformer)