|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.httpgw.URLData
The URLData class is a data structure utilized by the URLFactory and other classes that need the capability to store explicitly the URL information necessary to construct URLs and HREFs in the Windchill environment. The standard URL object is not applicable since it has no mechanism to separate an application root from the package heirarchy.
The URLData class supports the Comparator interface and may be used with the collections framework to be sorted and searched. The Name member is used to compare objects and two objects are considered equal is they have the same Name.
Optionally resources and query strings may be stored as part of the web path in the URLData class.
The packagePath should be declared with the Windchill codebase leading the packagepath. For example, if the package path is defined as wt/clients with a codebase of Windchill then the package path should take on the form /Windchill/wt/clients/
Supported API: true
Extendable: false
Field Summary | |
static int |
HTTP_PORT
Constant for HTTP port (ref: RFC793) |
static String |
HTTP_PROTOCOL
|
static int |
HTTPS_PORT
Constant for HTTPS port (ref: RFC793) |
static String |
HTTPS_PROTOCOL
|
static boolean |
ignore_ports
|
private boolean |
ivbDirectory
|
private String |
ivCompletePackagePath
The package path as a string with '/' separating elements. |
private String |
ivHostname
|
private String |
ivName
|
private String[] |
ivPackagePath
|
private int |
ivPort
|
private String |
ivProtocol
|
private String |
ivQueryString
|
private String |
ivResource
|
Constructor Summary | |
URLData()
|
|
URLData(String aName,
String aProtocol,
String aHostname,
int aPort,
String[] aPackagePath,
String aResource,
String aQueryString)
|
Method Summary | |
void |
appendPackageToPackagePath(String aPath)
This method will append a package to the Package Path of the URLData. |
int |
compare(Object anObject,
Object aComparison)
Implement the compare method to compare the name of the URLData to another URLData object. |
boolean |
equals(Object aComparison)
|
String |
getFullyQualifiedName()
Will return the Fully Qualified Name for the class. |
String |
getFullyQualifiedName(boolean showPort)
Will return the Fully Qualified Name for the class. |
String |
getHostname()
Retrieves the stored Hostname. |
String |
getName()
Retrieve the Name of the URLData object |
String[] |
getPackagePath()
Retrieves the stored Package Path |
String |
getPackagePathAsString()
Retrieves the package path as a String. |
int |
getPackagePathSize()
|
int |
getPort()
Retrives the stored Port |
String |
getProtocol()
Retrieve the stored Protocol |
String |
getQueryString()
Retrieve the stored query String. |
String |
getRelativeDifference(URLData base)
This method will return the relative difference between this URLData and a reference or baseline URLData object. |
String |
getResource()
Retrieve the resource. |
URL |
getURL()
Will return an URL representation of the URLData |
boolean |
isDirectory()
Whether the URLData represents a directory. |
void |
setDirectory(boolean aDirectory)
|
void |
setHostname(String aHostname)
|
void |
setName(String aName)
|
void |
setPackagePath(String aPackage)
This method will take in a String which represents the package path for a given resource and create a proper package path for the URLData object. |
void |
setPackagePath(String[] aPackage)
|
boolean |
setPackagePathAndResource(String aData,
boolean setResource)
Tokenizes along '/' and sets the package path for the URLdata If the path does not end in a '/' then the last token is set as resource |
void |
setPort(int aPort)
Sets the port for the URLData object. |
void |
setProtocol(String aProtocol)
|
void |
setQueryString(String aQuery)
|
void |
setResource(String aResource)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private String ivName
private String ivHostname
private String[] ivPackagePath
private String ivCompletePackagePath
private String ivProtocol
private String ivQueryString
private String ivResource
private int ivPort
private boolean ivbDirectory
public static final int HTTPS_PORT
public static final int HTTP_PORT
public static final String HTTPS_PROTOCOL
public static final String HTTP_PROTOCOL
public static boolean ignore_ports
Constructor Detail |
public URLData()
public URLData(String aName, String aProtocol, String aHostname, int aPort, String[] aPackagePath, String aResource, String aQueryString)
Method Detail |
public int getPackagePathSize()
public URL getURL() throws MalformedURLException
MalformedURLException
- if the URLData object's members
do not create a valid URL.public String getFullyQualifiedName()
Protocol://Hostname:Port/DocumentRoot/PackagePath/Resource?QueryString
The port will NOT be inserted if it is one of the default ports (80 or 443 (for https)).
public String getFullyQualifiedName(boolean showPort)
Protocol://Hostname:Port/DocumentRoot/PackagePath/Resource?QueryString
showPort
- Whether to show the standard ports (80 and 443)
public int compare(Object anObject, Object aComparison)
compare
in interface Comparator
anObject
- The object to compare the current object to.
ClassCastException
- thrown if a non URLData object
is attempted to be compared.public boolean equals(Object aComparison)
equals
in interface Comparator
public String getRelativeDifference(URLData base)
base
- The base URLData object representing the RequestURI
or reference object for the current object.
public final String getHostname()
public final String[] getPackagePath()
public final String getPackagePathAsString()
public final String getProtocol()
public final int getPort()
public final String getQueryString()
public final String getResource()
public final String getName()
public final boolean isDirectory()
public final void setDirectory(boolean aDirectory)
public final void setHostname(String aHostname)
public final void setPackagePath(String aPackage)
aPackage
- The package path to split up. ('/' is the separator)public final boolean setPackagePathAndResource(String aData, boolean setResource)
aData
- The input String.setResource
- whether to set resource string.
public final void setPackagePath(String[] aPackage)
public final void appendPackageToPackagePath(String aPath)
public final void setPort(int aPort)
If no Port is set (ie. it is -1) the standard http port will be used.
aPort
- The port to set.public final void setProtocol(String aProtocol)
public final void setQueryString(String aQuery)
public final void setResource(String aResource)
public final void setName(String aName)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |