File tree Expand file tree Collapse file tree
api/src/main/java/jakarta/mail Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -88,11 +88,33 @@ public interface Part {
8888 * user interface to give the user a rough idea of the size
8989 * of this part.
9090 *
91+ * @deprecated Since Jakarta Mail 2.2.0. Use {@link #getSizeLong()}
92+ * instead.
9193 * @return size of content in bytes
9294 * @throws MessagingException for failures
9395 */
96+ @ Deprecated (since = "2.2.0" , forRemoval = true )
9497 int getSize () throws MessagingException ;
9598
99+ /**
100+ * Return the size of the content of this part in bytes.
101+ * Returns -1 if the size cannot be determined. <p>
102+ *
103+ * Note that the size may not be an exact measure of the content
104+ * size and may or may not account for any transfer encoding
105+ * of the content. The size is appropriate for display in a
106+ * user interface to give the user a rough idea of the size
107+ * of this part.
108+ *
109+ * @return size of content in bytes, or -1 if unknown
110+ * @throws MessagingException for failures
111+ * @since Jakarta Mail 2.2.0
112+ */
113+ @ SuppressWarnings ("deprecation" )
114+ default long getSizeLong () throws MessagingException {
115+ return getSize ();
116+ }
117+
96118 /**
97119 * Return the number of lines in the content of this part.
98120 * Return -1 if the number cannot be determined.
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ E 744 Remove SecurityManager reference from API
2727E 758 Improve MimeMessage UTF8 handling
2828E 804 Restore streamProvider fields for backwards compatibility
2929E 810 InternetHeaders.InternetHeader toString()
30+ E 818 Change getSize() return type from int to long
3031
3132 CHANGES IN THE 2.1.5 RELEASE
3233 ----------------------------
You can’t perform that action at this time.
0 commit comments