com.ibm.dse.tools.workbench.gui
Class URLTypeConnection

java.lang.Object
  |
  +--com.ibm.dse.tools.workbench.gui.URLTypeConnection

public class URLTypeConnection
extends java.lang.Object

This class implements a URL Connection. It shows a "Connecting..." like dialog.


Constructor Summary
URLTypeConnection(java.lang.String URLLocation)
          This constructor creates a URLConnectionDialog object with the given URL name.
URLTypeConnection(java.lang.String URLLocation, boolean showMessages)
          This constructor creates a URLConnectionDialog object with the given URL name.
 
Method Summary
static byte[] base64Encode(byte[] data)
          This method encodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
static java.lang.String base64Encode(java.lang.String str)
          This method encodes the given string using the base64-encoding specified in RFC-2045 (Section 6.8).
 java.io.InputStream getInputStream()
          This method tries to connect to the URL and returns the opened InputStream if available
 java.lang.String getProtectedURLLocation()
          Returns the current URL location without user:password information
 java.lang.String getURLLocation()
          Returns the current URL location
 void setParent(javax.swing.JDialog dialog)
          Sets the parent dialog of the URL Connection dialog and the URL Connection editor
 void setParent(javax.swing.JFrame frame)
          Sets the parent frame of the URL Connection dialog and the URL Connection editor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

URLTypeConnection

public URLTypeConnection(java.lang.String URLLocation)
This constructor creates a URLConnectionDialog object with the given URL name. The error messages and the URL connection details editor will be shown if necessary.
Parameters:
url - java.net.URL The url

URLTypeConnection

public URLTypeConnection(java.lang.String URLLocation,
                         boolean showMessages)
This constructor creates a URLConnectionDialog object with the given URL name.
Parameters:
url - java.net.URL The url
showMessages - True if you want the error messages and the URL connection editor to be displayed
Method Detail

base64Encode

public static byte[] base64Encode(byte[] data)
This method encodes the given byte[] using the base64-encoding specified in RFC-2045 (Section 6.8).
Parameters:
data - the data
Returns:
the base64-encoded data

base64Encode

public static final java.lang.String base64Encode(java.lang.String str)
This method encodes the given string using the base64-encoding specified in RFC-2045 (Section 6.8). It's used for example in the "Basic" authorization scheme.
Parameters:
str - the string
Returns:
the base64-encoded str

getInputStream

public java.io.InputStream getInputStream()
This method tries to connect to the URL and returns the opened InputStream if available
Returns:
java.io.InputStream The stream

getProtectedURLLocation

public java.lang.String getProtectedURLLocation()
Returns the current URL location without user:password information
Returns:
java.lang.String

getURLLocation

public java.lang.String getURLLocation()
Returns the current URL location
Returns:
java.lang.String

setParent

public void setParent(javax.swing.JDialog dialog)
Sets the parent dialog of the URL Connection dialog and the URL Connection editor
Parameters:
dialog - javax.swing.JDialog

setParent

public void setParent(javax.swing.JFrame frame)
Sets the parent frame of the URL Connection dialog and the URL Connection editor
Parameters:
frame - javax.swing.JFrame