|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<URISchemeType>
org.arakhne.vmutil.URISchemeType
public enum URISchemeType
Commonly supported types of schemes for URL.
| Enum Constant Summary | |
|---|---|
FILE
The file scheme is used to point to files on your computer. |
|
FTP
The ftp scheme is very similar to the http scheme, and is used to locate files available via FTP (File Transfer Protocol). |
|
HTTP
One of the most widely used URL scheme is the http scheme. |
|
HTTPS
One of the most widely used URL scheme is the https scheme. |
|
JAR
The jar scheme describes a Java ARchive (JAR) file or an entry in a JAR file. |
|
MAILTO
The mailto scheme is an example of an opaque URI scheme. mailto URLs identify someone's e-mail address. |
|
NEWS
The news scheme is another opaque URL scheme. |
|
RESOURCE
In the Java programming language a resource is a piece of data that can be accessed by the code of an application. |
|
SSH
The ssh scheme (also known as sftp - for Secure FTP) is very similar to the ftp scheme, and is used to locate files available via SSH (Secure SHell). |
|
TELNET
The telnet scheme has identical syntax to the ftp scheme, with the exception that there is no pathame. |
|
UNSUPPORTED
This value indicates that the scheme is not recognized. |
|
| Method Summary | |
|---|---|
static URISchemeType |
getSchemeType(URI uri)
Replies the type of scheme for the given URI. |
static URISchemeType |
getSchemeType(URL url)
Replies the type of scheme for the given URL. |
abstract boolean |
isFileBasedScheme()
Replies if this URI scheme represents a local or remote file. |
boolean |
isScheme(String string)
Replies if the given string corresponds to this scheme. |
boolean |
isURI(URI uri)
Replies if the given URI uses this scheme. |
boolean |
isURL(URL url)
Replies if the given URL uses this scheme. |
static String |
removeAnyScheme(String string)
Remove any supported URI scheme from the given string. |
String |
removeScheme(String string)
Remove this URI scheme from the given string. |
String |
toString()
Replies the scheme string ended with a column character. |
static URISchemeType |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static URISchemeType[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final URISchemeType HTTP
A Web server is more accurately called an HTTP server. HTTP stands for Hypertext Transfer Protocol, and is a protocol designed to transfer hypertext documents over the Internet. It is used to transfer almost all of the documents you download using your Web browser.
public static final URISchemeType HTTPS
https stands for Hypertext Transfer Protocol Secure. It is a combination of the Hypertext Transfer Protocol (http) with the SSL/TLS protocol to provide encryption and secure identification of the server. HTTPS connections are often used for payment transactions on the World Wide Web and for sensitive transactions in corporate information systems. HTTPS should not be confused with Secure HTTP (S-HTTP) specified in RFC 2660.
public static final URISchemeType FTP
ftp://sunsite.unc.edu/pub/Linux/ls-lR.gz
The above URL points to the FTP server on sunsite.unc.edu, to the file ls-lR.gz in the /pub/Linux directory. It is also possible to specify a username and optionally, a password for the connection. The syntax is like this:
ftp://user@host/path/file
ftp://user:password@host/path/file
Note that supplying a password like this is sometimes a bad idea. Some people might tell you this is a huge security risk, but this is not really true: a URL like the one above is typed into your browser will only be a risk if someone peeps over your shoulder and sees the password. The password itself is transmitted unencrypted anyway, and can be intercepted in transit. Before you go paranoid about this, remember that if your read your mail through POP (Post Office Protocol), like most people do, then your mail password is also transmitted in the clear. The lesson in this is that if you're going to be paranoid, at least do it for the right reasons.
public static final URISchemeType FILE
file:///home/stephanos/public_html/myface.jpg
file://localhost/temp/install_log.txt
Note that the pathname here represents a path name in the local filesystem, so the slashes are usually replaced by a more appropriate character before the file is accessed. Unix uses slashes, Windows uses backslashes, Macintosh and other operating systems use other conventions.
public static final URISchemeType MAILTO
mailto:someone@arakhne.org
mailto:someone@arakhne.org?subject=Feedback
public static final URISchemeType NEWS
news:comp.infosystems.www.authoring.html
news:ba-ciwah-1998Jun4-013702@mud.stack.nl
news:*
The third example points to all available newsgroups and can be used to refer to Usenet in general.
public static final URISchemeType TELNET
telnet://user:password@somehost.internet.com:35/
The above indicates a telnet session for user "user" with password "password" on port 35 of somehost.internet.com.
public static final URISchemeType SSH
ssh://sunsite.unc.edu/pub/Linux/ls-lR.gz
The above URL points to the SSH server on sunsite.unc.edu, to the file ls-lR.gz in the /pub/Linux directory. It is also possible to specify a username and optionally, a password for the connection. The syntax is like this:
ssh://user@host/path/file
ssh://user:password@host/path/file
Secure Shell is a network protocol that allows data to be exchanged using a secure channel between two networked devices. Used primarily on GNU/Linux and Unix based systems to access shell accounts, SSH was designed as a replacement for Telnet and other insecure remote shells, which send information, notably passwords, in plaintext, rendering them susceptible to packet analyzation. The encryption used by SSH provides confidentiality and integrity of data over an insecure network, such as the Internet.
public static final URISchemeType JAR
jar:<url>!/{entry}
where <url> is an URL of the JAR file,
and {entry} is the absolute path of a file
inside the JAR file; for example:
jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.class
Jar URLs should be used to refer to a JAR file or entries in a JAR file. The example above is a JAR URL which refers to a JAR entry. If the entry name is omitted, the URL refers to the whole JAR file:
jar:http://www.foo.com/bar/baz.jar!/
When constructing a JAR url via new URL(context, spec), the following rules apply:
public static final URISchemeType RESOURCE
The resource scheme is simulator to the file scheme. It is used to point to files somewhere in the class paths. It is always absolute filename from one of the roots given in class paths. The syntax is again much like the http syntax, only omitting the port numbers, like this:
resource:/org/arakhne/vmutil/resource.txt
resource:/org/arakhne/vmutil/resource.jpg
Because the pathname here represents a path name in the class paths, the slashes are mandatory.
public static final URISchemeType UNSUPPORTED
| Method Detail |
|---|
public static URISchemeType[] values()
for (URISchemeType c : URISchemeType.values()) System.out.println(c);
public static URISchemeType valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic String toString()
toString in class Enum<URISchemeType>public boolean isURL(URL url)
url -
true if the url uses this scheme,
otherwise falsepublic boolean isURI(URI uri)
uri -
true if the uri uses this scheme,
otherwise falsepublic boolean isScheme(String string)
string -
true if the string corresponds to this scheme,
otherwise falsepublic String removeScheme(String string)
string -
public static String removeAnyScheme(String string)
string -
public static URISchemeType getSchemeType(URL url)
url -
public static URISchemeType getSchemeType(URI uri)
uri -
public abstract boolean isFileBasedScheme()
true if this scheme is file-based,
otherwise false
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||