Javadoc review.
This commit is contained in:
parent
590c99c19b
commit
02a8c54cb6
19 changed files with 303 additions and 142 deletions
4
.settings/net.sf.jautodoc.prefs
Normal file
4
.settings/net.sf.jautodoc.prefs
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
filter_fields=false
|
||||||
|
project_specific_settings=true
|
||||||
|
replacements=<?xml version\="1.0" standalone\="yes"?>\n\n<replacements>\n<replacement key\="get" scope\="1" mode\="0">Gets the</replacement>\n<replacement key\="set" scope\="1" mode\="0">Sets the</replacement>\n<replacement key\="add" scope\="1" mode\="0">Adds the</replacement>\n<replacement key\="edit" scope\="1" mode\="0">Edits the</replacement>\n<replacement key\="remove" scope\="1" mode\="0">Removes the</replacement>\n<replacement key\="init" scope\="1" mode\="0">Inits the</replacement>\n<replacement key\="parse" scope\="1" mode\="0">Parses the</replacement>\n<replacement key\="create" scope\="1" mode\="0">Creates the</replacement>\n<replacement key\="build" scope\="1" mode\="0">Builds the</replacement>\n<replacement key\="is" scope\="1" mode\="0">Checks if is</replacement>\n<replacement key\="print" scope\="1" mode\="0">Prints the</replacement>\n<replacement key\="has" scope\="1" mode\="0">Checks for</replacement>\n</replacements>\n\n
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2013-2021 Christian Pierre MOMON
|
* Copyright (C) 2013-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -74,43 +74,80 @@ public class BuildInformation
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Author.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String author()
|
public String author()
|
||||||
{
|
{
|
||||||
return this.author;
|
return this.author;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the date.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String buildDate()
|
public String buildDate()
|
||||||
{
|
{
|
||||||
return this.buildDate;
|
return this.buildDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Builds the number.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String buildNumber()
|
public String buildNumber()
|
||||||
{
|
{
|
||||||
return this.buildNumber;
|
return this.buildNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Generator.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String generator()
|
public String generator()
|
||||||
{
|
{
|
||||||
return this.generator;
|
return this.generator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Major revision.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String majorRevision()
|
public String majorRevision()
|
||||||
{
|
{
|
||||||
return this.majorRevision;
|
return this.majorRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Minor revision.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String minorRevision()
|
public String minorRevision()
|
||||||
{
|
{
|
||||||
return this.minorRevision;
|
return this.minorRevision;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Product name.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String productName()
|
public String productName()
|
||||||
{
|
{
|
||||||
return this.productName;
|
return this.productName;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* To string.
|
||||||
|
*
|
||||||
|
* @return the string
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
|
@ -125,8 +162,9 @@ public class BuildInformation
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Version.
|
||||||
* @return
|
*
|
||||||
|
* @return the string
|
||||||
*/
|
*/
|
||||||
public String version()
|
public String version()
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,8 +43,6 @@ import fr.devinsy.kiss4web.dispatcher.hooks.XHTMLHook;
|
||||||
*/
|
*/
|
||||||
public class Kiss4web
|
public class Kiss4web
|
||||||
{
|
{
|
||||||
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Kiss4web.class);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Enum Mode.
|
* The Enum Mode.
|
||||||
*/
|
*/
|
||||||
|
@ -65,6 +63,8 @@ public class Kiss4web
|
||||||
private static final Kiss4web instance = new Kiss4web();
|
private static final Kiss4web instance = new Kiss4web();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(Kiss4web.class);
|
||||||
|
|
||||||
private BuildInformation buildInformation;
|
private BuildInformation buildInformation;
|
||||||
private Mode mode;
|
private Mode mode;
|
||||||
|
|
||||||
|
@ -231,7 +231,7 @@ public class Kiss4web
|
||||||
/**
|
/**
|
||||||
* Sets the mode custom.
|
* Sets the mode custom.
|
||||||
*
|
*
|
||||||
* @param register
|
* @param hooks
|
||||||
* the new mode custom
|
* the new mode custom
|
||||||
*/
|
*/
|
||||||
public void setModeCustom(final HookRegister hooks)
|
public void setModeCustom(final HookRegister hooks)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (C) 2021 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
* Copyright (C) 2021-2023 Christian Pierre MOMON <christian.momon@devinsy.fr>
|
||||||
*
|
*
|
||||||
* This file is part of Juga, simple key value database.
|
* This file is part of Juga, simple key value database.
|
||||||
*
|
*
|
||||||
|
@ -37,6 +37,9 @@ public class Kiss4webLauncher implements javax.servlet.ServletContextListener
|
||||||
{
|
{
|
||||||
private static Logger logger = LoggerFactory.getLogger(Kiss4webLauncher.class);
|
private static Logger logger = LoggerFactory.getLogger(Kiss4webLauncher.class);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void contextDestroyed(final ServletContextEvent sce)
|
public void contextDestroyed(final ServletContextEvent sce)
|
||||||
{
|
{
|
||||||
|
@ -53,6 +56,9 @@ public class Kiss4webLauncher implements javax.servlet.ServletContextListener
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inits the logger.
|
* Inits the logger.
|
||||||
|
*
|
||||||
|
* @param webappRoot
|
||||||
|
* the webapp root
|
||||||
*/
|
*/
|
||||||
public void initLogger(final String webappRoot)
|
public void initLogger(final String webappRoot)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,35 +1,20 @@
|
||||||
/**
|
/**
|
||||||
* Copyright 2021 Christian Pierre MOMON, DEVINSY, UMR 7186 LESC.
|
* Copyright (C) 2021-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* christian.momon@devinsy.fr
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
* This file is part of Kiwa. This software (Kiwa) is a computer program whose
|
* Kiss4web is free software: you can redistribute it and/or modify
|
||||||
* purpose is to be the Kinsources Web Application, an open interactive platform
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
* for archiving, sharing, analyzing and comparing kinship data used in
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
* scientific inquiry.
|
* (at your option) any later version.
|
||||||
*
|
*
|
||||||
* This software is governed by the CeCILL license under French law and abiding
|
* Kiss4web is distributed in the hope that it will be useful,
|
||||||
* by the rules of distribution of free software. You can use, modify and/ or
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
* redistribute the software under the terms of the CeCILL license as circulated
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
* by CEA, CNRS and INRIA at the following URL "http://www.cecill.info".
|
* GNU Lesser General Public License for more details.
|
||||||
*
|
*
|
||||||
* As a counterpart to the access to the source code and rights to copy, modify
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
* and redistribute granted by the license, users are provided only with a
|
* along with Kiss4web. If not, see <http://www.gnu.org/licenses/>
|
||||||
* limited warranty and the software's author, the holder of the economic
|
|
||||||
* rights, and the successive licensors have only limited liability.
|
|
||||||
*
|
|
||||||
* In this respect, the user's attention is drawn to the risks associated with
|
|
||||||
* loading, using, modifying and/or developing or reproducing the software by
|
|
||||||
* the user in light of its specific status of free software, that may mean that
|
|
||||||
* it is complicated to manipulate, and that also therefore means that it is
|
|
||||||
* reserved for developers and experienced professionals having in-depth
|
|
||||||
* computer knowledge. Users are therefore encouraged to load and test the
|
|
||||||
* software's suitability as regards their requirements in conditions enabling
|
|
||||||
* the security of their systems and/or data to be ensured and, more generally,
|
|
||||||
* to use and operate it in the same conditions as regards security.
|
|
||||||
*
|
|
||||||
* The fact that you are presently reading this means that you have had
|
|
||||||
* knowledge of the CeCILL license and that you accept its terms.
|
|
||||||
*/
|
*/
|
||||||
package fr.devinsy.kiss4web;
|
package fr.devinsy.kiss4web;
|
||||||
|
|
||||||
|
@ -50,22 +35,46 @@ public abstract class Page
|
||||||
private HttpServletRequest request;
|
private HttpServletRequest request;
|
||||||
private HttpServletResponse response;
|
private HttpServletResponse response;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instantiates a new page.
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* the request
|
||||||
|
* @param response
|
||||||
|
* the response
|
||||||
|
* @throws ServletException
|
||||||
|
* the servlet exception
|
||||||
|
* @throws IOException
|
||||||
|
* Signals that an I/O exception has occurred.
|
||||||
|
*/
|
||||||
public Page(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
|
public Page(final HttpServletRequest request, final HttpServletResponse response) throws ServletException, IOException
|
||||||
{
|
{
|
||||||
this.request = request;
|
this.request = request;
|
||||||
this.response = response;
|
this.response = response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do get.
|
||||||
|
*/
|
||||||
public void doGet()
|
public void doGet()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Do post.
|
||||||
|
*/
|
||||||
public void doPost()
|
public void doPost()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Redirect.
|
||||||
|
*
|
||||||
|
* @param urlPath
|
||||||
|
* the url path
|
||||||
|
*/
|
||||||
public void redirect(final String urlPath)
|
public void redirect(final String urlPath)
|
||||||
{
|
{
|
||||||
Redirector.redirect(this.response, urlPath);
|
Redirector.redirect(this.response, urlPath);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -28,8 +28,6 @@ import org.slf4j.LoggerFactory;
|
||||||
*/
|
*/
|
||||||
public class Redirector
|
public class Redirector
|
||||||
{
|
{
|
||||||
private static final Logger logger = LoggerFactory.getLogger(Redirector.class);
|
|
||||||
|
|
||||||
public enum Type
|
public enum Type
|
||||||
{
|
{
|
||||||
MOVED_PERMANENTLY(HttpServletResponse.SC_MOVED_PERMANENTLY),
|
MOVED_PERMANENTLY(HttpServletResponse.SC_MOVED_PERMANENTLY),
|
||||||
|
@ -42,6 +40,11 @@ public class Redirector
|
||||||
this.statusCode = value;
|
this.statusCode = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Status code.
|
||||||
|
*
|
||||||
|
* @return the int
|
||||||
|
*/
|
||||||
public int statusCode()
|
public int statusCode()
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
@ -53,6 +56,8 @@ public class Redirector
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(Redirector.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redirect.
|
* Redirect.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -67,7 +67,15 @@ public class KissDispatcher extends HttpServlet
|
||||||
* "/good/morning-/12/toto.jpg" => "good.Morning" ('12' and 'toto.jpg" are detected as a parameter, they
|
* "/good/morning-/12/toto.jpg" => "good.Morning" ('12' and 'toto.jpg" are detected as a parameter, they
|
||||||
* will be decoded in the class called later).
|
* will be decoded in the class called later).
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
* @param request
|
||||||
|
* the request
|
||||||
|
* @param response
|
||||||
|
* the response
|
||||||
|
* @throws IOException
|
||||||
|
* Signals that an I/O exception has occurred.
|
||||||
|
* @throws ServletException
|
||||||
|
* the servlet exception
|
||||||
*/
|
*/
|
||||||
public void dispatch(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
public void dispatch(final HttpServletRequest request, final HttpServletResponse response) throws IOException, ServletException
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -36,13 +36,13 @@ import org.slf4j.LoggerFactory;
|
||||||
*/
|
*/
|
||||||
public class KissDispatcherFactory
|
public class KissDispatcherFactory
|
||||||
{
|
{
|
||||||
private static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
|
|
||||||
|
|
||||||
private static class SingletonHolder
|
private static class SingletonHolder
|
||||||
{
|
{
|
||||||
private static final KissDispatcherFactory instance = new KissDispatcherFactory();
|
private static final KissDispatcherFactory instance = new KissDispatcherFactory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(KissDispatcherFactory.class);
|
||||||
|
|
||||||
private KissDispatcherCache cache;
|
private KissDispatcherCache cache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,6 +53,9 @@ public class KissDispatcherFactory
|
||||||
this.cache = new KissDispatcherCache();
|
this.cache = new KissDispatcherCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear cache.
|
||||||
|
*/
|
||||||
public void clearCache()
|
public void clearCache()
|
||||||
{
|
{
|
||||||
this.cache.clear();
|
this.cache.clear();
|
||||||
|
@ -147,21 +150,11 @@ public class KissDispatcherFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if is availableget path.
|
* Checks if is available path.
|
||||||
*
|
*
|
||||||
* @param servletConfig
|
|
||||||
* the servlet config
|
|
||||||
* @param request
|
|
||||||
* the request
|
|
||||||
* @param response
|
|
||||||
* the response
|
|
||||||
* @param urlPath
|
* @param urlPath
|
||||||
* the url path
|
* the url path
|
||||||
* @return true, if is availableget path
|
* @return true, if is available path
|
||||||
* @throws IOException
|
|
||||||
* Signals that an I/O exception has occurred.
|
|
||||||
* @throws ServletException
|
|
||||||
* the servlet exception
|
|
||||||
*/
|
*/
|
||||||
public boolean isAvailablePath(final String urlPath)
|
public boolean isAvailablePath(final String urlPath)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,14 +44,14 @@ import fr.devinsy.strings.StringList;
|
||||||
*/
|
*/
|
||||||
public class KissDispatcherUtils
|
public class KissDispatcherUtils
|
||||||
{
|
{
|
||||||
private static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
|
|
||||||
|
|
||||||
public enum ContentDispositionType
|
public enum ContentDispositionType
|
||||||
{
|
{
|
||||||
ATTACHMENT,
|
ATTACHMENT,
|
||||||
INLINE
|
INLINE
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(KissDispatcherUtils.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds the class name.
|
* Builds the class name.
|
||||||
*
|
*
|
||||||
|
@ -204,9 +204,9 @@ public class KissDispatcherUtils
|
||||||
/**
|
/**
|
||||||
* Instanciate servlet.
|
* Instanciate servlet.
|
||||||
*
|
*
|
||||||
* @param className
|
* @param classPathname
|
||||||
* the class name
|
* the class pathname
|
||||||
* @return the http servlet or null if no one found.
|
* @return the http servlet
|
||||||
*/
|
*/
|
||||||
public static HttpServlet instanciateServlet(final String classPathname)
|
public static HttpServlet instanciateServlet(final String classPathname)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2021 Christian Pierre MOMON
|
* Copyright (C) 2021-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -76,8 +76,8 @@ public class WebsiteClasspaths extends StringList
|
||||||
/**
|
/**
|
||||||
* Instanciate servlet.
|
* Instanciate servlet.
|
||||||
*
|
*
|
||||||
* @param subClasspath
|
* @param className
|
||||||
* the sub classpath
|
* the class name
|
||||||
* @return the http servlet
|
* @return the http servlet
|
||||||
*/
|
*/
|
||||||
public HttpServlet instanciateServlet(final String className)
|
public HttpServlet instanciateServlet(final String className)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -33,6 +33,9 @@ public class HookRegister
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new hook register.
|
* Instantiates a new hook register.
|
||||||
|
*
|
||||||
|
* @param name
|
||||||
|
* the name
|
||||||
*/
|
*/
|
||||||
public HookRegister(final String name)
|
public HookRegister(final String name)
|
||||||
{
|
{
|
||||||
|
@ -91,6 +94,11 @@ public class HookRegister
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the name.
|
||||||
|
*
|
||||||
|
* @return the name
|
||||||
|
*/
|
||||||
public String getName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return this.name;
|
return this.name;
|
||||||
|
@ -116,6 +124,7 @@ public class HookRegister
|
||||||
*
|
*
|
||||||
* @param hook
|
* @param hook
|
||||||
* the hook
|
* the hook
|
||||||
|
* @return the hook register
|
||||||
*/
|
*/
|
||||||
public HookRegister register(final Hook hook)
|
public HookRegister register(final Hook hook)
|
||||||
{
|
{
|
||||||
|
@ -129,6 +138,12 @@ public class HookRegister
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register all.
|
||||||
|
*
|
||||||
|
* @param register
|
||||||
|
* the register
|
||||||
|
*/
|
||||||
public void registerAll(final HookRegister register)
|
public void registerAll(final HookRegister register)
|
||||||
{
|
{
|
||||||
this.hooks.addAll(register.getHooks());
|
this.hooks.addAll(register.getHooks());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2021 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -74,7 +74,12 @@ public class LongURLRewriter
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* Note: "-/" is used to indicate the beginning of parameters.
|
* Note: "-/" is used to indicate the beginning of parameters.
|
||||||
*
|
*
|
||||||
|
* @param path
|
||||||
|
* the path
|
||||||
|
* @param parameters
|
||||||
|
* the parameters
|
||||||
|
* @return the string
|
||||||
*/
|
*/
|
||||||
public static String rewrite(final String path, final String... parameters)
|
public static String rewrite(final String path, final String... parameters)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,7 @@ package fr.devinsy.kiss4web.security;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class Group.
|
||||||
*/
|
*/
|
||||||
public class Group
|
public class Group
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,8 @@ public class Group
|
||||||
private Vector<String> members;
|
private Vector<String> members;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new group.
|
||||||
*/
|
*/
|
||||||
public Group()
|
public Group()
|
||||||
{
|
{
|
||||||
this.name = null;
|
this.name = null;
|
||||||
|
@ -38,8 +38,11 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Adds the member.
|
||||||
*/
|
*
|
||||||
|
* @param login
|
||||||
|
* the login
|
||||||
|
*/
|
||||||
public void addMember(final String login)
|
public void addMember(final String login)
|
||||||
{
|
{
|
||||||
if ((login != null) && (login.length() != 0))
|
if ((login != null) && (login.length() != 0))
|
||||||
|
@ -49,8 +52,12 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Contains.
|
||||||
*/
|
*
|
||||||
|
* @param name
|
||||||
|
* the name
|
||||||
|
* @return true, if successful
|
||||||
|
*/
|
||||||
public boolean contains(final String name)
|
public boolean contains(final String name)
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
@ -62,8 +69,10 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Members.
|
||||||
*/
|
*
|
||||||
|
* @return the vector
|
||||||
|
*/
|
||||||
public Vector<String> members()
|
public Vector<String> members()
|
||||||
{
|
{
|
||||||
Vector<String> result;
|
Vector<String> result;
|
||||||
|
@ -75,8 +84,10 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Name.
|
||||||
*/
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String name()
|
public String name()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -88,8 +99,12 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the name.
|
||||||
*/
|
*
|
||||||
|
* @param name
|
||||||
|
* the name
|
||||||
|
* @return the group
|
||||||
|
*/
|
||||||
public Group setName(final String name)
|
public Group setName(final String name)
|
||||||
{
|
{
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -99,8 +114,10 @@ public class Group
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* To string.
|
||||||
*/
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -112,5 +129,3 @@ public class Group
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -23,13 +23,19 @@ import java.util.Iterator;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class GroupsFileReader.
|
||||||
*/
|
*/
|
||||||
public class GroupsFileReader
|
public class GroupsFileReader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
* Load.
|
||||||
*/
|
*
|
||||||
|
* @param fileName
|
||||||
|
* the file name
|
||||||
|
* @return the groups
|
||||||
|
* @throws Exception
|
||||||
|
* the exception
|
||||||
|
*/
|
||||||
public static Groups load(final String fileName) throws Exception
|
public static Groups load(final String fileName) throws Exception
|
||||||
{
|
{
|
||||||
Groups result;
|
Groups result;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -21,7 +21,7 @@ package fr.devinsy.kiss4web.security;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class SecurityAgent.
|
||||||
*/
|
*/
|
||||||
public class SecurityAgent
|
public class SecurityAgent
|
||||||
{
|
{
|
||||||
|
@ -30,8 +30,13 @@ public class SecurityAgent
|
||||||
private Groups permissions;
|
private Groups permissions;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new security agent.
|
||||||
*/
|
*
|
||||||
|
* @param path
|
||||||
|
* the path
|
||||||
|
* @throws Exception
|
||||||
|
* the exception
|
||||||
|
*/
|
||||||
public SecurityAgent(final String path) throws Exception
|
public SecurityAgent(final String path) throws Exception
|
||||||
{
|
{
|
||||||
this.users = UsersFileReader.load(path + "users.conf");
|
this.users = UsersFileReader.load(path + "users.conf");
|
||||||
|
@ -40,8 +45,14 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Authenticate.
|
||||||
*/
|
*
|
||||||
|
* @param login
|
||||||
|
* the login
|
||||||
|
* @param password
|
||||||
|
* the password
|
||||||
|
* @return true, if successful
|
||||||
|
*/
|
||||||
public boolean authenticate(final String login, final String password)
|
public boolean authenticate(final String login, final String password)
|
||||||
{
|
{
|
||||||
boolean result;
|
boolean result;
|
||||||
|
@ -66,8 +77,14 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Check permission.
|
||||||
*/
|
*
|
||||||
|
* @param url
|
||||||
|
* the url
|
||||||
|
* @param login
|
||||||
|
* the login
|
||||||
|
* @return true, if successful
|
||||||
|
*/
|
||||||
public boolean checkPermission(final String url, final String login)
|
public boolean checkPermission(final String url, final String login)
|
||||||
{
|
{
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
@ -124,8 +141,10 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Groups.
|
||||||
*/
|
*
|
||||||
|
* @return the groups
|
||||||
|
*/
|
||||||
public Groups groups()
|
public Groups groups()
|
||||||
{
|
{
|
||||||
Groups result;
|
Groups result;
|
||||||
|
@ -137,8 +156,10 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Permissions.
|
||||||
*/
|
*
|
||||||
|
* @return the groups
|
||||||
|
*/
|
||||||
public Groups permissions()
|
public Groups permissions()
|
||||||
{
|
{
|
||||||
Groups result;
|
Groups result;
|
||||||
|
@ -150,8 +171,10 @@ public class SecurityAgent
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Users.
|
||||||
*/
|
*
|
||||||
|
* @return the users
|
||||||
|
*/
|
||||||
public Users users()
|
public Users users()
|
||||||
{
|
{
|
||||||
Users result;
|
Users result;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -19,7 +19,7 @@
|
||||||
package fr.devinsy.kiss4web.security;
|
package fr.devinsy.kiss4web.security;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class User.
|
||||||
*/
|
*/
|
||||||
public class User
|
public class User
|
||||||
{
|
{
|
||||||
|
@ -29,8 +29,8 @@ public class User
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new user.
|
||||||
*/
|
*/
|
||||||
public User()
|
public User()
|
||||||
{
|
{
|
||||||
this.login = null;
|
this.login = null;
|
||||||
|
@ -40,8 +40,10 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Email.
|
||||||
*/
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String email()
|
public String email()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -53,8 +55,10 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Login.
|
||||||
*/
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String login()
|
public String login()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -66,8 +70,10 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Password.
|
||||||
*/
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String password()
|
public String password()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -79,8 +85,10 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Real name.
|
||||||
*/
|
*
|
||||||
|
* @return the string
|
||||||
|
*/
|
||||||
public String realName()
|
public String realName()
|
||||||
{
|
{
|
||||||
String result;
|
String result;
|
||||||
|
@ -92,8 +100,12 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the email.
|
||||||
*/
|
*
|
||||||
|
* @param email
|
||||||
|
* the email
|
||||||
|
* @return the user
|
||||||
|
*/
|
||||||
public User setEmail(final String email)
|
public User setEmail(final String email)
|
||||||
{
|
{
|
||||||
this.email = email;
|
this.email = email;
|
||||||
|
@ -103,8 +115,12 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the login.
|
||||||
*/
|
*
|
||||||
|
* @param login
|
||||||
|
* the login
|
||||||
|
* @return the user
|
||||||
|
*/
|
||||||
public User setLogin(final String login)
|
public User setLogin(final String login)
|
||||||
{
|
{
|
||||||
this.login = login;
|
this.login = login;
|
||||||
|
@ -114,8 +130,12 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the password.
|
||||||
*/
|
*
|
||||||
|
* @param password
|
||||||
|
* the password
|
||||||
|
* @return the user
|
||||||
|
*/
|
||||||
public User setPassword(final String password)
|
public User setPassword(final String password)
|
||||||
{
|
{
|
||||||
this.password = password;
|
this.password = password;
|
||||||
|
@ -125,8 +145,12 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Sets the real name.
|
||||||
*/
|
*
|
||||||
|
* @param realName
|
||||||
|
* the real name
|
||||||
|
* @return the user
|
||||||
|
*/
|
||||||
public User setRealName(final String realName)
|
public User setRealName(final String realName)
|
||||||
{
|
{
|
||||||
this.realName = realName;
|
this.realName = realName;
|
||||||
|
@ -136,8 +160,8 @@ public class User
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2010, 2013-2014 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -22,22 +22,26 @@ import java.util.Iterator;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class Users.
|
||||||
*/
|
*/
|
||||||
public class Users extends Vector<User>
|
public class Users extends Vector<User>
|
||||||
{
|
{
|
||||||
private static final long serialVersionUID = 6140538630004281217L;
|
private static final long serialVersionUID = 6140538630004281217L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Instantiates a new users.
|
||||||
*/
|
*/
|
||||||
public Users()
|
public Users()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
|
* Contains.
|
||||||
*
|
*
|
||||||
|
* @param login
|
||||||
|
* the login
|
||||||
|
* @return true, if successful
|
||||||
*/
|
*/
|
||||||
public boolean contains(final String login)
|
public boolean contains(final String login)
|
||||||
{
|
{
|
||||||
|
@ -57,8 +61,12 @@ public class Users extends Vector<User>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* Gets the by login.
|
||||||
*/
|
*
|
||||||
|
* @param login
|
||||||
|
* the login
|
||||||
|
* @return the by login
|
||||||
|
*/
|
||||||
public User getByLogin(final String login)
|
public User getByLogin(final String login)
|
||||||
{
|
{
|
||||||
User result;
|
User result;
|
||||||
|
@ -96,8 +104,8 @@ public class Users extends Vector<User>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -119,5 +127,3 @@ public class Users extends Vector<User>
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/**
|
/**
|
||||||
* Copyright (C) 2006-2010, 2013-2016 Christian Pierre MOMON
|
* Copyright (C) 2006-2023 Christian Pierre MOMON
|
||||||
*
|
*
|
||||||
* This file is part of Kiss4web.
|
* This file is part of Kiss4web.
|
||||||
*
|
*
|
||||||
|
@ -23,13 +23,19 @@ import java.util.Iterator;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* The Class UsersFileReader.
|
||||||
*/
|
*/
|
||||||
public class UsersFileReader
|
public class UsersFileReader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
*
|
* Load.
|
||||||
*/
|
*
|
||||||
|
* @param fileName
|
||||||
|
* the file name
|
||||||
|
* @return the users
|
||||||
|
* @throws Exception
|
||||||
|
* the exception
|
||||||
|
*/
|
||||||
public static Users load(final String fileName) throws Exception
|
public static Users load(final String fileName) throws Exception
|
||||||
{
|
{
|
||||||
Users result;
|
Users result;
|
||||||
|
@ -69,5 +75,3 @@ public class UsersFileReader
|
||||||
return (result);
|
return (result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
|
||||||
|
|
Loading…
Reference in a new issue