<commit_before>/*
 * Copyright 2015 ZAIDSOFT. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Initially Created on November 25, 2001, 11:37 AM
 */
package com.zaidsoft.webmail;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.FetchProfile;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.NoSuchProviderException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.UIDFolder;
import javax.mail.internet.MimeMessage;
import javax.mail.search.MessageIDTerm;

/**
 *
 * @author <NAME> <<EMAIL>>
 *
 */
public class IMAPBean implements java.io.Serializable, JspTreeInfo {

    public boolean DEBUG = true;

    // POP3 Accound (Server) details
    private String mailServer;
    private String username;
    private String password;

    //public void msgCache = new Hashtable(h);
    char seperator;
    Folder defaultFolder = null, folder = null;

    // the location on local filesystem where 
    // the mails are stored
    String storeLocation = null;

    public static boolean Use_UID_as_MsgID = true;

    // this method method should be called just ones and 
    // before all method calls
    public void setStoreLocation(String storeLoc) {
        storeLocation = storeLoc;
    }

    public void setServerInfo(String mailServer, String username, String password) throws NoSuchProviderException, MessagingException {
        this.mailServer = mailServer;
        this.username = username;
        this.password = password;
        init();
    }

    ////////////////////////////////////////////////////////////////////////////    
    public String getFolderName() {
        return folder.getName();
    }

    public void setFolder(String folderName) throws MessagingException {
        if (defaultFolder == null) {<commit_msg>added getter setter for username<commit_after>/*
 * Copyright 2015 ZAIDSOFT. All rights reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/*
 * Initially Created on November 25, 2001, 11:37 AM
 */
package com.zaidsoft.webmail;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Properties;
import javax.mail.Address;
import javax.mail.FetchProfile;
import javax.mail.Flags;
import javax.mail.Folder;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.NoSuchProviderException;
import javax.mail.Session;
import javax.mail.Store;
import javax.mail.UIDFolder;
import javax.mail.internet.MimeMessage;
import javax.mail.search.MessageIDTerm;

/**
 *
 * @author <NAME> <<EMAIL>>
 *
 */
public class IMAPBean implements java.io.Serializable, JspTreeInfo {

    public boolean DEBUG = true;

    // POP3 Accound (Server) details
    private String mailServer;
    private String username;
    private String password;

    public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	//public void msgCache = new Hashtable(h);
    char seperator;
    Folder defaultFolder = null, folder = null;

    // the location on local filesystem where 
    // the mails are stored
    String storeLocation = null;

    public static boolean Use_UID_as_MsgID = true;

    // this method method should be called just ones and 
    // before all method calls
    public void setStoreLocation(String storeLoc) {
        storeLocation = storeLoc;
    }

    public void setServerInfo(String mailServer, String username, String password) throws NoSuchProviderException, MessagingException {
        this.mailServer = mailServer;
        this.username = username;
        this.password = password;
        init();
    }

    ////////////////////////////////////////////////////////////////////////////    
    public String getFolderName() {
        return folder.getName();
    }

    public void setFolder(String folderName) throws MessagingException {
        if (defaultFolder == null) {
{'fraction_non_alphanumeric': 0.10988585799961308, 'fraction_numerical': 0.007351518668988199, 'mean_word_length': 3.0580847723704867, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6808811', 'n_tokens_mistral': 1395, 'n_tokens_neox': 1330, 'n_words': 487}