118 lines
3.6 KiB
Java
118 lines
3.6 KiB
Java
/*
|
|
* Copyright (C) 2020 Christian Pierre MOMON <christian@momon.org>
|
|
*
|
|
* This file is part of StatoolInfos, simple service statistics tool.
|
|
*
|
|
* StatoolInfos 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.
|
|
*
|
|
* StatoolInfos 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 StatoolInfos. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package fr.devinsy.statoolinfos.core;
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import fr.devinsy.statoolinfos.build.Builder;
|
|
import fr.devinsy.statoolinfos.crawl.Crawler;
|
|
import fr.devinsy.statoolinfos.htmlize.Htmlizer;
|
|
import fr.devinsy.statoolinfos.htmlize.probes.Prober;
|
|
|
|
/**
|
|
* The Class StatoolInfos.
|
|
*/
|
|
public class StatoolInfos
|
|
{
|
|
private static Logger logger = LoggerFactory.getLogger(StatoolInfos.class);
|
|
|
|
/**
|
|
* Builds the.
|
|
*
|
|
* @param configurationFile
|
|
* the input
|
|
* @throws StatoolInfosException
|
|
* the statool infos exception
|
|
* @throws IOException
|
|
* Signals that an I/O exception has occurred.
|
|
*/
|
|
public static void build(final File configurationFile) throws StatoolInfosException, IOException
|
|
{
|
|
Builder.build(configurationFile);
|
|
}
|
|
|
|
/**
|
|
* Clear.
|
|
*
|
|
* @param configurationFile
|
|
* the input
|
|
* @throws StatoolInfosException
|
|
* the statool infos exception
|
|
* @throws IOException
|
|
* Signals that an I/O exception has occurred.
|
|
*/
|
|
public static void clear(final File configurationFile) throws StatoolInfosException, IOException
|
|
{
|
|
logger.info("Clear {}", configurationFile.getAbsolutePath());
|
|
Configuration configuration = Factory.loadConfiguration(configurationFile);
|
|
|
|
Builder.clear(configuration);
|
|
Crawler.clear(configuration);
|
|
Htmlizer.clear(configuration);
|
|
}
|
|
|
|
/**
|
|
* Crawl.
|
|
*
|
|
* @param configurationFile
|
|
* the input
|
|
* @throws StatoolInfosException
|
|
* the statool infos exception
|
|
* @throws IOException
|
|
* Signals that an I/O exception has occurred.
|
|
*/
|
|
public static void crawl(final File configurationFile) throws StatoolInfosException, IOException
|
|
{
|
|
Crawler.crawl(configurationFile);
|
|
}
|
|
|
|
/**
|
|
* Htmlize.
|
|
*
|
|
* @param configurationFile
|
|
* the input
|
|
* @throws StatoolInfosException
|
|
* the statool infos exception
|
|
* @throws IOException
|
|
* Signals that an I/O exception has occurred.
|
|
*/
|
|
public static void htmlize(final File configurationFile) throws StatoolInfosException, IOException
|
|
{
|
|
Htmlizer.htmlize(configurationFile);
|
|
}
|
|
|
|
/**
|
|
* Stat.
|
|
*
|
|
* @param configurationFile
|
|
* the configuration file
|
|
* @throws StatoolInfosException
|
|
* the statool infos exception
|
|
* @throws IOException
|
|
* Signals that an I/O exception has occurred.
|
|
*/
|
|
public static void probe(final File configurationFile) throws StatoolInfosException, IOException
|
|
{
|
|
Prober.probe(configurationFile);
|
|
}
|
|
}
|