Package edu.isi.pegasus.common.util
Class PegasusURL
- java.lang.Object
-
- edu.isi.pegasus.common.util.PegasusURL
-
public class PegasusURL extends java.lang.ObjectA common PegasusURL class to use by the planner and other components. The class parses the PegasusURL into 3 main components - protocol - hostname - path The class is consistent with the PegasusURL parsing scheme used in pegasus-transfer.- Author:
- Karan Vahi, Mats Rynge
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_PROTOCOLThe default protocol if none is determined from the PegasusURL or pathstatic java.lang.StringFILE_URL_SCHEMEThe scheme name for file url.private java.lang.StringmHostThe hostname referred to by the PegasusURL.private java.lang.StringmPathThe path referred to by the PegasusURLprivate static java.util.regex.PatternmPatternStores compiled patterns at first use, quasi-Singleton.private java.lang.StringmProtocolThe protocol referred to by the PegasusURLprivate static java.lang.StringmRegexExpressionStores the regular expressions necessary to parse a PegasusURL into 3 components protocol, host and pathstatic java.lang.StringSYMLINK_URL_SCHEMEThe scheme name for file url.
-
Constructor Summary
Constructors Constructor Description PegasusURL()The default constructor.PegasusURL(java.lang.String url)The overloaded constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetHost()Returns the host asscoiated with the PegasusURLjava.lang.StringgetPath()Returns the path associated with the PegasusURLjava.lang.StringgetProtocol()Returns the protocol associated with the PegasusURLjava.lang.StringgetURLPrefix()Returns the url prefix associated with the PegasusURL.static voidmain(java.lang.String[] args)Test programvoidparse(java.lang.String url)Parses the url and populates the internal member variables that can be accessed via the appropriate accessor methodsvoidreset()Resets the internal member variablesjava.lang.StringtoString()The contents represented as a string
-
-
-
Field Detail
-
FILE_URL_SCHEME
public static final java.lang.String FILE_URL_SCHEME
The scheme name for file url.- See Also:
- Constant Field Values
-
SYMLINK_URL_SCHEME
public static final java.lang.String SYMLINK_URL_SCHEME
The scheme name for file url.- See Also:
- Constant Field Values
-
DEFAULT_PROTOCOL
public static final java.lang.String DEFAULT_PROTOCOL
The default protocol if none is determined from the PegasusURL or path- See Also:
- Constant Field Values
-
mRegexExpression
private static final java.lang.String mRegexExpression
Stores the regular expressions necessary to parse a PegasusURL into 3 components protocol, host and path- See Also:
- Constant Field Values
-
mPattern
private static java.util.regex.Pattern mPattern
Stores compiled patterns at first use, quasi-Singleton.
-
mProtocol
private java.lang.String mProtocol
The protocol referred to by the PegasusURL
-
mHost
private java.lang.String mHost
The hostname referred to by the PegasusURL. Can include the port also
-
mPath
private java.lang.String mPath
The path referred to by the PegasusURL
-
-
Method Detail
-
parse
public void parse(java.lang.String url)
Parses the url and populates the internal member variables that can be accessed via the appropriate accessor methods- Parameters:
url-
-
getProtocol
public java.lang.String getProtocol()
Returns the protocol associated with the PegasusURL- Returns:
- the protocol else empty
-
getHost
public java.lang.String getHost()
Returns the host asscoiated with the PegasusURL- Returns:
- the host else empty
-
getPath
public java.lang.String getPath()
Returns the path associated with the PegasusURL- Returns:
- the host else empty
-
getURLPrefix
public java.lang.String getURLPrefix()
Returns the url prefix associated with the PegasusURL. The PegasusURL prefix is the part of the PegasusURL composed of protocol and the hostname For example PegasusURL prefix forgsiftp://dataserver.phys.uwm.edu/~/griphyn_test/ligodemo_output
is gsiftp://dataserver.phys.uwm.edu- Returns:
- the host else empty
-
reset
public void reset()
Resets the internal member variables
-
toString
public java.lang.String toString()
The contents represented as a string- Overrides:
toStringin classjava.lang.Object- Returns:
-
main
public static void main(java.lang.String[] args)
Test program- Parameters:
args-
-
-