< prev index next >

jaxws/src/java.xml.ws/share/classes/com/sun/xml/internal/messaging/saaj/packaging/mime/internet/MimeMultipart.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 131,140 **** --- 131,141 ---- * A unique boundary string is generated and this string is * setup as the "boundary" parameter for the * <code>contentType</code> field. <p> * * MimeBodyParts may be added later. + * @param subtype subtype. */ public MimeMultipart(String subtype) { //super(); /* * Compute a boundary string.
*** 161,170 **** --- 162,173 ---- * @param ds DataSource, can be a MultipartDataSource * @param ct * This must be the same information as {@link DataSource#getContentType()}. * All the callers of this method seem to have this object handy, so * for performance reason this method accepts it. Can be null. + * + * @exception MessagingException in case of error */ public MimeMultipart(DataSource ds, ContentType ct) throws MessagingException { // 'ds' was not a MultipartDataSource, we have // to parse this ourself. parsed = false;
*** 187,197 **** } /** * Return the number of enclosed MimeBodyPart objects. * ! * @return number of parts */ public int getCount() throws MessagingException { parse(); if (parts == null) return 0; --- 190,201 ---- } /** * Return the number of enclosed MimeBodyPart objects. * ! * @return number of parts. ! * @throws MessagingException in case of error. */ public int getCount() throws MessagingException { parse(); if (parts == null) return 0;
*** 200,211 **** } /** * Get the specified MimeBodyPart. BodyParts are numbered starting at 0. * ! * @param index the index of the desired MimeBodyPart ! * @return the MimeBodyPart * @exception MessagingException if no such MimeBodyPart exists */ public MimeBodyPart getBodyPart(int index) throws MessagingException { parse(); --- 204,215 ---- } /** * Get the specified MimeBodyPart. BodyParts are numbered starting at 0. * ! * @param index the index of the desired MimeBodyPart. ! * @return the MimeBodyPart. * @exception MessagingException if no such MimeBodyPart exists */ public MimeBodyPart getBodyPart(int index) throws MessagingException { parse();
*** 219,228 **** --- 223,233 ---- * Get the MimeBodyPart referred to by the given ContentID (CID). * Returns null if the part is not found. * * @param CID the ContentID of the desired part * @return the MimeBodyPart + * @exception MessagingException if no such MimeBodyPart exists. */ public MimeBodyPart getBodyPart(String CID) throws MessagingException { parse();
*** 254,272 **** --- 259,284 ---- * send process, however note that a client is free to call * it any number of times. So if the header updating process is * expensive for a specific MimeMultipart subclass, then it * might itself want to track whether its internal state actually * did change, and do the header updating only if necessary. + * + * @exception MessagingException in case of error. */ protected void updateHeaders() throws MessagingException { for (int i = 0; i < parts.size(); i++) parts.get(i).updateHeaders(); } /** * Iterates through all the parts and outputs each Mime part * separated by a boundary. + * + * @param os output stream. + * + * @exception IOException if an I/O Error occurs. + * @exception MessagingException in case of error. */ public void writeTo(OutputStream os) throws IOException, MessagingException { parse();
*** 289,298 **** --- 301,312 ---- * appropriate MimeBodyParts. The <code>parsed</code> flag is * set to true, and if true on entry nothing is done. This * method is called by all other methods that need data for * the body parts, to make sure the data has been parsed. * + * @exception MessagingException in case of error. + * * @since JavaMail 1.2 */ protected void parse() throws MessagingException { if (parsed) return;
*** 488,499 **** * headers from the given InputStream. Subclasses can override * this method to return a subclass of InternetHeaders, if * necessary. This implementation simply constructs and returns * an InternetHeaders object. * ! * @param is the InputStream to read the headers from ! * @exception MessagingException * @since JavaMail 1.2 */ protected InternetHeaders createInternetHeaders(InputStream is) throws MessagingException { return new InternetHeaders(is); --- 502,514 ---- * headers from the given InputStream. Subclasses can override * this method to return a subclass of InternetHeaders, if * necessary. This implementation simply constructs and returns * an InternetHeaders object. * ! * @param is the InputStream to read the headers from. ! * @return headers. ! * @exception MessagingException in case of error. * @since JavaMail 1.2 */ protected InternetHeaders createInternetHeaders(InputStream is) throws MessagingException { return new InternetHeaders(is);
*** 504,515 **** * body part parsed from the InputStream. Subclasses can override * this method to return a subclass of MimeBodyPart, if * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * ! * @param headers the headers for the body part ! * @param content the content of the body part * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) { return new MimeBodyPart(headers, content,len); } --- 519,532 ---- * body part parsed from the InputStream. Subclasses can override * this method to return a subclass of MimeBodyPart, if * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * ! * @param headers the headers for the body part. ! * @param content the content of the body part. ! * @param len the content length. ! * @return MimeBodyPart * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InternetHeaders headers, byte[] content, int len) { return new MimeBodyPart(headers, content,len); }
*** 519,530 **** * body part parsed from the InputStream. Subclasses can override * this method to return a subclass of MimeBodyPart, if * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * ! * @param is InputStream containing the body part ! * @exception MessagingException * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException { return new MimeBodyPart(is); } --- 536,548 ---- * body part parsed from the InputStream. Subclasses can override * this method to return a subclass of MimeBodyPart, if * necessary. This implementation simply constructs and returns * a MimeBodyPart object. * ! * @param is InputStream containing the body part. ! * @return MimeBodyPart. ! * @exception MessagingException in case of error. * @since JavaMail 1.2 */ protected MimeBodyPart createMimeBodyPart(InputStream is) throws MessagingException { return new MimeBodyPart(is); }
*** 541,552 **** * the individual body parts (for example, an IMAP datasource), but * needs to create an appropriate MimeMultipart subclass that represents * a specific multipart subtype. * * @param mp MimeMultipart datasource */ - protected void setMultipartDataSource(MultipartDataSource mp) throws MessagingException { contentType = new ContentType(mp.getContentType()); int count = mp.getCount(); --- 559,570 ---- * the individual body parts (for example, an IMAP datasource), but * needs to create an appropriate MimeMultipart subclass that represents * a specific multipart subtype. * * @param mp MimeMultipart datasource + * @exception MessagingException in case of error. */ protected void setMultipartDataSource(MultipartDataSource mp) throws MessagingException { contentType = new ContentType(mp.getContentType()); int count = mp.getCount();
< prev index next >