Package skyview.survey
Class Util
java.lang.Object
skyview.survey.Util
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InputStream
getResourceOrFile
(String name) Open a stream from a resource or a file.static void
Copy a URL to a local filestatic String
static String
replacePrefix
(String value, String[] prefixes) Replace one prefix string with another.
-
Constructor Details
-
Util
public Util()
-
-
Method Details
-
replace
-
getURL
Copy a URL to a local file- Throws:
Exception
-
getResourceOrFile
Open a stream from a resource or a file. If a file with the given name exists then return a stream from that file, otherwise try to open it as a system resource.- Parameters:
name
- The name of the resource or file.- Throws:
IOException
-
replacePrefix
Replace one prefix string with another. This is used, e.g., to replace URLs with local file access.- Parameters:
value
- The string to be modifed.prefixes
- A 2 element array where we will look for the first prefix at the beginning of value and if found replace it with the second prefix.- Returns:
- The string with the prefix replaced if found.
-