Removed htmlize target directory conf.
This commit is contained in:
parent
6bf7610328
commit
93c06e728a
4 changed files with 17 additions and 76 deletions
|
@ -31,5 +31,10 @@
|
||||||
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.36.0.3.jar"/>
|
<classpathentry kind="lib" path="lib/sqlite-jdbc-3.36.0.3.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/mysql-jdbc-5.0.8.jar"/>
|
<classpathentry kind="lib" path="lib/mysql-jdbc-5.0.8.jar"/>
|
||||||
<classpathentry kind="lib" path="lib/devinsy-strings-0.17.0.jar" sourcepath="lib/devinsy-strings-0.17.0-sources.zip"/>
|
<classpathentry kind="lib" path="lib/devinsy-strings-0.17.0.jar" sourcepath="lib/devinsy-strings-0.17.0-sources.zip"/>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/apache-tomcat-10.1.12">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="owner.project.facets" value="jst.utility"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="bin"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<faceted-project>
|
<faceted-project>
|
||||||
|
<runtime name="apache-tomcat-10.1.12"/>
|
||||||
<fixed facet="java"/>
|
<fixed facet="java"/>
|
||||||
<fixed facet="jst.utility"/>
|
<fixed facet="jst.utility"/>
|
||||||
<installed facet="jst.utility" version="1.0"/>
|
<installed facet="jst.utility" version="1.0"/>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2020 Christian Pierre MOMON <christian@momon.org>
|
* Copyright (C) 2020-2024 Christian Pierre MOMON <christian@momon.org>
|
||||||
*
|
*
|
||||||
* This file is part of StatoolInfos, simple service statistics tool.
|
* This file is part of StatoolInfos, simple service statistics tool.
|
||||||
*
|
*
|
||||||
|
@ -30,17 +30,17 @@ import fr.devinsy.statoolinfos.crawl.CrawlCache;
|
||||||
import fr.devinsy.statoolinfos.uptime.UptimeJournal;
|
import fr.devinsy.statoolinfos.uptime.UptimeJournal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Class Manager.
|
* The Class HtmlizerContext.
|
||||||
*/
|
*/
|
||||||
public class HtmlizerContext
|
public class HtmlizerContext
|
||||||
{
|
{
|
||||||
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HtmlizerContext.class);
|
|
||||||
|
|
||||||
private static class SingletonHolder
|
private static class SingletonHolder
|
||||||
{
|
{
|
||||||
private static final HtmlizerContext instance = new HtmlizerContext();
|
private static final HtmlizerContext instance = new HtmlizerContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(HtmlizerContext.class);
|
||||||
|
|
||||||
private Configuration configuration;
|
private Configuration configuration;
|
||||||
private Federation federation;
|
private Federation federation;
|
||||||
private Categories categories;
|
private Categories categories;
|
||||||
|
@ -68,25 +68,9 @@ public class HtmlizerContext
|
||||||
|
|
||||||
logger.info("Cache setting: {}", this.configuration.getCrawlCachePath());
|
logger.info("Cache setting: {}", this.configuration.getCrawlCachePath());
|
||||||
logger.info("Htmlize input setting: {}", this.configuration.getHtmlizeInputURL());
|
logger.info("Htmlize input setting: {}", this.configuration.getHtmlizeInputURL());
|
||||||
logger.info("Htmlize directory setting: {}", this.configuration.getHtmlizeDirectoryPath());
|
|
||||||
|
|
||||||
this.cache = new CrawlCache(this.configuration.getCrawlCacheDirectory());
|
this.cache = new CrawlCache(this.configuration.getCrawlCacheDirectory());
|
||||||
|
|
||||||
File htmlizeDirectory = this.configuration.getHtmlizeDirectory();
|
|
||||||
if (htmlizeDirectory == null)
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Htmlize directory undefined.");
|
|
||||||
}
|
|
||||||
else if (!htmlizeDirectory.exists())
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Htmlize directory is missing.");
|
|
||||||
}
|
|
||||||
else if (!htmlizeDirectory.isDirectory())
|
|
||||||
{
|
|
||||||
throw new IllegalArgumentException("Htmlize directory is not a directory.");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (this.configuration.isFederation())
|
if (this.configuration.isFederation())
|
||||||
{
|
{
|
||||||
this.federation = Factory.loadFederation(this.configuration.getHtmlizeInputURL(), this.cache);
|
this.federation = Factory.loadFederation(this.configuration.getHtmlizeInputURL(), this.cache);
|
||||||
|
@ -98,7 +82,6 @@ public class HtmlizerContext
|
||||||
throw new IllegalArgumentException("Not a federation configuration.");
|
throw new IllegalArgumentException("Not a federation configuration.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the cache.
|
* Gets the cache.
|
||||||
|
@ -161,20 +144,10 @@ public class HtmlizerContext
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Htmlize directory.
|
* Gets the uptime journal.
|
||||||
*
|
*
|
||||||
* @return the file
|
* @return the uptime journal
|
||||||
*/
|
*/
|
||||||
public File getHtmlizeDirectory()
|
|
||||||
{
|
|
||||||
File result;
|
|
||||||
|
|
||||||
result = this.configuration.getHtmlizeDirectory();
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
public UptimeJournal getUptimeJournal()
|
public UptimeJournal getUptimeJournal()
|
||||||
{
|
{
|
||||||
return this.uptimeJournal;
|
return this.uptimeJournal;
|
||||||
|
|
|
@ -317,44 +317,6 @@ public class Configuration extends PathPropertyList
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the htmlize directory.
|
|
||||||
*
|
|
||||||
* @return the htmlize directory
|
|
||||||
*/
|
|
||||||
public File getHtmlizeDirectory()
|
|
||||||
{
|
|
||||||
File result;
|
|
||||||
|
|
||||||
String path = getHtmlizeDirectoryPath();
|
|
||||||
if (StringUtils.isBlank(path))
|
|
||||||
{
|
|
||||||
result = null;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = new File(path);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the htmlize directory path.
|
|
||||||
*
|
|
||||||
* @return the htmlize directory path
|
|
||||||
*/
|
|
||||||
public String getHtmlizeDirectoryPath()
|
|
||||||
{
|
|
||||||
String result;
|
|
||||||
|
|
||||||
result = get("conf.htmlize.directory");
|
|
||||||
|
|
||||||
//
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the htmlize input URL.
|
* Gets the htmlize input URL.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue