public class PegasusURL
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DEFAULT_PROTOCOL
The default protocol if none is determined from the PegasusURL or path
|
static java.lang.String |
FILE_URL_SCHEME
The scheme name for file url.
|
private java.lang.String |
mHost
The hostname referred to by the PegasusURL.
|
private java.lang.String |
mPath
The path referred to by the PegasusURL
|
private static java.util.regex.Pattern |
mPattern
Stores compiled patterns at first use, quasi-Singleton.
|
private java.lang.String |
mProtocol
The protocol referred to by the PegasusURL
|
private static java.lang.String |
mRegexExpression
Stores the regular expressions necessary to parse a PegasusURL into 3 components
protocol, host and path
|
static java.lang.String |
SYMLINK_URL_SCHEME
The scheme name for file url.
|
Constructor and Description |
---|
PegasusURL()
The default constructor.
|
PegasusURL(java.lang.String url)
The overloaded constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getHost()
Returns the host asscoiated with the PegasusURL
|
java.lang.String |
getPath()
Returns the path associated with the PegasusURL
|
java.lang.String |
getProtocol()
Returns the protocol associated with the PegasusURL
|
java.lang.String |
getURLPrefix()
Returns the url prefix associated with the PegasusURL.
|
static void |
main(java.lang.String[] args)
Test program
|
void |
parse(java.lang.String url)
Parses the url and populates the internal member variables that can
be accessed via the appropriate accessor methods
|
void |
reset()
Resets the internal member variables
|
java.lang.String |
toString()
The contents represented as a string
|
public static final java.lang.String FILE_URL_SCHEME
public static final java.lang.String SYMLINK_URL_SCHEME
public static final java.lang.String DEFAULT_PROTOCOL
private static final java.lang.String mRegexExpression
private static java.util.regex.Pattern mPattern
private java.lang.String mProtocol
private java.lang.String mHost
private java.lang.String mPath
public PegasusURL()
public PegasusURL(java.lang.String url)
url
- the url to be parsed internallypublic void parse(java.lang.String url)
url
- public java.lang.String getProtocol()
public java.lang.String getHost()
public java.lang.String getPath()
public java.lang.String getURLPrefix()
gsiftp://dataserver.phys.uwm.edu/~/griphyn_test/ligodemo_outputis gsiftp://dataserver.phys.uwm.edu
public void reset()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
args
-