public class ImagePath extends Object
Modifier and Type | Class and Description |
---|---|
static class |
ImagePath.PathEntry
represents an imagepath entry
|
Constructor and Description |
---|
ImagePath() |
Modifier and Type | Method and Description |
---|---|
static boolean |
add(String mainPath)
create a new PathEntry from the given absolute path name and add it to the
end of the current image path
for usage with jars see; add(String, String) |
static boolean |
add(String mainPath,
String altPath)
create a new PathEntry from the given absolute path name and add it to the
end of the current image path
for images stored in jars: Set the primary image path to the top folder level of a jar based on the given class name (must be found on class path). |
static void |
add(URL pURL)
add entry to end of list (the given URL is not checked)
|
static boolean |
addHTTP(String pathHTTP)
create a new PathEntry from the given net resource folder accessible via HTTP at
end of the current image path
BE AWARE: Files stored in the given remote folder must allow HTTP HEAD-requests (checked) redirections are not followed (suppressed) |
static boolean |
addJar(String fpJar,
String fpImage) |
static void |
dump(int lvl)
print the list of path entries
|
static URL |
find(String fname)
try to find the given relative image file name on the image path
starting from entry 0, the first found existence is taken absolute file names are checked for existence |
static String[] |
get()
the path list as string array
|
static String |
getBundleFolder()
no trailing path separator
|
static String |
getBundlePath()
no trailing path separator
|
static String |
getBundlePathSet()
no trailing path separator
|
static String |
getPath(int ix) |
static List<ImagePath.PathEntry> |
getPaths()
get the list of path entries (as PathEntry)
|
static boolean |
isImageBundled(URL fURL) |
static BufferedReader |
open(String fname)
given absolute or relative (searched on image path) file name
is tried to open as a BufferedReader BE AWARE: use br.close() when finished |
static boolean |
remove(String path)
remove entry with given path (same as given with add)
|
static boolean |
removeHTTP(String pathHTTP) |
static boolean |
reset()
empty path list and keep bundlePath (entry 0)
Image cache is cleared completely convenience for the scripting level |
static boolean |
reset(String path)
empty path list and add given path as first entry
Image cache is cleared completely
|
static boolean |
setBundlePath(String bPath)
the given path replaces bundlepath (entry 0)
and Settings.bundlePath is set to given path
|
public static List<ImagePath.PathEntry> getPaths()
public static String[] get()
public static String getPath(int ix)
public static void dump(int lvl)
lvl
- debug level to usepublic static boolean isImageBundled(URL fURL)
public static URL find(String fname)
fname
- relative or absolute filenamepublic static BufferedReader open(String fname)
fname
- relative or absolute filenamepublic static boolean add(String mainPath)
add(String, String)
mainPath
- relative or absolute pathpublic static boolean addHTTP(String pathHTTP)
pathHTTP
- folder address like siteaddress or siteaddress/folder/subfolder (e.g. download.sikuli.de/images)public static boolean removeHTTP(String pathHTTP)
public static boolean add(String mainPath, String altPath)
mainPath
- absolute path name or a valid classname optionally followed by /subfolder...altPath
- alternative image folder, when not running from jarpublic static void add(URL pURL)
pURL
- a valid URL (not checked)public static boolean remove(String path)
path
- relative or absolute pathpublic static boolean reset(String path)
path
- absolute pathpublic static boolean reset()
public static boolean setBundlePath(String bPath)
bPath
- an absolute file pathpublic static String getBundlePath()
public static String getBundlePathSet()
public static String getBundleFolder()