]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.utils/src/org/simantics/utils/TempFiles.java
Fixed multiple issues causing dangling references to discarded queries
[simantics/platform.git] / bundles / org.simantics.utils / src / org / simantics / utils / TempFiles.java
1 package org.simantics.utils;
2
3 import java.io.File;
4
5 public interface TempFiles {
6
7     /**
8      * @return the directory containing all temporary file names generated by
9      *         this instance.
10      */
11     public File getRoot();
12
13     /**
14      * @param directory
15      *            possible directory under {@link #getRoot()}
16      * @param suffix
17      *            suffix of generated temporary file name without the '.'
18      *            character separating the random start and the extension
19      *            (suffix)
20      * @return temporary file with a random name that ends in
21      *         <code>suffix</code> and is contained by a directory under
22      *         {@link #getRoot()} with the name <code>directory</code>
23      */
24     public File getTempfile(String directory, String suffix);
25
26     /**
27      * Create a new TempFiles instance that will produce temporary file names in
28      * a specified subdirectory of this TempFiles location.
29      * 
30      * @param directory
31      * @return the sub-TempFiles instance
32      * @since 1.16
33      */
34     public TempFiles subdirectory(String directory);
35
36 }