foldername += buf.toString();
foldername = foldername.replace('"',' ').trim();
System.out.println("FOLDERNAME FOR COPIING: " + foldername);
try {
ACLMailbox targetMailbox = getMailbox( session, foldername, this.commandName );
if ( targetMailbox == null ) {
return;
}
if ( !targetMailbox.hasInsertRights( session.getCurrentUser() ) ) {
session.noResponse( this.commandName, "Insert access not granted." );
return;
}
for (int i = 0; i < set.size(); i++) {
if (useUIDs) {
Integer uidObject = (Integer)set.get(i);
int uid = uidObject.intValue();
MimeMessage message = (MimeMessage)
session.getCurrentMailbox().retrieveUID(uid, session.getCurrentUser() );
/*MessageAttributes mattr =
session.getCurrentMailbox().getMessageAttributesUID(uid, session.getCurrentUser() );
Flags flags = new Flags();
flags.setFlags(session.getCurrentMailbox().getFlagsUID(uid, session.getCurrentUser()),
session.getCurrentUser());
*/
targetMailbox.store(message, session.getCurrentUser());
} else {
int msn = ((Integer)set.get( 0 ) ).intValue();
MimeMessage message = (MimeMessage)
session.getCurrentMailbox().retrieve(msn, session.getCurrentUser() );
/*MessageAttributes mattr =
session.getCurrentMailbox().getMessageAttributes(msn, session.getCurrentUser() );
Flags flags = new Flags();
flags.setFlags(session.getCurrentMailbox().getFlags(msn, session.getCurrentUser()),
session.getCurrentUser());
*/
targetMailbox.store(message, session.getCurrentUser());
}
}
caller.checkSize();
out.println(tag + SP + OK + SP + "COPY completed");