DCT Lightfoot v3 API specification

javax.microedition.io
Class Connector

java.lang.Object
  |
  +--javax.microedition.io.Connector

public class Connector
extends Object

This provides a basic mechanism for accessing connections
To create a connection, user calls Connector.open(<protocol>://<params>);


Field Summary
static int DEFAULT
          Default access mode
static int READ
          Access mode READ.
static int READ_WRITE
          Access mode READ_WRITE.
static int WRITE
          Access mode WRITE.
 
Method Summary
static Connection open(java.lang.String url)
          Create and open a connection from the URL
Calls open(String url, int mode, boolean timeouts) with the url, mode READ_WRITE and timeouts 'false'.
static Connection open(java.lang.String url, int mode)
          Create and open a connection from the URL
Calls open(String url, int mode, boolean timeouts) with the url, mode and timeouts 'false'.
static Connection open(java.lang.String url, int mode, boolean timeouts)
          Create and open a connection from the URL
static java.io.DataInputStream openDataInputStream(java.lang.String url)
          Create and open a connection from the URL
and then return a DataInputStream from this connection.
static java.io.DataOutputStream openDataOutputStream(java.lang.String url)
          Create and open a connection from the URL
and then return a DataOutputStream from this connection.
static InputStream openInputStream(java.lang.String url)
          Create and open a connection from the URL
and then return an InputStream from this connection.
static OutputStream openOutputStream(java.lang.String url)
          Create and open a connection from the URL
and then return an OutputStream from this connection.
static void reset()
          Reset the prefix strings
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT

public static final int DEFAULT
Default access mode

See Also:
Constant Field Values

READ

public static final int READ
Access mode READ.

See Also:
Constant Field Values

WRITE

public static final int WRITE
Access mode WRITE.

See Also:
Constant Field Values

READ_WRITE

public static final int READ_WRITE
Access mode READ_WRITE.

See Also:
Constant Field Values
Method Detail

reset

public static void reset()
Reset the prefix strings


open

public static Connection open(java.lang.String url,
                              int mode,
                              boolean timeouts)
                       throws ConnectionNotFoundException,
                              IOException
Create and open a connection from the URL

Parameters:
url - A String containing the necessary information to establish a connection of the required protocol type.
mode - one of
  • READ
  • WRITE
  • READ_WRITE

  • timeouts - whether or not the connection uses timeouts (the alternative is a polled connection).
    Throws:
    ConnectionNotFoundException - if the connection cannot be found
    IllegalArgumentException - if a parameter is invalid
    IOException - if some kind of I/O error occurs

    open

    public static Connection open(java.lang.String url)
                           throws ConnectionNotFoundException,
                                  IOException
    Create and open a connection from the URL
    Calls open(String url, int mode, boolean timeouts) with the url, mode READ_WRITE and timeouts 'false'.

    Parameters:
    url - A String containing the necessary information to establish a connection of the required protocol type.
    Throws:
    ConnectionNotFoundException - if the connection cannot be found
    IllegalArgumentException - if a parameter is invalid
    IOException - if some kind of I/O error occurs

    open

    public static Connection open(java.lang.String url,
                                  int mode)
                           throws ConnectionNotFoundException,
                                  IOException
    Create and open a connection from the URL
    Calls open(String url, int mode, boolean timeouts) with the url, mode and timeouts 'false'.

    Parameters:
    url - A String containing the necessary information to establish a connection of the required protocol type.
    mode - one of
  • READ
  • WRITE
  • READ_WRITE
    Throws:
    ConnectionNotFoundException - if the connection cannot be found
    IllegalArgumentException - if a parameter is invalid
    IOException - if some kind of I/O error occurs

  • openDataInputStream

    public static java.io.DataInputStream openDataInputStream(java.lang.String url)
                                                       throws ConnectionNotFoundException,
                                                              IOException
    Create and open a connection from the URL
    and then return a DataInputStream from this connection. Calls open(String url, int mode, boolean timeouts) with the url, mode READ and timeouts 'false'.

    Parameters:
    url - A String containing the necessary information to establish a connection of the required protocol type.
    Returns:
    a DataInputStream from the connection created.
    Throws:
    ConnectionNotFoundException - if the connection cannot be found
    IllegalArgumentException - if a parameter is invalid
    IOException - if some kind of I/O error occurs

    openDataOutputStream

    public static java.io.DataOutputStream openDataOutputStream(java.lang.String url)
                                                         throws ConnectionNotFoundException,
                                                                IOException
    Create and open a connection from the URL
    and then return a DataOutputStream from this connection. Calls open(String url, int mode, boolean timeouts) with the url, mode WRITE and timeouts 'false'.

    Parameters:
    url - A String containing the necessary information to establish a connection of the required protocol type.
    Returns:
    a DataOutputStream from the connection created.
    Throws:
    ConnectionNotFoundException - if the connection cannot be found
    IllegalArgumentException - if a parameter is invalid
    IOException - if some kind of I/O error occurs

    openInputStream

    public static InputStream openInputStream(java.lang.String url)
                                       throws ConnectionNotFoundException,
                                              IOException
    Create and open a connection from the URL
    and then return an InputStream from this connection. Calls open(String url, int mode, boolean timeouts) with the url, mode READ and timeouts 'false'.

    Parameters:
    url - A String containing the necessary information to establish a connection of the required protocol type.
    Returns:
    an InputStream from the connection created.
    ConnectionNotFoundException
    IOException

    openOutputStream

    public static OutputStream openOutputStream(java.lang.String url)
                                         throws ConnectionNotFoundException,
                                                IOException
    Create and open a connection from the URL
    and then return an OutputStream from this connection. Calls open(String url, int mode, boolean timeouts) with the url, mode WRITE and timeouts 'false'.

    Parameters:
    url - A String containing the necessary information to establish a connection of the required protocol type.
    Returns:
    an OutputStream from the connection created.
    ConnectionNotFoundException
    IOException

    DCT Lightfoot v3 API specification

    DCT Lightfoot v3 API specification