2016-04-19 22:34:25 +02:00
|
|
|
/*
|
2016-04-26 23:02:26 +02:00
|
|
|
* Copyright (C) 2016 Didier Clermonté <dclermonte@april.org>
|
2016-04-19 22:34:25 +02:00
|
|
|
* Copyright (C) 2016 Christian Pierre Momon <christian.momon@devinsy.fr>
|
|
|
|
*
|
|
|
|
* This file is part of Siba.
|
|
|
|
*
|
|
|
|
* Siba is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU Affero 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 Affero General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2016-03-29 23:25:18 +02:00
|
|
|
package org.dclermonte.siba;
|
2016-03-27 22:32:35 +02:00
|
|
|
|
2016-05-24 16:39:05 +02:00
|
|
|
import java.io.File;
|
|
|
|
|
|
|
|
import org.apache.log4j.BasicConfigurator;
|
|
|
|
import org.apache.log4j.PropertyConfigurator;
|
2016-05-02 22:28:35 +02:00
|
|
|
import org.dclermonte.siba.cli.SibaCLI;
|
2016-03-29 23:25:18 +02:00
|
|
|
import org.dclermonte.siba.gui.SibaGUI;
|
2016-05-24 16:39:05 +02:00
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
2016-03-27 22:32:35 +02:00
|
|
|
|
2016-05-26 22:37:55 +02:00
|
|
|
/**
|
|
|
|
* This class Siba stands for Simple Backup. This is the main class.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* @param args
|
|
|
|
*/
|
2016-03-27 22:32:35 +02:00
|
|
|
public class Siba
|
|
|
|
{
|
2016-05-26 22:37:55 +02:00
|
|
|
|
2016-05-31 16:25:35 +02:00
|
|
|
public static final Logger logger = LoggerFactory.getLogger(Siba.class);
|
2016-05-18 23:20:29 +02:00
|
|
|
|
2016-05-19 18:40:00 +02:00
|
|
|
public static void main(final String[] args)
|
2016-03-27 22:32:35 +02:00
|
|
|
{
|
2016-05-24 16:39:05 +02:00
|
|
|
// Configure log.
|
|
|
|
File loggerConfig = new File("log4j.properties");
|
|
|
|
if (loggerConfig.exists())
|
|
|
|
{
|
|
|
|
PropertyConfigurator.configure(loggerConfig.getAbsolutePath());
|
|
|
|
logger.info("Dedicated log configuration done.");
|
|
|
|
logger.info("Configuration file was found in [{}].", loggerConfig.getAbsoluteFile());
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
BasicConfigurator.configure();
|
|
|
|
logger.info("Basic log configuration done.");
|
|
|
|
logger.info("Configuration file was not found in [{}].", loggerConfig.getAbsoluteFile());
|
|
|
|
}
|
2016-05-16 23:40:07 +02:00
|
|
|
|
2016-05-24 16:39:05 +02:00
|
|
|
// Run.
|
2016-05-18 23:20:29 +02:00
|
|
|
if (args.length == 0)
|
|
|
|
{
|
|
|
|
SibaGUI.run();
|
2016-03-27 22:32:35 +02:00
|
|
|
}
|
2016-05-18 23:20:29 +02:00
|
|
|
else
|
2016-05-02 22:28:35 +02:00
|
|
|
{
|
2016-05-18 23:20:29 +02:00
|
|
|
SibaCLI.run(args);
|
2016-05-02 22:28:35 +02:00
|
|
|
}
|
2016-03-27 22:32:35 +02:00
|
|
|
}
|
|
|
|
}
|