|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdsto.dfc.swt.util.Documents
public final class Documents
General utilities for opening document files/URL's using local applications or the system browser.
BrowserControl
Method Summary | |
---|---|
static String |
getExtension(String uri,
String defaultExt)
Get the nominal extension of a URL/URI. |
static boolean |
looksLikeDOSFile(String name)
|
static boolean |
looksLikeUNCFile(String name)
|
static String |
makeUrl(String filename)
Convert a reference that's probably a URL or a filename into a guaranteed bona fide URL. |
static void |
open(String name)
Open a filename/URL with the system default application. |
static void |
openWithBrowserControl(String command,
String url)
Open a URL using BrowserControl . |
static String |
urlToFilename(String url)
Convert "file:" URL's to their platform filenames. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void open(String name) throws IOException
Program
class to open based on extension
(works well with filenames and file:// URL's), then falls back on
whatever handles HTML then falls back on BrowserControl
as a last resort.
name
- The URL/filename to open.
IOException
- if the URL could not be opened or an error
occurred opening it.public static void openWithBrowserControl(String command, String url) throws IOException
BrowserControl
.
command
- The command to execute. May be null.url
- The URL.
IOException
- if an error occurs.public static String urlToFilename(String url)
public static String getExtension(String uri, String defaultExt)
uri
- The URI.defaultExt
- The extension to return when there is none (eg URL is
http://www.frob.com/)public static String makeUrl(String filename)
public static boolean looksLikeUNCFile(String name)
public static boolean looksLikeDOSFile(String name)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |