wood burning stoves 2.0*
The moose likes Other JSE/JEE APIs and the fly likes Javamail rename folder Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Javamail rename folder" Watch "Javamail rename folder" New topic
Author

Javamail rename folder

Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
Hi,

I am trying to rename a folder using java mail api but unable to do so.

Below is the pseudo code



Its always returning false, failing to rename the folder.

Please tell me what wrong I am doing here and how to make it work.

We are currently using javamail-1.2ea2 version.

Thanks,
Rawat


rawat
SCJP 1.4
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41880
    
  63
For starters, use a recent version of JavaMail. Yours is more than 10 years old.


Ping & DNS - my free Android networking tools app
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Does the underlying OS allow renaming?

WP
Himanshu Rawat
Ranch Hand

Joined: Nov 27, 2005
Posts: 141
Ok. I will try with upgraded version of JavaMail.

OS allows everything if permissions are there.

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41880
    
  63
I wouldn't think that OS permissions have much to do with renaming a mail directory. Could be, I guess, but a mail server based on file system storage creates, renames and deletes files all the time, so it needs those permissions to function.
William P O'Sullivan
Ranch Hand

Joined: Mar 28, 2012
Posts: 859

Well, we don't know from the OP if this is a stand-alone Java application, or a web-application.

If web then the server runs under an account, which may be passed to the IMAP server.

Returning "false" indicates that the rename failed, and it looks like no other data is available.

If this is M$ Exchange, may be possible to look at the logs or events on the host.

WP
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javamail rename folder