Example usage for javax.mail Folder hashCode

List of usage examples for javax.mail Folder hashCode

Introduction

In this page you can find the example usage for javax.mail Folder hashCode.

Prototype

@HotSpotIntrinsicCandidate
public native int hashCode();

Source Link

Document

Returns a hash code value for the object.

Usage

From source file:net.wastl.webmail.server.WebMailSession.java

/**
 * This method tries to generate a unique folder identifier for the given folder.
 * This method generates an MD5 sum over the complete folder URL, if possible.
 * @see getFolderTree/*from www  . jav a2s .co  m*/
 * @see net.wastl.webmail.misc.MD5
 */
protected String generateFolderHash(Folder folder) {
    String id = Integer.toHexString(folder.hashCode());
    // If possible, use the MD5-Sum for the folder ID because it is persistant over sessions
    try {
        MD5 md5 = new MD5(folder.getURLName());
        id = md5.asHex();
    } catch (MessagingException ex) {
    }

    return id;
}