Copying and Deleting

In a Move or Copy operation, the first argument is the thing to move or make a copy of, the second argument is the parent to move or copy to (which will be the same as the current parent for a rename operation), and the third argument is the name to give the resource, which will usually be the current name if the resource is being moved to a different folder

An example from Bandstand:

    public void move(Image image, BaseEntity newParent, String newName) {
        Transaction tx = SessionManager.session().beginTransaction();
        if( newParent != image.getBaseEntity()) {
            BaseEntity oldParent = image.getBaseEntity();
            if( newParent.getImages() == null ) {
                newParent.setImages(new ArrayList<Image>());


Note that moves and copies are not done recursively by milton, its up to you to ensure that child resources are copied correctly.

Next Article:

Locking resources