FELIX-1269 FELIX-1387 cumulative patch submitted by Sahoo

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@795957 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
index ec628fb..8ada1de 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/DirectoryWatcher.java
@@ -714,7 +714,9 @@
             InputStream in = new FileInputStream(file);
             try
             {
-                bundle = context.installBundle(path, in);
+                // Some users wanted the location to be a URI (See FELIX-1269)
+                final String location = file.toURI().normalize().toString();
+                bundle = context.installBundle(location, in);
             }
             finally
             {
@@ -786,7 +788,6 @@
             bundle.update(in);
             startupFailures.remove(bundle);
             jar.setLastModified(bundle.getLastModified());
-            jar.setLength(file.length());
             log("Updated " + jar.getPath(), null);
             return bundle;
         }
diff --git a/fileinstall/src/main/java/org/apache/felix/fileinstall/Jar.java b/fileinstall/src/main/java/org/apache/felix/fileinstall/Jar.java
index ecf59b6..aa18cfc 100644
--- a/fileinstall/src/main/java/org/apache/felix/fileinstall/Jar.java
+++ b/fileinstall/src/main/java/org/apache/felix/fileinstall/Jar.java
@@ -36,7 +36,6 @@
 class Jar
 {
     private String path;
-    private long length = -1;
     private long lastModified = -1;
     private long bundleId = -1;
 
@@ -49,14 +48,13 @@
         // /tmp/foo and /tmp//foo differently.
         path = file.toURI().normalize().getPath();
         lastModified = file.lastModified();
-        length = file.length();
     }
 
     Jar(Bundle b) throws URISyntaxException
     {
         // Convert to a URI because the location of a bundle
         // is typically a URI. At least, that's the case for
-        // autostart bundles.
+        // autostart bundles and bundles installed by fileinstall.
         // Normalisation is needed to ensure that we don't treat (e.g.)
         // /tmp/foo and /tmp//foo differently.
         String location = b.getLocation();
@@ -94,16 +92,6 @@
         this.lastModified = lastModified;
     }
 
-    public long getLength()
-    {
-        return length;
-    }
-
-    public void setLength(long length)
-    {
-        this.length = length;
-    }
-
     public long getBundleId()
     {
         return bundleId;