public class JNLPUtilities
extends java.lang.Object
For more information about Web Start, see
http://www.oracle.com/technetwork/java/javase/tech/index-jsp-136112.html
or $PTII/doc/webStartHelp
Configuration
Modifier and Type | Method and Description |
---|---|
static java.net.URL |
canonicalizeJarURL(java.net.URL possibleJarURL)
Canonicalize a jar URL.
|
static java.io.File |
getResourceSaveJarURLAsTempFile(java.lang.String spec)
Get the resource, if it is in a jar URL, then
copy the resource to a temporary file first.
|
static boolean |
isRunningUnderWebStart()
Return true if we are running under WebStart.
|
static java.net.URL |
jarURLEntryResource(java.lang.String spec)
Deprecated.
Use ptolemy.util.ClassUtilities#jarURLEntryResource(String)
|
static java.lang.String |
saveJarURLAsTempFile(java.lang.String jarURLName,
java.lang.String prefix,
java.lang.String suffix,
java.io.File directory)
Given a jar URL, read in the resource and save it as a file.
|
static java.lang.String |
saveJarURLInClassPath(java.lang.String jarURLName)
Given a jar URL, read in the resource and save it as a file in
a similar directory in the classpath if possible.
|
public static java.net.URL canonicalizeJarURL(java.net.URL possibleJarURL) throws java.net.MalformedURLException
possibleJarURL
- A URL that may or may not be a jar URLjava.net.MalformedURLException
- If new URL() throws it.public static java.io.File getResourceSaveJarURLAsTempFile(java.lang.String spec) throws java.io.IOException
spec
- The string to be found as a resource.java.io.IOException
- If the jar URL cannot be saved as a temporary file.public static boolean isRunningUnderWebStart()
@Deprecated public static java.net.URL jarURLEntryResource(java.lang.String spec) throws java.io.IOException
!/
, then return
null. Web Start uses jar URL, and there are some cases where
if we have a jar URL, then we may need to strip off the
jar:url!/
part so that we can search for
the {entry} as a resource.spec
- The string containing the jar url.java.io.IOException
- If it cannot convert the specification to
a URL.ClassUtilities.jarURLEntryResource(String)
,
JarURLConnection
public static java.lang.String saveJarURLAsTempFile(java.lang.String jarURLName, java.lang.String prefix, java.lang.String suffix, java.io.File directory) throws java.io.IOException
jarURLName
- The name of the jar URL to read. jar URLS start
with "jar:" and have a "!/" in them.prefix
- The prefix used to generate the name, it must be
at least three characters long.suffix
- The suffix to use to generate the name. If the
suffix is null, then the suffix of the jarURLName is used. If
the jarURLName does not contain a ".", then ".tmp" will be useddirectory
- The directory where the temporary file is
created. If directory is null then the platform dependent
temporary directory is used.java.io.IOException
- If there is a problem saving the jar URL.File.createTempFile(java.lang.String, java.lang.String, java.io.File)
public static java.lang.String saveJarURLInClassPath(java.lang.String jarURLName) throws java.io.IOException
jarURLName
- The name of the jar URL to read. jar URLS start
with "jar:" and have a "!/" in them.java.io.IOException
- If there is a problem saving the jar URL.