Convert plugin loading code to use Path

All of the internal scanning/loading code now uses Path, as do the
plugin and data directories in SitePaths. For backwards compatibility,
we still inject the @PluginData directory as a File. We do break
backwards compatibility of the ServerPluginProvider extension point,
under the theory that there should be very few such extensions and
they can handle the pain.

Tested:
-Installed and reloaded cookbook plugin multiple times.
-Expanded dynamic *.ssh plugin loading in the cookbook, with
 monkey-testing.

Change-Id: I5212d248d9288b88d08731c9854b42196999aa73
This commit is contained in:
Dave Borowitz
2015-02-24 10:17:04 -08:00
parent 05b1ae22d5
commit 9e158756e5
17 changed files with 350 additions and 293 deletions

View File

@@ -27,11 +27,15 @@ import java.lang.annotation.Target;
* <p>
* A plugin or extension may receive this string by Guice injection to discover
* a directory where it can store configuration or other data that is private:
* <p>
* This binding is on both {@link java.io.File} and {@link java.nio.file.Path},
* pointing to the same location. The {@code File} version should be considered
* deprecated and may be removed in a future version.
*
* <pre>
* {@literal @Inject}
* MyType(@PluginData java.io.File myDir) {
* new FileInputStream(new File(myDir, &quot;my.config&quot;));
* MyType(@PluginData java.nio.file.Path myDir) {
* this.in = Files.newInputStream(myDir.resolve(&quot;my.config&quot;));
* }
* </pre>
*/