001 /**
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements. See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License. You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 package org.apache.geronimo.javamail.store.imap.connection;
019
020 import java.util.List;
021
022 import javax.mail.MessagingException;
023
024 /**
025 * Util class to represent a list response from a IMAP server
026 *
027 * @version $Rev: 594520 $ $Date: 2007-11-13 07:57:39 -0500 (Tue, 13 Nov 2007) $
028 */
029
030 public class IMAPQuotaRootResponse extends IMAPUntaggedResponse {
031 // the mailbox this applies to
032 public String mailbox;
033 // The list of quota roots
034 public List roots;
035
036
037 /**
038 * Construct a LIST response item. This can be either
039 * a response from a LIST command or an LSUB command,
040 * and will be tagged accordingly.
041 *
042 * @param type The type of resonse (LIST or LSUB).
043 * @param data The raw response data.
044 * @param source The tokenizer source.
045 *
046 * @exception MessagingException
047 */
048 public IMAPQuotaRootResponse(byte[] data, IMAPResponseTokenizer source) throws MessagingException {
049 super("QUOTAROOT", data);
050
051 // first token is the mailbox
052 mailbox = source.readEncodedString();
053 // get the root name list as the remainder of the command.
054 roots = source.readStrings();
055 }
056 }
057