public boolean move( FtpFile newFile ) {
if( r == null ) {
throw new RuntimeException( "resource not saved yet" );
} else if( r instanceof MoveableResource ) {
MoveableResource src = (MoveableResource) r;
MiltonFtpFile dest = (MiltonFtpFile) newFile;
CollectionResource crDest;
crDest = dest.getParent();
String newName = dest.path.getName();
try {
src.moveTo( crDest, newName );
return true;
} catch( BadRequestException ex ) {
log.error( "bad request, can't move", ex );
return false;
} catch( NotAuthorizedException ex ) {