]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.utils/src/org/simantics/utils/TempFiles.java
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.utils / src / org / simantics / utils / TempFiles.java
diff --git a/bundles/org.simantics.utils/src/org/simantics/utils/TempFiles.java b/bundles/org.simantics.utils/src/org/simantics/utils/TempFiles.java
new file mode 100644 (file)
index 0000000..0194ee9
--- /dev/null
@@ -0,0 +1,36 @@
+package org.simantics.utils;\r
+\r
+import java.io.File;\r
+\r
+public interface TempFiles {\r
+\r
+    /**\r
+     * @return the directory containing all temporary file names generated by\r
+     *         this instance.\r
+     */\r
+    public File getRoot();\r
+\r
+    /**\r
+     * @param directory\r
+     *            possible directory under {@link #getRoot()}\r
+     * @param suffix\r
+     *            suffix of generated temporary file name without the '.'\r
+     *            character separating the random start and the extension\r
+     *            (suffix)\r
+     * @return temporary file with a random name that ends in\r
+     *         <code>suffix</code> and is contained by a directory under\r
+     *         {@link #getRoot()} with the name <code>directory</code>\r
+     */\r
+    public File getTempfile(String directory, String suffix);\r
+\r
+    /**\r
+     * Create a new TempFiles instance that will produce temporary file names in\r
+     * a specified subdirectory of this TempFiles location.\r
+     * \r
+     * @param directory\r
+     * @return the sub-TempFiles instance\r
+     * @since 1.16\r
+     */\r
+    public TempFiles subdirectory(String directory);\r
+\r
+}\r