Package com.bradmcevoy.http

Examples of com.bradmcevoy.http.MoveableResource


    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 ) {
View Full Code Here


            return result( "target not found: " + srcPath );
        } else {
            if( target instanceof MoveableResource ) {

                CollectionResource currentParent = (CollectionResource) sourceCursor.getParent().getResource();
                MoveableResource mv = (MoveableResource) target;
                try {
                    mv.moveTo( currentParent, destName );
                } catch( NotAuthorizedException e ) {
                    return result( "not authorised" );
                } catch( BadRequestException e ) {
                    return result( "bad request" );
                } catch( ConflictException ex ) {
View Full Code Here

TOP

Related Classes of com.bradmcevoy.http.MoveableResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.