public boolean execute()

in src/main/java/org/apache/sling/launchpad/base/impl/bootstrapcommands/BootstrapCommandFile.java [97:129]


    public boolean execute(BundleContext ctx) throws IOException {
        boolean needsRestart = false;
        if (anythingToExecute(ctx)) {
            InputStream is = null;
            try {
                is = new FileInputStream(commandFile);
                final List<Command> cmds = parse(is);
                for(Command cmd : cmds) {
                    try {
                        logger.log(Logger.LOG_DEBUG, "Executing command: " + cmd);
                        needsRestart |= cmd.execute(logger, ctx);
                    } catch(Exception e) {
                        logger.log(Logger.LOG_WARNING, "Exception in command execution (" + cmd + ") :" + e);
                    }
                }
            } finally {
                if(is != null) {
                    try {
                        is.close();
                    } catch(IOException ignore) {
                        // ignore
                    }
                }
            }

            try {
                storeTimestamp(ctx);
            } catch(IOException ioe) {
                logger.log(Logger.LOG_WARNING, "IOException while storing timestamp", ioe);
            }
        }
        return needsRestart;
    }