#!/bin/bash

#  copy-image-resizer
#  Copyright © 2013 František Kučera (frantovo.cz)
#
#  This program is free software: you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation, either version 3 of the License, or
#  (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program. If not, see <http://www.gnu.org/licenses/>.

DIR="`dirname $0`";
JAR="$DIR/../java/copy-image-resizer/dist/copy-image-resizer.jar";

LOGGER="-Djava.util.logging.config.class=info.globalcode.sql.dk.logging.LoggerInitializer";
[ -n "$LOG_LEVEL" ] && LOGGER_LEVEL="-Dinfo.globalcode.sql.dk.logging.LoggerInitializer.level=$LOG_LEVEL";

CLASS_PATH="$JAR";

MAIN_CLASS="cz.frantovo.copyImageResizer.cli.CLIStarter";

LOGGER_INITIALIZER_CLASS="cz.frantovo.copyImageResizer.logging.ConsoleLoggerInitializer";
LOGGER="-Djava.util.logging.config.class=$LOGGER_INITIALIZER_CLASS";
[ -n "$LOG_LEVEL" ] && LOGGER_LEVEL="-D$LOGGER_INITIALIZER_CLASS.level=$LOG_LEVEL";

java $LOGGER $LOGGER_LEVEL -cp "$CLASS_PATH" $MAIN_CLASS "$@"

  
