|
|
||||
| Package com.dassault_systemes.catweb.base.net.url |
Class PortalURL
|
| Class Hierarchy |
java.lang.Object | +-com.dassault_systemes.catweb.base.net.url.PortalURL
| Class Location |
| Class Description |
public class PortalURL
the PortalURL includes the class java.net.URL . It exports the same mecanism provided by Java and will be able to integrate dynamically new protocols without API modification. This imply the creation of specific classes to support each protocol. These classes must inherits from URLStreamHandler. See @see java.net.URL.URL() comments in the JDK API documentation for more details. PortalURL scheme : protocol://username:password@server_name:portNumber/data_origin.data_extension?arg1=value1&arg2=value2 sample : remotefile://my_server:1570/u/users/my_user/my_file.ext?my_arg=my_value
All Implemented Interfaces: Transferable
| Field Summary |
| String | COMMAND_INSTANCE_NAME |
| String | NEW_INSTANCE_NAME |
| String | COMMAND_NAME |
| String | MIME_TYPE |
| String | NO_ACTIVATION |
| String | ARG_WITH_NULL_VALUE |
| String | ARG_WITH_MULTI_VALUE |
| String | EPL_NO_MIME_TYPE |
| int | dot |
| int | questionMark |
| String | ampersand |
| Constructor Summary |
| PortalURL(String portalURL) |
| PortalURL(String protocol, String hostname, int portNumber, String dataOrigin, String dataExtension, String username, String password, Hashtable argumentsTable) |
| PortalURL(PortalURL contextUrl, String subURL) |
| PortalURL(URL contextUrl, String subURL) |
| Method Summary |
| void | initPortaURLWithString(String portalURL) |
| String | getProtocol() |
| String | getUsername() |
| String | getPassword() |
| int | getPort() |
| String | getHost() |
| String | getDataOrigin() |
| String | getDataExtension() |
| String | getFile() |
| String[] | getArgumentList() |
| String | getValueOfArgument(String argument) |
| Vector | getValuesOfArgument(String argument) |
| String | getQuery() |
| String | getCommandName() |
| String | getCommandInstanceName() |
| String | getMIMEType() |
| String | getContentType() |
| InputStream | openStream() |
| String | getPostData() |
| void | setPostData(String PostData) |
| String | toStringWithoutSpecifiedArguments(boolean portalArgumentsFlag, String[] arguments) |
| String | toString() |
| boolean | equals(Object obj) |
| URL | getURL() |
| URLConnection | openConnection() |
| Field Detail |
String COMMAND_INSTANCE_NAME
Reserved argument name for command instance name: "InstanceName"
String NEW_INSTANCE_NAME
Reserved InstanceName in order to specify the creation of a new instance
String COMMAND_NAME
Reserved argument name for command class name: "Command"
String MIME_TYPE
Reserved argument name for MIME Type name: "MIMEType"
String NO_ACTIVATION
Reserved argument name in order to specify to not activate the CATlet
String ARG_WITH_NULL_VALUE
String ARG_WITH_MULTI_VALUE
See IR 366397 : arg=value1&arg=value2
String EPL_NO_MIME_TYPE
Reserved argument name in order to specify to not get MIMETypes from URLConnection
Usefull for http script URLs like CGIs which should not be executed several times.
int dot
int questionMark
String ampersand
| Constructor Detail |
PortalURL(String portalURL)
PortalURL constructor. The url is given as a String.
Throws a MalformedURLException if the given String is not a PortalURL.
portalURL
PortalURL(String protocol, String hostname, int portNumber, String dataOrigin, String dataExtension, String username, String password, Hashtable argumentsTable)
PortalURL constructor. The url is given element by element.
In some cases, some elements mais be null or -1 (for port number : default port taken)
The password, if specified, is given encrypted.
protocolhostnameportNumberdataOrigindataExtensionusernamepasswordargumentsTable
PortalURL(PortalURL contextUrl, String subURL)
PortalURL constructor.
Creates a URL by parsing the specification subURL
within a specified context. If the contextUrl argument
is not null and the subURL argument is a
partial URL specification, then any of the strings missing
components are inherited from the contextUrl argument.
contextUrlsubURL
PortalURL(URL contextUrl, String subURL)
PortalURL constructor.
Creates a URL by parsing the specification subURL
within a specified context. If the contextUrl argument
is not null and the subURL argument is a
partial URL specification, then any of the strings missing
components are inherited from the contextUrl argument.
contextUrlsubURL| Method Detail |
void initPortaURLWithString(String portalURL)
String getProtocol()
Returns the protocol used to retreive the data (http, enovia, cdm,
remotefile ...)
Mapped to @see java.net.URL#getProtocol()
String getUsername()
Returns the username used for authentication. May be null.
String getPassword()
Returns the password used for authentication. The password is not encrypted
int getPort()
Returns the port number used for the connection.
Mapped to @see java.net.URL#getPort()
String getHost()
Returns the hostname of the server on which reside the data
Mapped to @see java.net.URL#.getHost()
String getDataOrigin()
Returns the data origin. In some cases, the data origin may also
contains the data extension.
String getDataExtension()
Returns the data extension.
String getFile()
Returns the file. (DataOrigin.DataExtension)
Same method as @see java.net.URL#getFile()
String[] getArgumentList()
Returns the list of all arguments contained in the URL
String getValueOfArgument(String argument)
Returns the value associated with an argument.
Returns null if the argument is not present inside the URL.
argument
Vector getValuesOfArgument(String argument)
Returns the values associated with an argument.
Returns null if the argument is not present inside the URL.
argument
String getQuery()
Returns the arguments as a query String "arg1=val1&arg2=val2"
String getCommandName()
Returns the command name associated with this URL.
the reserved argument name is : "CommandName"
String getCommandInstanceName()
Returns the instance name of the command associated with this URL
the reserved argument name is : "CommandInstanceName"
String getMIMEType()
Returns the application type associated with the data.
If possible, it is based on the URL content type normally returned by the server.
If this content type is not available, the mime type is resolved from
the data extension.
If the MIME type is specified in the query, it is returned.
String getContentType()
Returns the content of the pointed file
Same method as @see java.net.URLConnection#getContentType()
InputStream openStream()
Opens a connection to this URL.
For some protocol, always throws an IOException as there are no meaning or no way to
retreive the data on the client (enovia protocol essentially)
Mapped to @see java.net.URL#openStream()
String getPostData()
Returns the data that is sent to the webserver through post method, is called from EBrowserCATlet only, do not call from anywhere else
It is used in the "other method" of VPM context only.
void setPostData(String PostData)
Sets the data , that is sent to the webserver through post method, intended for MenuItemWizard usage only, Do not use it from anywhere else.
PostData
String toStringWithoutSpecifiedArguments(boolean portalArgumentsFlag, String[] arguments)
Returns the string representation of the PortalURL whithout specific Portal arguments if
portalArguments = true, and without the specified list of argument
portalArgumentsFlagarguments
String toString()
Constructs a string representation of this PortalURL.
boolean equals(Object obj)
Compares the equality of an object with this instance
obj
URL getURL()
Returns the url @link java.net.URL instance encapsulated by this PortalURL.
This url may be null especially when running inside a browser and using other protocols
than "file" or "http".
URLConnection openConnection()
Returns a URLConnection object that represents a
connection to the remote object referred to by the PortalURL.
If there is not already an open connection, the connection is
opened by calling the openConnection method of the
protocol handler for this PortalURL.
URLConnection to the PortalURL.