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