Package javax.mail

Class Store

    • Constructor Detail

      • Store

        protected Store​(Session session,
                        URLName url)
        Constructor.
        Parameters:
        session - session context for this store
        url - URLName to be used for this store
    • Method Detail

      • getDefaultFolder

        public abstract Folder getDefaultFolder()
                                         throws MessagingException
        Returns a folder that represents the root of the primary namespace presented to the user by this store.
        Throws:
        java.lang.IllegalStateException - if the store is not connected
        MessagingException
      • getFolder

        public abstract Folder getFolder​(java.lang.String name)
                                  throws MessagingException
        Returns the folder with the given name.

        The exists method can be used to determine whether the folder actually exists.

        In some Stores, name can be an absolute path if it starts with the hierarchy delimiter. Otherwise it is interpreted relative to the root of this namespace.

        Parameters:
        name - the folder name
        Throws:
        java.lang.IllegalStateException - if the store is not connected
        MessagingException
      • getFolder

        public abstract Folder getFolder​(URLName url)
                                  throws MessagingException
        Returns the folder corresponding to the given URLName.
        Parameters:
        url - a URLName denoting a folder
        Throws:
        java.lang.IllegalStateException - if this store is not connected
        MessagingException
      • addStoreListener

        public void addStoreListener​(StoreListener l)
        Adds a listener for store events on this store.
      • removeStoreListener

        public void removeStoreListener​(StoreListener l)
        Removes a store events listener.
      • notifyStoreListeners

        protected void notifyStoreListeners​(int type,
                                            java.lang.String message)
        Notifies all store event listeners.
      • addFolderListener

        public void addFolderListener​(FolderListener l)
        Adds a listener for folder events on any folder object obtained from this store.
      • removeFolderListener

        public void removeFolderListener​(FolderListener l)
        Removes a folder event listener.
      • notifyFolderListeners

        protected void notifyFolderListeners​(int type,
                                             Folder folder)
        Notifies all folder listeners.
      • notifyFolderRenamedListeners

        protected void notifyFolderRenamedListeners​(Folder oldFolder,
                                                    Folder newFolder)
        Notifies all folder listeners about the renaming of a folder.