My favorites | Sign in
Project Home Downloads Wiki Issues Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
/**
* BlueCove - Java library for Bluetooth
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*
* @version $Id$
*/
package javax.microedition.io;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import com.intel.bluetooth.DebugLog;
import com.intel.bluetooth.MicroeditionConnector;

/**
*
* This class delegated all calls to MicroeditionConnector
*
* 1) Solves Bytecode comatibilty problems. Application compiled with
* bluecove.jar should run on java me platform.
*
* 2) Use standard Protocol initialization to enable integration in other
* environments.
*
* vlads changes: Move Original code to MicroeditionConnector
*
*/

public class Connector {
/*
* Access mode READ. The value 1 is assigned to READ.
*/

public static final int READ = 1;

/*
* Access mode WRITE. The value 2 is assigned to WRITE.
*/

public static final int WRITE = 2;

/*
* Access mode READ_WRITE. The value 3 is assigned to READ_WRITE.
*/

public static final int READ_WRITE = 3;

private Connector() {

}

/*
* Create and open a Connection. Parameters: name - The URL for the
* connection. Returns: A new Connection object. Throws:
* IllegalArgumentException - If a parameter is invalid.
* ConnectionNotFoundException - If the requested connection cannot be made,
* or the protocol type does not exist. java.io.IOException - If some other
* kind of I/O error occurs. SecurityException - If a requested protocol
* handler is not permitted.
*/

public static Connection open(String name) throws IOException {
DebugLog.debug("open using BlueCove javax.microedition.io.Connector");
return MicroeditionConnector.open(name);
}

/*
* Create and open a Connection. Parameters: name - The URL for the
* connection. mode - The access mode. Returns: A new Connection object.
* Throws: IllegalArgumentException - If a parameter is invalid.
* ConnectionNotFoundException - If the requested connection cannot be made,
* or the protocol type does not exist. java.io.IOException - If some other
* kind of I/O error occurs. SecurityException - If a requested protocol
* handler is not permitted.
*/

public static Connection open(String name, int mode) throws IOException {
return MicroeditionConnector.open(name, mode);
}

/*
* Create and open a Connection. Parameters: name - The URL for the
* connection mode - The access mode timeouts - A flag to indicate that the
* caller wants timeout exceptions Returns: A new Connection object Throws:
* IllegalArgumentException - If a parameter is invalid.
* ConnectionNotFoundException - if the requested connection cannot be made,
* or the protocol type does not exist. java.io.IOException - If some other
* kind of I/O error occurs. SecurityException - If a requested protocol
* handler is not permitted.
*/

public static Connection open(String name, int mode, boolean timeouts)
throws IOException {
return MicroeditionConnector.open(name, mode, timeouts);
}

/*
* Create and open a connection input stream. Parameters: name - The URL for
* the connection. Returns: A DataInputStream. Throws:
* IllegalArgumentException - If a parameter is invalid.
* ConnectionNotFoundException - If the connection cannot be found.
* java.io.IOException - If some other kind of I/O error occurs.
* SecurityException - If access to the requested stream is not permitted.
*/

public static DataInputStream openDataInputStream(String name)
throws IOException {
return MicroeditionConnector.openDataInputStream(name);
}

/*
* Create and open a connection output stream. Parameters: name - The URL
* for the connection. Returns: A DataOutputStream. Throws:
* IllegalArgumentException - If a parameter is invalid.
* ConnectionNotFoundException - If the connection cannot be found.
* java.io.IOException - If some other kind of I/O error occurs.
* SecurityException - If access to the requested stream is not permitted.
*/

public static DataOutputStream openDataOutputStream(String name)
throws IOException {
return MicroeditionConnector.openDataOutputStream(name);
}

/*
* Create and open a connection input stream. Parameters: name - The URL for
* the connection. Returns: An InputStream. Throws: IllegalArgumentException -
* If a parameter is invalid. ConnectionNotFoundException - If the
* connection cannot be found. java.io.IOException - If some other kind of
* I/O error occurs. SecurityException - If access to the requested stream
* is not permitted.
*/

public static InputStream openInputStream(String name) throws IOException {
return MicroeditionConnector.openInputStream(name);
}

/*
* Create and open a connection output stream. Parameters: name - The URL
* for the connection. Returns: An OutputStream. Throws:
* IllegalArgumentException - If a parameter is invalid.
* ConnectionNotFoundException - If the connection cannot be found.
* java.io.IOException - If some other kind of I/O error occurs.
* SecurityException - If access to the requested stream is not permitted.
*/

public static OutputStream openOutputStream(String name) throws IOException {
return MicroeditionConnector.openOutputStream(name);
}
}

Change log

r2471 by skarzhevskyy on Nov 30, 2008   Diff
Change license to Apache License, Version
2.0, Update headers
Go to: 
Project members, sign in to write a code review

Older revisions

r2408 by skarzhevskyy on Oct 9, 2008   Diff
organize product to modules
r1037 by skarzhevskyy on Sep 8, 2007   Diff
Fixed for IBM's WEME (J9) JVM for MIDP
2.0. No need for System.setProperty("m
icroedition.connection.pkgs")
r241 by skarzhevskyy on May 11, 2007   Diff
refactor directory structure to maven2
standards
All revisions of this file

File info

Size: 6078 bytes, 169 lines

File properties

svn:mime-type
text/plain
svn:eol-style
native
svn:keywords
Date Author Id Revision
Powered by Google Project Hosting