Moyosoft Products | Services | Download | Contact us    
Java Bridge to Exchange
import com.moyosoft.exchange.*;
import com.moyosoft.exchange.folder.*;

public class CreateFolder
{
  public static void main(String[] argsthrows ExchangeServiceException
  {
    // To provide hostname and credentials information, use:
    // Exchange exchange = new Exchange("hostname", "username", "password");
    Exchange exchange = ExchangeConnectionDialog.display();

    if(exchange == null)
    {
      return;
    }

    // Create a new folder in the top folder.
    // The new folder will contain tasks.
    ExchangeFolder folder = exchange.getTopFolder().createFolder(
        FolderContentType.Tasks,
        "My tasks folder");

    // Display the ID of the new folder
    System.out.println("Created folder ID: " + folder.getFolderId());
    
    // Delete the created folder
    folder.delete(false);
  }
}