Added a first version of HtmlCache class.
This commit is contained in:
parent
f90a88521f
commit
33252b83ab
1 changed files with 70 additions and 0 deletions
70
src/fr/devinsy/kiss4web/HtmlCache.java
Normal file
70
src/fr/devinsy/kiss4web/HtmlCache.java
Normal file
|
@ -0,0 +1,70 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2024 Christian Pierre MOMON <christian@momon.org>
|
||||||
|
*
|
||||||
|
* This file is part of Kiss4web.
|
||||||
|
*
|
||||||
|
* Kiss4web is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* Kiss4web 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
*/
|
||||||
|
package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Class HtmlCache.
|
||||||
|
*/
|
||||||
|
public class HtmlCache extends HashMap<String, String>
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = -310354977854681838L;
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(HtmlCache.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new html cache.
|
||||||
|
*/
|
||||||
|
public HtmlCache()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the.
|
||||||
|
*
|
||||||
|
* @param get
|
||||||
|
* the get
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
|
public String get(final String key)
|
||||||
|
{
|
||||||
|
String result;
|
||||||
|
|
||||||
|
if (key == null)
|
||||||
|
{
|
||||||
|
result = null;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result = super.get(key);
|
||||||
|
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
logger.info("HTML Cache matched: [{}]", key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue