FELIX-1862: fileinstall thread name as printed in log messages need to be less verbose
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@891575 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 ffce643..186fe52 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
@@ -118,7 +118,7 @@
public DirectoryWatcher(Dictionary properties, BundleContext context)
{
- super(properties.toString());
+ super("fileinstall-" + getThreadName(properties));
this.properties = properties;
this.context = context;
poll = getLong(properties, POLL, 2000);
@@ -150,6 +150,10 @@
scanner = new Scanner(watchedDirectory, flt);
}
+ public static String getThreadName(Dictionary properties) {
+ return (properties.get(DIR) != null ? properties.get(DIR) : "./load").toString();
+ }
+
public Dictionary getProperties() {
return properties;
}