log( msg, Project.MSG_ERR );
}
}
log( "Create collection management service for collection " + base.getName(), Project.MSG_DEBUG );
final CollectionManagementServiceImpl service = (CollectionManagementServiceImpl)base.getService( "CollectionManagementService", "1.0" );
if( resource != null ) {
log( "Moving resource: " + resource, Project.MSG_INFO );
final Resource res = base.getResource( resource );
if( res == null ) {
final String msg = "Resource " + resource + " not found.";
if( failonerror ) {
throw( new BuildException( msg ) );
} else {
log( msg, Project.MSG_ERR );
}
} else {
service.moveResource( XmldbURI.xmldbUriFor( resource ), XmldbURI.xmldbUriFor( destination ), XmldbURI.xmldbUriFor( name ) );
}
} else {
log( "Moving collection: " + collection, Project.MSG_INFO );
service.move( XmldbURI.xmldbUriFor( collection ), XmldbURI.xmldbUriFor( destination ), XmldbURI.xmldbUriFor( name ) );
}
}
catch( final XMLDBException e ) {
final String msg = "XMLDB exception during move: " + e.getMessage();