|
|
@ -70,7 +70,6 @@ import org.apache.commons.fileupload.disk.DiskFileItemFactory;
|
|
|
|
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
|
|
|
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
|
|
|
|
|
|
|
|
|
|
|
import org.eclipse.jetty.http.HttpContent;
|
|
|
|
import org.eclipse.jetty.http.HttpContent;
|
|
|
|
import org.eclipse.jetty.http.HttpFields;
|
|
|
|
|
|
|
|
import org.eclipse.jetty.http.MimeTypes;
|
|
|
|
import org.eclipse.jetty.http.MimeTypes;
|
|
|
|
import org.eclipse.jetty.util.URIUtil;
|
|
|
|
import org.eclipse.jetty.util.URIUtil;
|
|
|
|
import org.eclipse.jetty.util.resource.Resource;
|
|
|
|
import org.eclipse.jetty.util.resource.Resource;
|
|
|
@ -98,10 +97,6 @@ import org.eclipse.jetty.util.resource.Resource;
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* welcomeFile name of the welcome file (default is "index.html", "welcome.html")
|
|
|
|
* welcomeFile name of the welcome file (default is "index.html", "welcome.html")
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* gzip If set to true, then static content will be served as
|
|
|
|
|
|
|
|
* gzip content encoded if a matching resource is
|
|
|
|
|
|
|
|
* found ending with ".gz"
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* resourceBase Set to replace the context resource base
|
|
|
|
* resourceBase Set to replace the context resource base
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* resourceCache If set, this is a context attribute name, which the servlet
|
|
|
|
* resourceCache If set, this is a context attribute name, which the servlet
|
|
|
@ -127,7 +122,6 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
|
|
|
|
protected boolean _dirAllowed = true;
|
|
|
|
protected boolean _dirAllowed = true;
|
|
|
|
protected boolean _pathInfoOnly = false;
|
|
|
|
protected boolean _pathInfoOnly = false;
|
|
|
|
protected boolean _etags = false;
|
|
|
|
protected boolean _etags = false;
|
|
|
|
// protected boolean _gzip = true;
|
|
|
|
|
|
|
|
protected Resource _resourceBase;
|
|
|
|
protected Resource _resourceBase;
|
|
|
|
protected MimeTypes _mimeTypes;
|
|
|
|
protected MimeTypes _mimeTypes;
|
|
|
|
protected String[] _welcomes;
|
|
|
|
protected String[] _welcomes;
|
|
|
@ -176,7 +170,6 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
_etags = getInitBoolean("etags", _etags);
|
|
|
|
_etags = getInitBoolean("etags", _etags);
|
|
|
|
// _gzip=getInitBoolean("gzip",_gzip);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ConcurrentLog.isFine("FILEHANDLER")) {
|
|
|
|
if (ConcurrentLog.isFine("FILEHANDLER")) {
|
|
|
|
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: resource base = " + _resourceBase);
|
|
|
|
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: resource base = " + _resourceBase);
|
|
|
@ -301,8 +294,7 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
|
|
|
|
|
|
|
|
|
|
|
|
String dir = resource.getListHTML(base, pathInContext.length() > 1);
|
|
|
|
String dir = resource.getListHTML(base, pathInContext.length() > 1);
|
|
|
|
if (dir == null) {
|
|
|
|
if (dir == null) {
|
|
|
|
response.sendError(HttpServletResponse.SC_FORBIDDEN,
|
|
|
|
response.sendError(HttpServletResponse.SC_FORBIDDEN, "No directory");
|
|
|
|
"No directory");
|
|
|
|
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -347,13 +339,6 @@ public abstract class YaCyDefaultServlet extends HttpServlet {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
|
|
|
|
protected void writeOptionHeaders(HttpFields fields) {
|
|
|
|
|
|
|
|
if (_acceptRanges) {
|
|
|
|
|
|
|
|
fields.put(HeaderFramework.ACCEPT_RANGES, "bytes");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
/* ------------------------------------------------------------ */
|
|
|
|
protected void writeOptionHeaders(HttpServletResponse response) {
|
|
|
|
protected void writeOptionHeaders(HttpServletResponse response) {
|
|
|
|
if (_acceptRanges) {
|
|
|
|
if (_acceptRanges) {
|
|
|
|