Document how plugins can get access to a data directory
Commit a252ee599dd5c7ee88dc42ad37065032f06f0de5 introduced the
@PluginData annotation which allows a plugin to get access to a data
directory in which the plugin can story any data it wants. This feature
was only described in the commit message. Add this description to the
plugin documentation.
Change-Id: Ic695f5e6280785a77300b3fc0913189ee8d67254
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
diff --git a/Documentation/dev-plugins.txt b/Documentation/dev-plugins.txt
index e6c332e..b583db3 100644
--- a/Documentation/dev-plugins.txt
+++ b/Documentation/dev-plugins.txt
@@ -248,6 +248,22 @@
$ curl http://review.example.com/plugins/helloworld/print
----
+Data Directory
+--------------
+
+Plugins can request a data directory with a `@PluginData` File
+dependency. A data directory will be created automatically by the
+server in `$site_path/data/$plugin_name` and passed to the plugin.
+
+Plugins can use this to store any data they want.
+
+====
+ @Inject
+ MyType(@PluginData java.io.File myDir) {
+ new FileInputStream(new File(myDir, "my.config"));
+ }
+====
+
Documentation
-------------