文档库 最新最全的文档下载
当前位置:文档库 › Appendix2

Appendix2

Appendix2
Appendix2

Class Summary

Interfaces

Authenticator This interface provides a way to respond to authentication challenge and authentica-

tion response headers.

ClientSession The ClientSession interface provides methods for OBEX requests.

HeaderSet The HeaderSet interface defines the methods that set and get the values of OBEX

headers.

Operation The Operation interface provides ways to manipulate a single OBEX PUT or GET

operation.

SessionNotifier The SessionNotifier interface defines a connection notifier for server-side

OBEX connections.

Classes

This class holds user name and password combinations.

PasswordAuthentica-

tion

ResponseCodes The ResponseCodes class contains the list of valid response codes a server may

send to a client.

ServerRequestHandler The ServerRequestHandler class defines an event listener that will respond to

OBEX requests made to the server.

javax.obex

Authenticator

Declaration

public interface Authenticator

Description

This interface provides a way to respond to authentication challenge and authentication response headers. When a client or server receives an authentication challenge or authentication response header, the onAuthenticationChallenge() or onAuthenticationResponse() will be called, respectively, by the implementation.

For more information on how the authentication procedure works in OBEX, please review the IrOBEX specification at https://www.wendangku.net/doc/04952840.html,.

Authentication Challenges

When a client or server receives an authentication challenge header, the

onAuthenticationChallenge() method will be invoked by the OBEX API implementation. The application will then return the user name (if needed) and password via a PasswordAuthentication object. The password in this object is not sent in the authentication response. Instead, the 16-byte challenge received in the authentication challenge is combined with the password returned from the onAuthenticationChallenge() method and passed through the MD5 hash algorithm. The resulting value is sent in the authentication response along with the user name if it was provided.

Authentication Responses

When a client or server receives an authentication response header, the onAuthenticationResponse() method is invoked by the API implementation with the user name received in the authentication response header. (The user name will be null if no user name was provided in the authentication response header.) The application must determine the correct password. This value should be returned from the onAuthenticationResponse() method. If the authentication request should fail without the implementation checking the password, null should be returned by the application. (This is needed for reasons like not recognizing the user name, etc.) If the returned value is not null, the OBEX API implementation will combine the password returned from the onAuthenticationResponse() method and challenge sent via the authentication challenge, apply the MD5 hash algorithm, and compare the result to the response hash received in the authentication response header. If the values are not equal, an IOException will be thrown if the client requested authentication. If the server requested authentication, the

onAuthenticationFailure() method will be called on the ServerRequestHandler that failed authentication. The connection is not closed if authentication failed.

Member Summary

Methods

public PasswordAu-

thentication onAuthenticationChallenge(String,boolean,boolean) Called when a client or a server receives an authentication challenge header.

public byte onAuthenticationResponse(byte[])

Called when a client or server receives an authentication response header.

Methods

onAuthenticationChallenge(String, boolean, boolean)

public PasswordAuthentication onAuthenticationChallenge(https://www.wendangku.net/doc/04952840.html,ng.String description, boolean isUserIdRequired,boolean isFullAccess)

Called when a client or a server receives an authentication challenge header. It should respond to the chal-lenge with a PasswordAuthentication that contains the correct user name and password for the challenge.

Parameters:

description - the description of which user name and password should be used; if no description is provided in the authentication challenge or the description is encoded in an encoding scheme that is not supported, an empty string will be provided

isUserIdRequired - true if the user ID is required; false if the user ID is not required

isFullAccess - true if full access to the server will be granted; false if read only access will be granted

Returns:a PasswordAuthentication object containing the user name and password used for authentication

onAuthenticationResponse(byte[])

public byte[]onAuthenticationResponse(byte[]userName)

Called when a client or server receives an authentication response header. This method will provide the user name and expect the correct password to be returned.

Parameters:

userName - the user name provided in the authentication response; may be null

Returns:the correct password for the user name provided; if null is returned then the authentication request failed

javax.obex

ClientSession

Declaration

public interface ClientSession extends javax.microedition.io.Connection

All Superinterfaces:javax.microedition.io.Connection

Description

The ClientSession interface provides methods for OBEX requests. This interface provides a way to define headers for any OBEX operation. OBEX operations are CONNECT, SETPATH, PUT, GET and DISCONNECT. For PUTs and GETs, this interface will return a javax.obex.Operation object to complete the operations. For CONNECT, DISCONNECT, and SETPATH operations, this interface will complete the operation and return the result in a HeaderSet object.

Connection ID and Target Headers

According to the IrOBEX specification, a packet may not contain a Connection ID and Target header. Since the Connection ID header is managed by the implementation, it will not send a Connection ID header if a Connection ID was specified in a packet that has a Target header. In other words, if an application adds a Target header to a HeaderSet object used in an OBEX operation and a Connection ID was specified, no Connection ID will be sent in the packet containing the Target header.

CREATE-EMPTY and PUT-DELETE Requests

To perform a CREATE-EMPTY request, the client must call the put() method. With the Operation object returned, the client must open the output stream by calling openOutputStream() and then close the stream by calling close() on the OutputStream without writing any data. Using the DataOutputStream returned from openDataOutputStream() works the same way.

There are two ways to perform a PUT-DELETE request. The delete() method is one way to perform a PUT-DELETE request. The second way to perform a PUT-DELETE request is by calling put() and never calling openOutputStream() or openDataOutputStream() on the Operation object returned from

put().

PUT example

void putObjectViaOBEX(ClientSession conn,HeaderSet head,byte[]obj)

throws IOException{

//Include the length header

head.setHeader(HeaderSet.LENGTH,new Long(obj.length));

//Initiate the PUT request

Operation op=conn.put(head);

//Open the output stream to put the object to it

OutputStream out=op.openOutputStream();

//Send the object to the server

out.write(obj);

//End the transaction

out.close();

op.close();

}

GET example

byte[]getObjectViaOBEX(ClientSession conn,HeaderSet head)throws IOException{ //Send the initial GET request to the server

Operation op=conn.get(head);

//Get the object from the input stream

InputStream in=op.openInputStream();

ByteArrayOutputStream out=new ByteArrayOutputStream();

int data=in.read();

while(data!=-1){

out.write((byte)data);

data=in.read();

}

//End the transaction

in.close();

op.close();

byte[]obj=out.toByteArray();

out.close();

return obj;

}

Member Summary

Methods

public HeaderSet connect(HeaderSet)

Completes an OBEX CONNECT operation.

public HeaderSet createHeaderSet()

Creates a javax.obex.HeaderSet object.

public HeaderSet delete(HeaderSet)

Performs an OBEX DELETE operation.

public HeaderSet disconnect(HeaderSet)

Completes an OBEX DISCONNECT operation.

public Operation get(HeaderSet)

Performs an OBEX GET operation.

public long getConnectionID()

Retrieves the connection ID that is being used in the present connection.

public Operation put(HeaderSet)

Performs an OBEX PUT operation.

public void setAuthenticator(Authenticator)

Sets the Authenticator to use with this connection.

public void setConnectionID(long)

Sets the connection ID header to include in the request packets.

public HeaderSet setPath(HeaderSet,boolean,boolean)

Completes an OBEX SETPATH operation.

Inherited Member Summary

Methods inherited from interface javax.microedition.io.Connection

Inherited Member Summary

close

Methods

connect(HeaderSet)

public HeaderSet connect(HeaderSet headers)

throws IOException

Completes an OBEX CONNECT operation. If the headers argument is null, no headers will be sent in the request. This method will never return null.

This method must be called and a successful response code of OBEX_HTTP_OK must be received before put(), get(), setPath(), delete(), or disconnect() may be called. Similarly, after a success-ful call to disconnect(), this method must be called before calling put(), get(), setPath(), delete(), or disconnect().

Parameters:

headers - the headers to send in the CONNECT request

Returns:the headers that were returned from the server

Throws:

IOException - if an error occurred in the transport layer; if the client is already in an operation; if this method had already been called with a successful response code of OBEX_HTTP_OK and calls to disconnect() have not returned a response code of OBEX_HTTP_OK; if the headers defined in

headers exceed the max packet length

IllegalArgumentException - if headers was not created by a call to

createHeaderSet()

createHeaderSet()

public HeaderSet createHeaderSet()

Creates a javax.obex.HeaderSet object. This object can be used to define header values in a request.

Returns:a new javax.obex.HeaderSet object

See Also:HeaderSet

delete(HeaderSet)

public HeaderSet delete(HeaderSet headers)

throws IOException

Performs an OBEX DELETE operation. This method will never return null.

Parameters:

headers - the header to send in the DELETE request

Returns:the headers returned by the server

Throws:

IOException - if an error occurred in the transport layer; if the client is already in an operation; if an OBEX connection does not exist because connect() has not been called; if disconnect() had been called and a response code of OBEX_HTTP_OK was received; if the headers defined in headers exceed the max packet length

IllegalArgumentException - if headers were not created by a call to

createHeaderSet()

disconnect(HeaderSet)

public HeaderSet disconnect(HeaderSet headers)

throws IOException

Completes an OBEX DISCONNECT operation. If the headers argument is null, no headers will be sent in the request. This method will end the session. A new session may be started by calling con-nect(). This method will never return null.

Parameters:

headers - the header to send in the DISCONNECT request

Returns:the headers returned by the server

Throws:

IOException - if an error occurred in the transport layer; if the client is already in an operation; if an OBEX connection does not exist because connect() has not been called; if disconnect() has been called and received a response code of OBEX_HTTP_OK after the last call to connect(); if the headers defined in headers exceed the max packet length

IllegalArgumentException - if headers were not created by a call to

createHeaderSet()

get(HeaderSet)

public Operation get(HeaderSet headers)

throws IOException

Performs an OBEX GET operation. This method will send the OBEX headers provided to the server and return an Operation object to continue with the operation. This method will never return null.

Parameters:

headers - the OBEX headers to send as part of the initial GET request

Returns:the OBEX operation that will complete the GET request

Throws:

IOException - if an error occurred in the transport layer; if an OBEX connection does not exist

because connect() has not been called; if disconnect() had been called and a response code of OBEX_HTTP_OK was received; if connect() has not been called; if the client is already in an

operation;

IllegalArgumentException - if headers were not created by a call to

createHeaderSet()

See Also:Operation

getConnectionID()

public long getConnectionID()

Retrieves the connection ID that is being used in the present connection. This method will return -1 if no connection ID is being used.

Returns:the connection ID being used or -1 if no connection ID is being used

put(HeaderSet)

public Operation put(HeaderSet headers)

throws IOException

Performs an OBEX PUT operation. This method will send the OBEX headers provided to the server and return an Operation object to continue with the PUT operation. This method will never return null.

Parameters:

headers - the OBEX headers to send in the initial PUT request

Returns:the operation object used to complete the PUT request

Throws:

IOException - if an error occurred in the transport layer; if an OBEX connection does not exist

because connect() has not been called; if disconnect() had been called and a response code of OBEX_HTTP_OK was received; if connect() has not been called; if the client is already in an

operation;

IllegalArgumentException - if headers were not created by a call to

createHeaderSet()

See Also:Operation

setAuthenticator(Authenticator)

public void setAuthenticator(Authenticator auth)

Sets the Authenticator to use with this connection. The Authenticator allows an application to respond to authentication challenge and authentication response headers. If no Authenticator is set, the response to an authentication challenge or authentication response header is implementation dependent.

Parameters:

auth - the Authenticator to use for this connection

Throws:

NullPointerException - if auth is null

setConnectionID(long)

public void setConnectionID(long id)

Sets the connection ID header to include in the request packets. If a connection ID is set, it will be sent in each request to the server except for the CONNECT request. An application only needs to set the connec-tion ID if it is trying to operate with different targets over the same transport layer connection. If a client receives a connection ID from the server, the implementation will continue to use that connection ID until the application changes it or until the connection is closed.

Parameters:

id - the connection ID to use

Throws:

IllegalArgumentException - if id is not in the range 0 to 232-1

setPath(HeaderSet, boolean, boolean)

public HeaderSet setPath(HeaderSet headers,boolean backup,boolean create)

throws IOException

Completes an OBEX SETPATH operation. This method will never return null.

Parameters:

backup - if true, instructs the server to back up one directory before moving to the directory

specified in name (similar to cd .. on PCs); if false, apply name to the current directory

create - if true, instructs the server to create the directory if it does not exist; if false, instruct the server to return an error code if the directory does not exist

headers - the headers to include in the SETPATH request

Returns:the headers that were returned from the server

Throws:

IOException - if an error occurred in the transport layer; if the client is already in an operation; if an OBEX connection does not exist because connect() has not been called; if disconnect() had been called and a response code of OBEX_HTTP_OK was received; if the headers defined in headers exceed the max packet length

IllegalArgumentException - if headers were not created by a call to

createHeaderSet()

javax.obex HeaderSet

Declaration

public interface HeaderSet

Description

The HeaderSet interface defines the methods that set and get the values of OBEX headers.

The following table describes how the headers specified in this interface are represented in OBEX and in Java. The Java types are used with the setHeader() and getHeader() methods and specify the type of object that must be provided and will be returned from these methods, respectively.

The APPLICATION_PARAMETER header requires some additional explanation. The byte array provided with the APPLICATION_PARAMETER should be of the form Tag-Length-Value according to the OBEX

specification where Tag is a byte long, Length is a byte long, and Value is up to 255 bytes long. Multiple Tag-Length-Value triples are allowed within a single APPLICATION_PARAMETER header. The implementation will NOT check this condition. It is mentioned only to allow for interoperability between OBEX

implementations.

User Defined Headers

OBEX allows 64 user-defined header values. Depending on the header identifier provided, headers have different types. The table below defines the ranges and their types. Header Values

OBEX Representation Java Type COUNT

4 byte unsigned integer https://www.wendangku.net/doc/04952840.html,ng.Long in the range 0 to 232-1NAME

Unicode string https://www.wendangku.net/doc/04952840.html,ng.String TYPE

ASCII string https://www.wendangku.net/doc/04952840.html,ng.String LENGTH

4 byte unsigned integer https://www.wendangku.net/doc/04952840.html,ng.Long in the range 0 to 232-1TIME_ISO_8601ASCII string of the form

YYYYMMDDTHHMMSS[Z] where

[Z] specifies Zulu time

java.util.Calendar TIME_4_BYTE 4 byte unsigned integer

java.util.Calendar DESCRIPTION Unicode string

https://www.wendangku.net/doc/04952840.html,ng.String TARGET byte sequence

byte[]HTTP byte sequence

byte[]WHO byte sequence

byte[]OBJECT_CLASS byte sequence

byte[]APPLICATION_PARAMETER byte sequence byte[]

Header Identifier Decimal Range OBEX Type Java Type

0x30 to 0x3F48 to 63Unicode String https://www.wendangku.net/doc/04952840.html,ng.String

0x70 to 0x7F112 to 127byte sequence byte[]

0xB0 to 0xBF176 to 191 1 byte https://www.wendangku.net/doc/04952840.html,ng.Byte

0xF0 to 0xFF240 to 255 4 byte unsigned integer https://www.wendangku.net/doc/04952840.html,ng.Long in the range 0 to 232-1

Member Summary

Fields

public static final APPLICATION_PARAMETER

Represents the OBEX Application Parameter header.

public static final COUNT

Represents the OBEX Count header.

public static final DESCRIPTION

Represents the OBEX Description header.

public static final HTTP

Represents the OBEX HTTP header.

public static final LENGTH

Represents the OBEX Length header.

public static final NAME

Represents the OBEX Name header.

public static final OBJECT_CLASS

Represents the OBEX Object Class header.

public static final TARGET

Represents the OBEX Target header.

public static final TIME_4_BYTE

Represents the OBEX Time header using the 4 byte representation.

public static final TIME_ISO_8601

Represents the OBEX Time header using the ISO 8601 standards.

public static final TYPE

Represents the OBEX Type header.

public static final WHO

Represents the OBEX Who header.

Methods

public void createAuthenticationChallenge(String,boolean,boolean)

Sets the authentication challenge header.

public Object getHeader(int)

Retrieves the value of the header identifier provided.

public int getHeaderList()

Retrieves the list of headers that may be retrieved via the getHeader method that

will not return null.

public int getResponseCode()

Returns the response code received from the server.

public void setHeader(int,Object)

Sets the value of the header identifier to the value provided.

Fields

APPLICATION_PARAMETER

public static final int APPLICATION_PARAMETER

Represents the OBEX Application Parameter header. This header specifies additional application request and response information.

The value of APPLICATION_PARAMETER is 0x4C (76).

COUNT

public static final int COUNT

Represents the OBEX Count header. This allows the connection statement to tell the server how many objects it plans to send or retrieve.

The value of COUNT is 0xC0 (192).

DESCRIPTION

public static final int DESCRIPTION

Represents the OBEX Description header. This is a text description of the object.

The value of DESCRIPTION is 0x05 (5).

HTTP

public static final int HTTP

Represents the OBEX HTTP header. This allows an HTTP 1.X header to be included in a request or reply.

The value of HTTP is 0x47 (71).

LENGTH

public static final int LENGTH

Represents the OBEX Length header. This is the length of the object in bytes.

The value of LENGTH is 0xC3 (195).

NAME

public static final int NAME

Represents the OBEX Name header. This specifies the name of the object.

The value of NAME is 0x01 (1).

OBJECT_CLASS

public static final int OBJECT_CLASS

Represents the OBEX Object Class header. This header specifies the OBEX object class of the object.

The value of OBJECT_CLASS is 0x4F (79).

TARGET

public static final int TARGET

Represents the OBEX Target header. This is the name of the service an operation is targeted to.

The value of TARGET is 0x46 (70).

TIME_4_BYTE

public static final int TIME_4_BYTE

Represents the OBEX Time header using the 4 byte representation. This is only included for backwards compatibility. It represents the number of seconds since January 1, 1970.

The value of TIME_4_BYTE is 0xC4 (196).

TIME_ISO_8601

public static final int TIME_ISO_8601

Represents the OBEX Time header using the ISO 8601 standards. This is the preferred time header.

The value of TIME_ISO_8601 is 0x44 (68).

TYPE

public static final int TYPE

Represents the OBEX Type header. This allows a request to specify the type of the object (e.g. text, html, binary, etc.).

The value of TYPE is 0x42 (66).

WHO

public static final int WHO

Represents the OBEX Who header. Identifies the OBEX application to determine if the two peers are talk-ing to each other.

The value of WHO is 0x4A (74).

Methods

createAuthenticationChallenge(String, boolean, boolean)

public void createAuthenticationChallenge(https://www.wendangku.net/doc/04952840.html,ng.String realm,boolean userID,

boolean access)

Sets the authentication challenge header. The realm will be encoded based upon the default encoding scheme used by the implementation to encode strings. Therefore, the encoding scheme used to encode the realm is application dependent.

Parameters:

realm - a short description that describes what password to use; if null no realm will be sent in the authentication challenge header

userID - if true, a user ID is required in the reply; if false, no user ID is required

access - if true then full access will be granted if successful; if false then read-only access will be granted if successful

getHeader(int)

public https://www.wendangku.net/doc/04952840.html,ng.Object getHeader(int headerID)

throws IOException

Retrieves the value of the header identifier provided. The type of the Object returned is defined in the description of this interface.

Parameters:

headerID - the header identifier whose value is to be returned

Returns:the value of the header provided or null if the header identifier specified is not part of this HeaderSet object

Throws:

IllegalArgumentException - if the headerID is not one defined in this interface or any of the user-defined headers

IOException - if an error occurred in the transport layer during the operation or if the connection has been closed

getHeaderList()

public int[]getHeaderList()

throws IOException

Retrieves the list of headers that may be retrieved via the getHeader method that will not return null.

In other words, this method returns all the headers that are available in this object.

Returns:the array of headers that are set in this object or null if no headers are available

Throws:

IOException - if an error occurred in the transport layer during the operation or the connection has been closed

See Also:getHeader(int)

getResponseCode()

public int getResponseCode()

throws IOException

Returns the response code received from the server. Response codes are defined in the ResponseCodes class.

Returns:the response code retrieved from the server

Throws:

IOException - if an error occurred in the transport layer during the transaction; if this method is

called on a HeaderSet object created by calling createHeaderSet() in a ClientSession object; if an OBEX server created this object

See Also:ResponseCodes

setHeader(int, Object)

public void setHeader(int headerID,https://www.wendangku.net/doc/04952840.html,ng.Object headerValue)

Sets the value of the header identifier to the value provided. The type of object must correspond to the Java type defined in the description of this interface. If null is passed as the headerValue then the header will be removed from the set of headers to include in the next request.

Parameters:

headerID - the identifier to include in the message

headerValue - the value of the header identifier

Throws:

IllegalArgumentException - if the header identifier provided is not one defined in this

interface or a user-defined header; if the type of headerValue is not the correct Java type as defined in the description of this interface

javax.obex

Operation

Declaration

public interface Operation extends javax.microedition.io.ContentConnection

All Superinterfaces:javax.microedition.io.Connection, javax.microedition.io.ContentConnection, javax.microedition.io.InputConnection, javax.microedition.io.OutputConnection, javax.microedi-

tion.io.StreamConnection

Description

The Operation interface provides ways to manipulate a single OBEX PUT or GET operation. The implementation of this interface sends OBEX packets as they are built. If during the operation the peer in the operation ends the operation, an IOException is thrown on the next read from the input stream, write to the output stream, or call to sendHeaders().

Definition of methods inherited from ContentConnection

getEncoding() will always return null.

getLength() will return the length specified by the OBEX Length header or -1 if the OBEX Length header was not included.

getType() will return the value specified in the OBEX Type header or null if the OBEX Type header was not included.

How Headers are Handled

As headers are received, they may be retrieved through the getReceivedHeaders() method. If new headers are set during the operation, the new headers will be sent during the next packet exchange.

PUT example

void putObjectViaOBEX(ClientSession conn,HeaderSet head,byte[]obj)

throws IOException

{

//Include the length header

head.setHeader(head.LENGTH,new Long(obj.length));

//Initiate the PUT request

Operation op=conn.put(head);

//Open the output stream to put the object to it

DataOutputStream out=op.openDataOutputStream();

//Send the object to the server

out.write(obj);

//End the transaction

out.close();

op.close();

}

GET example

byte[]getObjectViaOBEX(ClientSession conn,HeaderSet head)throws IOException{ //Send the initial GET request to the server

Operation op=conn.get(head);

//Retrieve the length of the object being sent back

int length=op.getLength();

//Create space for the object

byte[]obj=new byte[length];

//Get the object from the input stream

DataInputStream in=trans.openDataInputStream();

in.read(obj);

//End the transaction

in.close();

op.close();

return obj;

}

Client PUT Operation Flow

For PUT operations, a call to close() the OutputStream returned from openOutputStream() or openDataOutputStream() will signal that the request is done. (In OBEX terms, the End-Of-Body header should be sent and the final bit in the request will be set.) At this point, the reply from the server may begin to be processed. A call to getResponseCode() will do an implicit close on the OutputStream and therefore signal that the request is done.

Client GET Operation Flow

For GET operation, a call to openInputStream() or openDataInputStream() will signal that the request is done. (In OBEX terms, the final bit in the request will be set.) A call to getResponseCode() will cause an implicit close on the InputStream. No further data may be read at this point.

Member Summary

Methods

public void abort()

Sends an ABORT message to the server.

public HeaderSet getReceivedHeaders()

Returns the headers that have been received during the operation.

public int getResponseCode()

Returns the response code received from the server.

public void sendHeaders(HeaderSet)

Specifies the headers that should be sent in the next OBEX message that is sent.

Inherited Member Summary

Methods inherited from interface javax.microedition.io.Connection

Inherited Member Summary

close

Methods inherited from interface javax.microedition.io.ContentConnection

getEncoding,getLength,getType

Methods inherited from interface javax.microedition.io.InputConnection

openDataInputStream,openInputStream

Methods inherited from interface javax.microedition.io.OutputConnection

openDataOutputStream,openOutputStream

Methods

abort()

public void abort()

throws IOException

Sends an ABORT message to the server. By calling this method, the corresponding input and output streams will be closed along with this object. No headers are sent in the abort request. This will end the operation since close() will be called by this method.

Throws:

IOException - if the transaction has already ended or if an OBEX server calls this method

getReceivedHeaders()

public HeaderSet getReceivedHeaders()

throws IOException

Returns the headers that have been received during the operation. Modifying the object returned has no effect on the headers that are sent or retrieved.

Returns:the headers received during this Operation

Throws:

IOException - if this Operation has been closed

getResponseCode()

public int getResponseCode()

throws IOException

Returns the response code received from the server. Response codes are defined in the ResponseCodes class.

Returns:the response code retrieved from the server

Throws:

IOException - if an error occurred in the transport layer during the transaction; if this object was created by an OBEX server

See Also:ResponseCodes

sendHeaders(HeaderSet)

public void sendHeaders(HeaderSet headers)

throws IOException

Specifies the headers that should be sent in the next OBEX message that is sent.

Parameters:

headers - the headers to send in the next message

Throws:

IOException - if this Operation has been closed or the transaction has ended and no further messages will be exchanged

IllegalArgumentException - if headers was not created by a call to

ServerRequestHandler.createHeaderSet() or

ClientSession.createHeaderSet()

NullPointerException - if headers if null

javax.obex PasswordAuthentication

Declaration

public class PasswordAuthentication

https://www.wendangku.net/doc/04952840.html,ng.Object

|

+--javax.obex.PasswordAuthentication

Description This class holds user name and password combinations.

Constructors

PasswordAuthentication(byte[], byte[])

public PasswordAuthentication (byte[]userName,byte[]password)

Creates a new PasswordAuthentication with the user name and password provided.

Parameters:

userName - the user name to include; this may be null

password - the password to include in the response Member Summary

Constructors

public PasswordAuthentication(byte[],byte[])Creates a new PasswordAuthentication with the user name and password

provided.

Methods

public byte

getPassword()Retrieves the password.public byte getUserName()

Retrieves the user name that was specified in the constructor.

Inherited Member Summary

Methods inherited from class https://www.wendangku.net/doc/04952840.html,ng.Object

equals,getClass,hashCode,notify,notifyAll,toString,wait,wait,wait

相关文档