0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. 829N/A * Copyright (c) 1997-2016 Oracle and/or its affiliates. All rights reserved. 0N/A * The contents of this file are subject to the terms of either the GNU 0N/A * General Public License Version 2 only ("GPL") or the Common Development 0N/A * and Distribution License("CDDL") (collectively, the "License"). You 292N/A * may not use this file except in compliance with the License. You can 292N/A * obtain a copy of the License at 0N/A * language governing permissions and limitations under the License. 0N/A * When distributing the software, include this License Header Notice in each 292N/A * GPL Classpath Exception: 292N/A * Oracle designates this particular file as subject to the "Classpath" 292N/A * exception as provided by Oracle in the GPL Version 2 section of the License 292N/A * file that accompanied this code. 292N/A * If applicable, add the following below the License Header, with the fields 292N/A * enclosed by brackets [] replaced by your own identifying information: 292N/A * "Portions Copyright [year] [name of copyright owner]" 0N/A * If you wish your version of this file to be governed by only the CDDL or 0N/A * only the GPL Version 2, indicate your decision by adding "[Contributor] 0N/A * elects to include this software in this distribution under the [CDDL or GPL 0N/A * Version 2] license." If you don't indicate a single choice of license, a 0N/A * recipient has the option to distribute your version of this file under 0N/A * either the CDDL, the GPL Version 2 or to extend the choice of license to 0N/A * its licensees as provided above. However, if you add GPL Version 2 code 0N/A * and therefore, elected the GPL Version 2 license, then the option applies 0N/A * only if the new code is made subject to such option by the copyright 0N/A * A POP3 Folder (can only be "INBOX"). 0N/A * documentation for further information on the POP3 protocol provider. <p> 0N/A * @author Bill Shannon 0N/A * @author John Mani (ported to the javax.mail APIs) 0N/A * Always true for the folder "INBOX", always false for 0N/A * @return true for INBOX, false otherwise 0N/A * Always throws <code>MessagingException</code> because no POP3 folders 0N/A * can contain subfolders. 0N/A * @exception MessagingException always 0N/A * Always returns a NUL character because POP3 doesn't support a hierarchy. 0N/A * Always returns Folder.HOLDS_MESSAGES. 0N/A * @return Folder.HOLDS_MESSAGES 0N/A * Always returns <code>false</code>; the POP3 protocol doesn't 0N/A * support creating folders. 0N/A * Always returns <code>false</code>; the POP3 protocol provides 0N/A * no way to determine when a new message arrives. 0N/A return false;
// no way to know 0N/A * Always throws <code>MessagingException</code> because no POP3 folders 0N/A * can contain subfolders. 0N/A * @exception MessagingException always 0N/A * Always throws <code>MethodNotSupportedException</code> 0N/A * because the POP3 protocol doesn't allow the INBOX to 0N/A * @exception MethodNotSupportedException always 0N/A * Always throws <code>MethodNotSupportedException</code> 0N/A * because the POP3 protocol doesn't support multiple folders. 0N/A * @exception MethodNotSupportedException always 0N/A * Throws <code>FolderNotFoundException</code> unless this 0N/A * folder is named "INBOX". 0N/A * @exception FolderNotFoundException if not INBOX 610N/A * @exception AuthenticationFailedException authentication failures 0N/A * @exception MessagingException other open failures 788N/A // Create the message cache array of appropriate size 0N/A * Some POP3 servers will mark messages for deletion when 0N/A * they're read. To prevent such messages from being 0N/A * deleted before the client deletes them, you can set 0N/A * the mail.pop3.rsetbeforequit property to true. This 0N/A * causes us to issue a POP3 RSET command to clear all 0N/A * the "marked for deletion" flags. We can then explicitly 0N/A * delete messages as desired. 0N/A // find all messages marked deleted and issue DELE commands 0N/A "Exception deleting messages during close",
411N/A * Flush and free all cached data for the messages. 0N/A * Always returns an empty <code>Flags</code> object because 0N/A * the POP3 protocol doesn't support any permanent flags. 0N/A * @return empty Flags object 0N/A return new Flags();
// empty flags object 0N/A * Will not change while the folder is open because the POP3 0N/A * protocol doesn't support notification of new messages 0N/A * arriving in open folders. 0N/A // Assuming that msgno is <= total 0N/A * Always throws <code>MethodNotSupportedException</code> 0N/A * because the POP3 protocol doesn't support appending messages. 0N/A * @exception MethodNotSupportedException always 0N/A * Always throws <code>MethodNotSupportedException</code> 0N/A * because the POP3 protocol doesn't support expunging messages 0N/A * without closing the folder; call the {@link #close close} method 0N/A * with the <code>expunge</code> argument set to <code>true</code> 0N/A * @exception MethodNotSupportedException always 0N/A * Prefetch information about POP3 messages. 0N/A * If the FetchProfile contains <code>UIDFolder.FetchProfileItem.UID</code>, 0N/A * POP3 UIDs for all messages in the folder are fetched using the POP3 0N/A * If the FetchProfile contains <code>FetchProfile.Item.ENVELOPE</code>, 0N/A * the headers and size of all messages are fetched using the POP3 TOP 0N/A * and LIST commands. 0N/A * Since the POP3 protocol only lets us fetch the UID 0N/A * for a single message or for all messages, we go ahead 0N/A * and fetch UIDs for all messages here, ignoring the msgs 0N/A * parameter. We could be more intelligent and base this 0N/A * decision on the number of messages fetched, or the 0N/A * percentage of the total number of messages fetched. 0N/A // fetch message size 0N/A // should never happen, but ignore it if it does 0N/A * Return the unique ID string for this message, or null if 0N/A * not available. Uses the POP3 UIDL command. 610N/A * @param msg the message 0N/A * @return unique ID string 610N/A * @exception MessagingException for failures 0N/A * Return the size of this folder, as was returned by the POP3 STAT 0N/A * command when this folder was opened. 0N/A * @return folder size 0N/A * @exception IllegalStateException if the folder isn't open 610N/A * @exception MessagingException for other failures 0N/A * Return the sizes of all messages in this folder, as returned 0N/A * by the POP3 LIST command. Each entry in the array corresponds 0N/A * to a message; entry <i>i</i> corresponds to message number <i>i+1</i>. 0N/A * @return array of message sizes 0N/A * @exception IllegalStateException if the folder isn't open 610N/A * @exception MessagingException for other failures 0N/A * @since JavaMail 1.3.3 0N/A * Return the raw results of the POP3 LIST command with no arguments. 0N/A * @return InputStream containing results 0N/A * @exception IllegalStateException if the folder isn't open 610N/A * @exception IOException for I/O errors talking to the server 610N/A * @exception MessagingException for other errors 0N/A * @since JavaMail 1.3.3 0N/A * Close the folder when we're finalized. 0N/A /* Ensure the folder is open */ 0N/A /* Ensure the folder is not open */ 0N/A /* Ensure the folder is open & readable */ 0N/A /* Ensure the folder is open & writable */ 255N/A private void checkWritable() throws IllegalStateException { 0N/A if (!opened || mode != READ_WRITE) 0N/A throw new IllegalStateException("Folder is not Writable"); 0N/A * Centralize access to the Protocol object by POP3Message 0N/A * objects so that they will fail appropriately when the folder 255N/A // close() might happen here 0N/A * Only here to make accessible to POP3Message.