statoolinfosweb/src/fr/devinsy/statoolinfos/core/StatoolInfos.java

119 lines
3.6 KiB
Java
Raw Normal View History

2020-09-13 01:28:27 +02:00
/*
* 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;
2020-10-15 01:47:48 +02:00
import fr.devinsy.statoolinfos.htmlize.probes.Prober;
2020-09-15 03:16:26 +02:00
2020-09-13 01:28:27 +02:00
/**
* 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
2020-09-13 01:28:27 +02:00
* @throws IOException
* Signals that an I/O exception has occurred.
2020-09-13 01:28:27 +02:00
*/
public static void build(final File configurationFile) throws StatoolInfosException, IOException
2020-09-13 01:28:27 +02:00
{
Builder.build(configurationFile);
2020-09-13 01:28:27 +02:00
}
/**
* Clear.
*
* @param configurationFile
2020-09-13 01:28:27 +02:00
* the input
* @throws StatoolInfosException
* the statool infos exception
* @throws IOException
* Signals that an I/O exception has occurred.
2020-09-13 01:28:27 +02:00
*/
public static void clear(final File configurationFile) throws StatoolInfosException, IOException
2020-09-13 01:28:27 +02:00
{
logger.info("Clear {}", configurationFile.getAbsolutePath());
Configuration configuration = Factory.loadConfiguration(configurationFile);
2020-09-13 01:28:27 +02:00
Builder.clear(configuration);
Crawler.clear(configuration);
Htmlizer.clear(configuration);
2020-09-13 01:28:27 +02:00
}
/**
* Crawl.
*
* @param configurationFile
2020-09-13 01:28:27 +02:00
* the input
* @throws StatoolInfosException
* the statool infos exception
* @throws IOException
* Signals that an I/O exception has occurred.
2020-09-13 01:28:27 +02:00
*/
public static void crawl(final File configurationFile) throws StatoolInfosException, IOException
2020-09-13 01:28:27 +02:00
{
Crawler.crawl(configurationFile);
2020-09-13 01:28:27 +02:00
}
/**
* Htmlize.
*
* @param configurationFile
2020-09-13 01:28:27 +02:00
* the input
* @throws StatoolInfosException
* the statool infos exception
* @throws IOException
* Signals that an I/O exception has occurred.
2020-09-13 01:28:27 +02:00
*/
public static void htmlize(final File configurationFile) throws StatoolInfosException, IOException
2020-09-13 01:28:27 +02:00
{
Htmlizer.htmlize(configurationFile);
2020-09-13 01:28:27 +02:00
}
2020-10-15 01:47:48 +02:00
/**
* 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);
}
2020-09-13 01:28:27 +02:00
}