| getResource |
(String name) |
yoix.system |
| |
Returns a string that represents the location (as a URL) of the resource
,IR name ,
which should be a slash separated path that does not begin with a slash.
If the resource is not found
NULL
is returned.
A resource is any data (e.g., an image or a Yoix script) that is often packaged
up with an application and included in its jar file.
The resource data can be accessed by handing the string returned by
getResource
to
open
and then using builtins like
read
or
readStream
to read the data.
| |
| Example: |
The program
import yoix.*.*;
if ((path = getResource("att/research/yoix/resources/system/splashscreen.yx")) != NULL) {
if ((stream = open(path, "r")) != NULL) {
write(stdout, readStream(stream));
close(stream);
}
}
prints the script used to implement the Yoix splash screen on standard output.
| | |
| Return: |
String
| | |
| See Also: |
open,
URL
|
|
Yoix is a registered trademark of AT&T Inc.
|