public class OpenUtils extends Object
Modifier and Type | Field and Description |
---|---|
protected static Map<String,OpenHelper> |
m_helper |
Constructor and Description |
---|
OpenUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
addHelperClass(String key,
OpenHelper helper)
Register a protocol handler.
|
static void |
addHelperClassAlias(String alias,
String key)
Add an alias for an existing handler.
|
static OpenHelper |
getHelper(Object key)
Get the registered helper for a given "protocol"
|
static String |
getLink(Object protocol,
Object value)
Get a standard link (URI) for a given (protocol,value) pair
|
static boolean |
open(Object protocol,
Object value)
Open a link.
|
static boolean |
openFile(String filepath)
Open a file at the given path
|
static boolean |
openURI(String uri)
Open an URI.
|
protected static Map<String,OpenHelper> m_helper
public static void addHelperClass(String key, OpenHelper helper)
key
- the name of the "protocol" to handlehelper
- the handler itselfpublic static void addHelperClassAlias(String alias, String key)
alias
- the new namekey
- the existing "protocol"public static OpenHelper getHelper(Object key)
key
- the "protocol" namepublic static String getLink(Object protocol, Object value)
protocol
- value
- public static boolean open(Object protocol, Object value)
protocol
- value
- public static boolean openURI(String uri)
uri
- the URI to openpublic static boolean openFile(String filepath)
filepath
- the path of the fileCopyright © 2005–2020. All rights reserved.