Skip to content

Commit

Permalink
remove unused init parameter from DefaultServlet
Browse files Browse the repository at this point in the history
- remove "RelativeResourceBase" parameter
  • Loading branch information
reger committed Dec 15, 2013
1 parent c84c313 commit 18497f6
Showing 1 changed file with 8 additions and 20 deletions.
28 changes: 8 additions & 20 deletions source/net/yacy/http/YaCyDefaultServlet.java
Expand Up @@ -105,11 +105,6 @@
*
* resourceBase Set to replace the context resource base
*
* relativeResourceBase
* Set with a pathname relative to the base of the
* servlet context root. Useful for only serving static content out
* of only specific subdirectories.
*
* pathInfoOnly If true, only the path info will be applied to the resourceBase
*
* </PRE>
Expand All @@ -124,7 +119,6 @@ public class YaCyDefaultServlet extends HttpServlet {
protected Resource _resourceBase;
protected MimeTypes _mimeTypes;
protected String[] _welcomes;
protected String _relativeResourceBase;

protected File _htLocalePath;
protected File _htDocsPath;
Expand Down Expand Up @@ -154,21 +148,19 @@ public void init() throws UnavailableException {
_pathInfoOnly = getInitBoolean("pathInfoOnly", _pathInfoOnly);

Resource.setDefaultUseCaches(false); // caching is handled internally (prevent double caching)
_relativeResourceBase = getInitParameter("relativeResourceBase");

String rb = getInitParameter("resourceBase");
if (rb != null) {
if (_relativeResourceBase != null) {
throw new UnavailableException("resourceBase & relativeResourceBase given, only one allowed");
}
try {
try {
if (rb != null) {
_resourceBase = Resource.newResource(rb);
} catch (IOException e) {
ConcurrentLog.logException(e);
throw new UnavailableException(e.toString());
} else {
_resourceBase = Resource.newResource(Switchboard.getSwitchboard().getConfig("htRootPath", "htroot")); //default
}
} catch (IOException e) {
ConcurrentLog.severe("FILEHANDLER", "YaCyDefaultServlet: resource base (htRootPath) missing");
ConcurrentLog.logException(e);
throw new UnavailableException(e.toString());
}

if (ConcurrentLog.isFine("FILEHANDLER")) {
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: resource base = " + _resourceBase);
}
Expand Down Expand Up @@ -200,10 +192,6 @@ protected boolean getInitBoolean(String name, boolean dft) {
*/
public Resource getResource(String pathInContext) {
Resource r = null;
if (_relativeResourceBase != null) {
pathInContext = URIUtil.addPaths(_relativeResourceBase, pathInContext);
}

try {
if (_resourceBase != null) {
r = _resourceBase.addPath(pathInContext);
Expand Down

0 comments on commit 18497f6

Please sign in to comment.