Examples of CommandExecutionException


Examples of de.mnl.srcpd4cu.util.CommandExecutionException

                updateStoredState(curState);
                fireStateChange(Cause.OTHER);
            }
            return curState;
        } catch (IOException e) {
            throw new CommandExecutionException(Command.ERROR_TIMEOUT);
        }
    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.CommandExecutionException

        switch (action) {

            case ASSUME:
                if (!poses.hasPose(id))
                    throw new CommandExecutionException("Pose \"" + id + "\" doesn't exist for " + npc.toString());

                if (target.name().equals("NPC"))
                    poses.assumePose(id);
                else {
                    Player player = ((BukkitScriptEntryData)scriptEntry.entryData).getPlayer().getPlayerEntity();
                    Location location = player.getLocation();
                    location.setYaw(poses.getPose(id).getYaw());
                    location.setPitch(poses.getPose(id).getPitch());

                    // The only way to change a player's yaw and pitch in Bukkit
                    // is to use teleport on him/her
                    player.teleport(location);
                }
                break;

            case ADD:
                if (!poses.addPose(id, pose_loc))
                    throw new CommandExecutionException(npc.toString() + " already has that pose!");
                break;

            case REMOVE:
                if (!poses.removePose(id))
                    throw new CommandExecutionException(npc.toString() + " does not have that pose!");
                break;

        }

    }
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.CommandExecutionException

            flag = DenizenAPI.getCurrentInstance().flagManager().getPlayerFlag((dPlayer) flag_target, name.asString());

        else if (flag_target instanceof dNPC)
            flag = DenizenAPI.getCurrentInstance().flagManager().getNPCFlag(((dNPC) flag_target).getId(), name.asString());

        else throw new CommandExecutionException("Could not fetch a flag for this entity: " + flag_target.debug());

        // Do the action!
        flag.doAction(action, value, index);

        // Set flag duration
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.CommandExecutionException

            dObject fetched;

        // Check to make sure this is a valid constructor by checking the 'matches' static method
            if (!ObjectFetcher.checkMatch(object_class, object))
                throw new CommandExecutionException('\'' + object + "' is returning null.");

            // Get the object with the 'valueOf' static method
            fetched = ObjectFetcher.getObjectFrom(object_class, object);

            // Make sure this object is Adjustable
View Full Code Here

Examples of net.aufdemrand.denizencore.exceptions.CommandExecutionException

            scriptEntry.addObject("created_map", new Element(map.getId()));
        }
        else if (id != null) {
            map = Bukkit.getServer().getMap((short) id.asInt());
            if (map == null)
                throw new CommandExecutionException("No map found for ID '" + id.asInt() + "'!");
        }
        else {
            throw new CommandExecutionException("The map command failed somehow! Report this to a developer!");
        }

        if (reset != null) {
            for (MapRenderer renderer : map.getRenderers()) {
                if (renderer instanceof DenizenMapRenderer) {
View Full Code Here

Examples of org.apache.maven.wagon.CommandExecutionException

        {
            privateKey = ScpHelper.getPrivateKey( authenticationInfo );
        }
        catch ( FileNotFoundException e )
        {
            throw new CommandExecutionException( e.getMessage(), e );
        }
        Commandline cl = createBaseCommandLine( putty, sshExecutable, privateKey );

        int port =
            repository.getPort() == WagonConstants.UNKNOWN_PORT ? ScpHelper.DEFAULT_SSH_PORT : repository.getPort();
        if ( port != ScpHelper.DEFAULT_SSH_PORT )
        {
            if ( putty )
            {
                cl.createArg().setLine( "-P " + port );
            }
            else
            {
                cl.createArg().setLine( "-p " + port );
            }
        }

        if ( sshArgs != null )
        {
            cl.createArg().setLine( sshArgs );
        }

        String remoteHost = this.buildRemoteHost();

        cl.createArg().setValue( remoteHost );

        cl.createArg().setValue( command );

        fireSessionDebug( "Executing command: " + cl.toString() );

        try
        {
            CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
            int exitCode = CommandLineUtils.executeCommandLine( cl, out, err );
            Streams streams = new Streams();
            streams.setOut( out.getOutput() );
            streams.setErr( err.getOutput() );
            fireSessionDebug( streams.getOut() );
            fireSessionDebug( streams.getErr() );
            if ( exitCode != 0 )
            {
                if ( !ignoreFailures || exitCode == SSH_FATAL_EXIT_CODE )
                {
                    throw new CommandExecutionException( "Exit code " + exitCode + " - " + err.getOutput() );
                }
            }
            return streams;
        }
        catch ( CommandLineException e )
        {
            throw new CommandExecutionException( "Error executing command line", e );
        }
    }
View Full Code Here

Examples of org.apache.maven.wagon.CommandExecutionException

            Streams streams = CommandExecutorStreamProcessor.processStreams( stderrReader, stdoutReader );

            if ( streams.getErr().length() > 0 && !ignoreFailures )
            {
                int exitCode = channel.getExitStatus();
                throw new CommandExecutionException( "Exit code: " + exitCode + " - " + streams.getErr() );
            }

            return streams;
        }
        catch ( IOException e )
        {
            throw new CommandExecutionException( "Cannot execute remote command: " + command, e );
        }
        catch ( JSchException e )
        {
            throw new CommandExecutionException( "Cannot execute remote command: " + command, e );
        }
        finally
        {
            IOUtil.close( stdoutReader );
            IOUtil.close( stderrReader );
View Full Code Here

Examples of org.apache.maven.wagon.CommandExecutionException

        Wagon targetWagon = wagonManager.getWagon( targetRepository );

        if ( ! ( targetWagon instanceof CommandExecutor ) )
        {
            throw new CommandExecutionException( "Wagon class '" + targetWagon.getClass().getName() +
                "' in use for target repository is not a CommandExecutor" );
        }

        AuthenticationInfo targetAuth = wagonManager.getAuthenticationInfo( targetRepository.getId() );
View Full Code Here

Examples of org.apache.maven.wagon.CommandExecutionException

            Streams streams = CommandExecutorStreamProcessor.processStreams( stderrReader, stdoutReader );

            if ( streams.getErr().length() > 0 && !ignoreFailures )
            {
                int exitCode = channel.getExitStatus();
                throw new CommandExecutionException( "Exit code: " + exitCode + " - " + streams.getErr() );
            }

            return streams;
        }
        catch ( IOException e )
        {
            throw new CommandExecutionException( "Cannot execute remote command: " + command, e );
        }
        catch ( JSchException e )
        {
            throw new CommandExecutionException( "Cannot execute remote command: " + command, e );
        }
        finally
        {
            IOUtil.close( stdoutReader );
            IOUtil.close( stderrReader );
View Full Code Here

Examples of org.apache.maven.wagon.CommandExecutionException

        {
            privateKey = ScpHelper.getPrivateKey( authenticationInfo );
        }
        catch ( FileNotFoundException e )
        {
            throw new CommandExecutionException( e.getMessage(), e );
        }
        Commandline cl = createBaseCommandLine( putty, sshExecutable, privateKey );

        int port =
            repository.getPort() == WagonConstants.UNKNOWN_PORT ? ScpHelper.DEFAULT_SSH_PORT : repository.getPort();
        if ( port != ScpHelper.DEFAULT_SSH_PORT )
        {
            if ( putty )
            {
                cl.createArg().setLine( "-P " + port );
            }
            else
            {
                cl.createArg().setLine( "-p " + port );
            }
        }

        if ( sshArgs != null )
        {
            cl.createArg().setLine( sshArgs );
        }

        String remoteHost = this.buildRemoteHost();

        cl.createArg().setValue( remoteHost );

        cl.createArg().setValue( command );

        fireSessionDebug( "Executing command: " + cl.toString() );

        try
        {
            CommandLineUtils.StringStreamConsumer out = new CommandLineUtils.StringStreamConsumer();
            CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
            int exitCode = CommandLineUtils.executeCommandLine( cl, out, err );
            Streams streams = new Streams();
            streams.setOut( out.getOutput() );
            streams.setErr( err.getOutput() );
            fireSessionDebug( streams.getOut() );
            fireSessionDebug( streams.getErr() );
            if ( exitCode != 0 )
            {
                if ( !ignoreFailures || exitCode == SSH_FATAL_EXIT_CODE )
                {
                    throw new CommandExecutionException( "Exit code " + exitCode + " - " + err.getOutput() );
                }
            }
            return streams;
        }
        catch ( CommandLineException e )
        {
            throw new CommandExecutionException( "Error executing command line", e );
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.