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:
@@ -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, "my.config"));
|
||||
* MyType(@PluginData java.nio.file.Path myDir) {
|
||||
* this.in = Files.newInputStream(myDir.resolve("my.config"));
|
||||
* }
|
||||
* </pre>
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user