class DeployActivitySpecs {

    public static void main(String[] args) throws Exception {

        if (args == null || args.length == 0) {
            logger.info("Please specify hostname argument");
            return;
        }

        String hostname = args[0];

        File dir = new File(ACTIVITY_FILE_LOCATION);
        if (!dir.isDirectory()) {
            logger.debug("ActivitySpec store is not a directory");
            return;
        }

        if (dir.listFiles() != null) {
            for (File f : dir.listFiles()) {
                String activitySpecName = f.getName();
                String errorMessage = deployActivitySpec(hostname, activitySpecName);
                if (errorMessage == null) {
                    logger.debug("Deployed Activity Spec: " + activitySpecName);
                } else {
                    logger.error("Error deploying Activity Spec: " + activitySpecName + " : " + errorMessage);
                }
            }
        } else {
            logger.error("Null file list for Activity Specs.");
        }
    }

}