| java.lang.Object net.refractions.udig.core.internal.Data
Data | public class Data (Code) | | Utility methods for dealing with class data, included with jar.
Data should be located in a folder with a dash in the name, similar to the javadoc "doc-files"
convention. This ensures that data directories don't look anything like normal java packages.
Example:
class MyClass {
public ImageDescriptor example() {
return ImageDescriptor.create(TestData.url(this, "test-data/test.png")).getImage();
}
}
Where:
- MyClass.java
-
- test-data/test.png
By convention you should try and locate data near the class that uses it.
See Also: TestData author: Jody Garnett since: 0.7.0 |
file | final public static File file(Object caller, String path) throws IOException(Code) | | Access to url(caller, path) as a
File .
Data.file(this, null)
Parameters: caller - Calling object used to locate data Parameters: path - Path to file in testdata File throws: IOException - if the file is not found. |
file | final public static File file(Class caller, String path) throws IOException(Code) | | Access to url(caller, path) as a
File .
Data.file(this, null)
Parameters: caller - Calling class used to locate data Parameters: path - Path to file in testdata File throws: IOException - if the file is not found. |
reader | final public static BufferedReader reader(Class caller, String name) throws IOException(Code) | | Provided a
BufferedReader for named test data. It is the caller responsability to
close this reader after usage.
Parameters: caller - The class of the object associated with named data. Parameters: name - of test data to load. The reader, or null if the named test data are not found. throws: IOException - if an error occurs during an input operation. |
reader | final public static BufferedReader reader(Object host, String name) throws IOException(Code) | | Provided a
BufferedReader for named test data. It is the caller responsability to
close this reader after usage.
Parameters: host - Object associated with named data Parameters: name - of test data to load The reader, or null if the named test data are not found. throws: IOException - if an error occurs during an input operation. |
temp | final public static File temp(Object caller, String name) throws IOException(Code) | | Creates a temporary file with the given name.
Parameters: caller - Parameters: name - File if available for name throws: IOException - |
url | final public static URL url(Class caller, String name)(Code) | | Locate named test-data resource for caller.
Parameters: caller - Class used to locate test-data. Parameters: name - name of test-data. URL or null of named test-data could not be found. |
url | final public static URL url(Object caller, String name)(Code) | | Locate named test-data resource for caller.
Parameters: caller - Object used to locate test-data Parameters: name - name of test-data URL or null of named test-data could not be found |
|
|