This repository was archived by the owner on Feb 20, 2020. It is now read-only.
File tree 16 files changed +245
-22
lines changed
mail/src/main/java/com/sun/mail/handlers
src/main/java/com/sun/mail
16 files changed +245
-22
lines changed Original file line number Diff line number Diff line change 109
109
<execution >
110
110
<id >default-compile</id >
111
111
<configuration >
112
- <source >1.5 </source >
113
- <target >1.5 </target >
112
+ <source >1.7 </source >
113
+ <target >1.7 </target >
114
114
<fork >true</fork >
115
115
<!--
116
116
ignore some of the errors that are
130
130
<execution >
131
131
<id >default-testCompile</id >
132
132
<configuration >
133
- <source >1.5 </source >
134
- <target >1.5 </target >
133
+ <source >1.7 </source >
134
+ <target >1.7 </target >
135
135
</configuration >
136
136
</execution >
137
137
</executions >
Original file line number Diff line number Diff line change @@ -51,12 +51,19 @@ public abstract class handler_base implements DataContentHandler {
51
51
/**
52
52
* Return an array of ActivationDataFlavors that we support.
53
53
* Usually there will be only one.
54
+ *
55
+ * @return array of ActivationDataFlavors that we support
54
56
*/
55
57
protected abstract ActivationDataFlavor [] getDataFlavors ();
56
58
57
59
/**
58
60
* Given the flavor that matched, return the appropriate type of object.
59
61
* Usually there's only one flavor so just call getContent.
62
+ *
63
+ * @param aFlavor the ActivationDataFlavor
64
+ * @param ds DataSource containing the data
65
+ * @return the object
66
+ * @exception IOException for errors reading the data
60
67
*/
61
68
protected Object getData (ActivationDataFlavor aFlavor , DataSource ds )
62
69
throws IOException {
@@ -75,9 +82,10 @@ public ActivationDataFlavor[] getTransferDataFlavors() {
75
82
/**
76
83
* Return the Transfer Data of type DataFlavor from InputStream.
77
84
*
78
- * @param df The DataFlavor
79
- * @param ds The DataSource corresponding to the data
80
- * @return String object
85
+ * @param df The DataFlavor
86
+ * @param ds The DataSource corresponding to the data
87
+ * @return the object
88
+ * @exception IOException for errors reading the data
81
89
*/
82
90
public Object getTransferData (ActivationDataFlavor df , DataSource ds )
83
91
throws IOException {
Original file line number Diff line number Diff line change 76
76
<android .version>4.4_r1</android .version>
77
77
</properties >
78
78
79
+ <profiles >
80
+ <!--
81
+ A special profile for compiling with JDK 9.
82
+ Skip animal-sniffer until it works with JDK 9.
83
+ -->
84
+ <profile >
85
+ <id >9</id >
86
+ <build >
87
+ <plugins >
88
+ <plugin >
89
+ <groupId >org.codehaus.mojo</groupId >
90
+ <artifactId >animal-sniffer-maven-plugin</artifactId >
91
+ <configuration >
92
+ <skip >true</skip >
93
+ </configuration >
94
+ </plugin >
95
+ </plugins >
96
+ </build >
97
+ </profile >
98
+ </profiles >
99
+
79
100
<build >
80
101
<plugins >
81
102
<plugin >
82
103
<groupId >org.codehaus.mojo</groupId >
83
104
<artifactId >animal-sniffer-maven-plugin</artifactId >
84
- <version >1.14</version >
85
105
<executions >
86
106
<execution >
87
107
<id >check-sig</id >
100
120
</configuration >
101
121
</plugin >
102
122
</plugins >
123
+
124
+ <pluginManagement >
125
+ <plugins >
126
+ <plugin >
127
+ <groupId >org.codehaus.mojo</groupId >
128
+ <artifactId >animal-sniffer-maven-plugin</artifactId >
129
+ <version >1.16</version >
130
+ </plugin >
131
+ </plugins >
132
+ </pluginManagement >
103
133
</build >
104
134
105
135
</project >
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ GH 278 BODYSTRUCTURE Parser fails on specific IMAP Server response
24
24
GH 283 clean up connections when closing IMAPStore
25
25
GH 287 Allow relaxed Content-Disposition parsing
26
26
GH 289 use a different IMAP tag prefix for each connection
27
+ GH 291 define JDK 9 module name for JavaMail
27
28
28
29
29
30
CHANGES IN THE 1.6.0 RELEASE
Original file line number Diff line number Diff line change 57
57
<name >JavaMail API</name >
58
58
59
59
<properties >
60
- <activation-api .version>1.1</activation-api .version>
61
60
<mail .extensionName>
62
61
javax.mail
63
62
</mail .extensionName>
63
+ <mail .moduleName>
64
+ java.mail
65
+ </mail .moduleName>
64
66
<mail .specificationTitle>
65
67
JavaMail(TM) API Design Specification
66
68
</mail .specificationTitle>
112
114
<exclude >
113
115
javax/mail/MailSessionDefinitions.java
114
116
</exclude >
117
+ <exclude >
118
+ module-info.java
119
+ </exclude >
115
120
</excludes >
116
121
</configuration >
117
122
</execution >
120
125
</plugins >
121
126
</build >
122
127
</profile >
128
+
129
+ <!--
130
+ A special profile for compiling with the real JDK 9 compiler.
131
+ -->
132
+ <profile >
133
+ <id >9</id >
134
+ <build >
135
+ <plugins >
136
+ <plugin >
137
+ <artifactId >maven-compiler-plugin</artifactId >
138
+ <executions >
139
+ <execution >
140
+ <id >default-compile</id >
141
+ <configuration >
142
+ <compilerArgs >
143
+ <arg >-Xlint</arg >
144
+ <arg >-Xlint:-options</arg >
145
+ <arg >-Xlint:-path</arg >
146
+ <!--
147
+ Too many finalize warnings.
148
+ <arg>-Werror</arg>
149
+ -->
150
+ </compilerArgs >
151
+ </configuration >
152
+ </execution >
153
+ </executions >
154
+ </plugin >
155
+ </plugins >
156
+ </build >
157
+ </profile >
123
158
</profiles >
124
159
125
160
<build >
150
185
</compilerArgs >
151
186
<showDeprecation >true</showDeprecation >
152
187
<showWarnings >true</showWarnings >
188
+ <excludes >
189
+ <exclude >
190
+ module-info.java
191
+ </exclude >
192
+ </excludes >
153
193
</configuration >
154
194
</plugin >
155
195
166
206
</includes >
167
207
</configuration >
168
208
</plugin >
209
+
210
+ <!--
211
+ Add the Automatic-Module-Name manifest header for JDK 9.
212
+ -->
213
+ <plugin >
214
+ <artifactId >maven-jar-plugin</artifactId >
215
+ <configuration >
216
+ <archive >
217
+ <manifestEntries >
218
+ <Automatic-Module-Name >
219
+ ${mail.moduleName}
220
+ </Automatic-Module-Name >
221
+ </manifestEntries >
222
+ </archive >
223
+ </configuration >
224
+ </plugin >
169
225
</plugins >
170
226
</build >
171
227
172
228
<dependencies >
173
229
<dependency >
174
230
<groupId >javax.activation</groupId >
175
231
<artifactId >activation</artifactId >
176
- <version >${activation-api.version} </version >
177
232
</dependency >
178
233
<dependency >
179
234
<groupId >junit</groupId >
Original file line number Diff line number Diff line change @@ -52,12 +52,19 @@ public abstract class handler_base implements DataContentHandler {
52
52
/**
53
53
* Return an array of ActivationDataFlavors that we support.
54
54
* Usually there will be only one.
55
+ *
56
+ * @return array of ActivationDataFlavors that we support
55
57
*/
56
58
protected abstract ActivationDataFlavor [] getDataFlavors ();
57
59
58
60
/**
59
61
* Given the flavor that matched, return the appropriate type of object.
60
62
* Usually there's only one flavor so just call getContent.
63
+ *
64
+ * @param aFlavor the ActivationDataFlavor
65
+ * @param ds DataSource containing the data
66
+ * @return the object
67
+ * @exception IOException for errors reading the data
61
68
*/
62
69
protected Object getData (ActivationDataFlavor aFlavor , DataSource ds )
63
70
throws IOException {
@@ -82,9 +89,10 @@ public DataFlavor[] getTransferDataFlavors() {
82
89
/**
83
90
* Return the Transfer Data of type DataFlavor from InputStream.
84
91
*
85
- * @param df The DataFlavor
86
- * @param ds The DataSource corresponding to the data
87
- * @return String object
92
+ * @param df The DataFlavor
93
+ * @param ds The DataSource corresponding to the data
94
+ * @return the object
95
+ * @exception IOException for errors reading the data
88
96
*/
89
97
@ Override
90
98
public Object getTransferData (DataFlavor df , DataSource ds )
Original file line number Diff line number Diff line change @@ -578,6 +578,7 @@ public SocketChannel getChannel() {
578
578
* This implementation returns false.
579
579
* Subclasses should override as appropriate.
580
580
*
581
+ * @return true if the server supports UTF-8
581
582
* @since JavaMail 1.6.0
582
583
*/
583
584
public boolean supportsUtf8 () {
Original file line number Diff line number Diff line change @@ -106,6 +106,8 @@ public Response(String s) {
106
106
/**
107
107
* Constructor for testing.
108
108
*
109
+ * @param s the response string
110
+ * @param supportsUtf8 allow UTF-8 in response?
109
111
* @since JavaMail 1.6.0
110
112
*/
111
113
public Response (String s , boolean supportsUtf8 ) {
@@ -171,6 +173,7 @@ public static Response byeResponse(Exception ex) {
171
173
/**
172
174
* Does the server support UTF-8?
173
175
*
176
+ * @return true if the server supports UTF-8
174
177
* @since JavaMail 1.6.0
175
178
*/
176
179
public boolean supportsUtf8 () {
@@ -224,6 +227,9 @@ public void skipSpaces() {
224
227
* Skip past any spaces. If the next non-space character is c,
225
228
* consume it and return true. Otherwise stop at that point
226
229
* and return false.
230
+ *
231
+ * @param c the character to look for
232
+ * @return true if the character is found
227
233
*/
228
234
public boolean isNextNonSpace (char c ) {
229
235
skipSpaces ();
Original file line number Diff line number Diff line change @@ -222,6 +222,8 @@ public void capability() throws ProtocolException {
222
222
223
223
/**
224
224
* Handle any untagged CAPABILITY response in the Response array.
225
+ *
226
+ * @param r the responses
225
227
*/
226
228
public void handleCapabilityResponse (Response [] r ) {
227
229
boolean first = true ;
@@ -1174,6 +1176,8 @@ public void compress() throws ProtocolException {
1174
1176
* the server supports UTF-8, and add the encoded name to the
1175
1177
* Argument.
1176
1178
*
1179
+ * @param args the arguments
1180
+ * @param name the name to encode
1177
1181
* @since JavaMail 1.6.0
1178
1182
*/
1179
1183
protected void writeMailboxName (Argument args , String name ) {
Original file line number Diff line number Diff line change 162
162
message type with a "message/delivery-status"
163
163
(< A HREF ="http://www.ietf.org/rfc/rfc1894.txt " TARGET ="_top "> RFC 1894</ A > )
164
164
part.
165
- You can use the classes in the {@link com.sun.mail.dsn} package to
165
+ You can use the classes in the < code > com.sun.mail.dsn</ code > package to
166
166
handle these MIME types.
167
167
Note that you'll need to include < code > dsn.jar</ code > in your CLASSPATH
168
168
as this support is not included in < code > mail.jar</ code > .
Original file line number Diff line number Diff line change @@ -68,6 +68,8 @@ public LineInputStream(InputStream in) {
68
68
}
69
69
70
70
/**
71
+ * @param in the InputStream
72
+ * @param allowutf8 allow UTF-8 characters?
71
73
* @since JavaMail 1.6
72
74
*/
73
75
public LineInputStream (InputStream in , boolean allowutf8 ) {
Original file line number Diff line number Diff line change @@ -71,6 +71,8 @@ public LineOutputStream(OutputStream out) {
71
71
}
72
72
73
73
/**
74
+ * @param out the OutputStream
75
+ * @param allowutf8 allow UTF-8 characters?
74
76
* @since JavaMail 1.6
75
77
*/
76
78
public LineOutputStream (OutputStream out , boolean allowutf8 ) {
Original file line number Diff line number Diff line change 43
43
import java .io .*;
44
44
import java .net .*;
45
45
import java .util .concurrent .*;
46
+ import java .util .Collections ;
47
+ import java .util .Set ;
46
48
import java .nio .channels .SocketChannel ;
47
49
import java .lang .reflect .*;
48
50
@@ -314,8 +316,34 @@ public boolean isOutputShutdown() {
314
316
return socket .isOutputShutdown ();
315
317
}
316
318
319
+ /*
320
+ * The following three methods were added to java.net.Socket in Java SE 9.
321
+ * Since they're not supported on Android, and since we know that we
322
+ * never use them in JavaMail, we just stub them out here.
323
+ */
324
+ //@Override
325
+ public <T > Socket setOption (SocketOption <T > so , T val ) throws IOException {
326
+ // socket.setOption(so, val);
327
+ // return this;
328
+ throw new UnsupportedOperationException ("WriteTimeoutSocket.setOption" );
329
+ }
330
+
331
+ //@Override
332
+ public <T > T getOption (SocketOption <T > so ) throws IOException {
333
+ // return socket.getOption(so);
334
+ throw new UnsupportedOperationException ("WriteTimeoutSocket.getOption" );
335
+ }
336
+
337
+ //@Override
338
+ public Set <SocketOption <?>> supportedOptions () {
339
+ // return socket.supportedOptions();
340
+ return Collections .emptySet ();
341
+ }
342
+
317
343
/**
318
344
* KLUDGE for Android, which has this illegal non-Java Compatible method.
345
+ *
346
+ * @return the FileDescriptor object
319
347
*/
320
348
public FileDescriptor getFileDescriptor$ () {
321
349
try {
You can’t perform that action at this time.
0 commit comments