|
|
|
@ -1,19 +1,25 @@
|
|
|
|
|
// Jetty8YaCyDefaultServlet
|
|
|
|
|
// ------------------------
|
|
|
|
|
// Copyright 2013 by Michael Peter Christen; mc@yacy.net, Frankfurt a. M., Germany
|
|
|
|
|
// First released 2013 at http://yacy.net
|
|
|
|
|
//
|
|
|
|
|
// $LastChangedDate$
|
|
|
|
|
// $LastChangedRevision$
|
|
|
|
|
// $LastChangedBy$
|
|
|
|
|
//
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
|
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
|
// All rights reserved. This program and the accompanying materials
|
|
|
|
|
// are made available under the terms of the Eclipse Public License v1.0
|
|
|
|
|
// and Apache License v2.0 which accompanies this distribution.
|
|
|
|
|
//
|
|
|
|
|
// The Eclipse Public License is available at
|
|
|
|
|
// http://www.eclipse.org/legal/epl-v10.html
|
|
|
|
|
//
|
|
|
|
|
// The Apache License v2.0 is available at
|
|
|
|
|
// http://www.opensource.org/licenses/apache2.0.php
|
|
|
|
|
//
|
|
|
|
|
// You may elect to redistribute this code under either of these licenses.
|
|
|
|
|
// ========================================================================
|
|
|
|
|
// This library 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 2.1 of the License, or (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This library 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 this program in the file lgpl21.txt
|
|
|
|
|
// If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
package net.yacy.http;
|
|
|
|
|
|
|
|
|
@ -172,8 +178,8 @@ public class Jetty8YaCyDefaultServlet extends YaCyDefaultServlet implements Reso
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ConcurrentLog.isFine("YaCyDefaultServlet")) {
|
|
|
|
|
ConcurrentLog.fine("YaCyDefaultServlet","uri=" + request.getRequestURI() + " resource=" + resource + (content != null ? " content" : ""));
|
|
|
|
|
if (ConcurrentLog.isFine("FILEHANDLER")) {
|
|
|
|
|
ConcurrentLog.fine("FILEHANDLER","YaCyDefaultServlet: uri=" + request.getRequestURI() + " resource=" + resource + (content != null ? " content" : ""));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Handle resource
|
|
|
|
@ -233,7 +239,7 @@ public class Jetty8YaCyDefaultServlet extends YaCyDefaultServlet implements Reso
|
|
|
|
|
}
|
|
|
|
|
} // else look for a welcome file
|
|
|
|
|
else if (null != (welcome = getWelcomeFile(pathInContext))) {
|
|
|
|
|
ConcurrentLog.fine("welcome={}", welcome);
|
|
|
|
|
ConcurrentLog.fine("FILEHANDLER","welcome={}" + welcome);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Forward to the index
|
|
|
|
@ -494,7 +500,7 @@ public class Jetty8YaCyDefaultServlet extends YaCyDefaultServlet implements Reso
|
|
|
|
|
writeHeaders(response, content, -1);
|
|
|
|
|
String mimetype = (content.getContentType() == null ? null : content.getContentType().toString());
|
|
|
|
|
if (mimetype == null) {
|
|
|
|
|
ConcurrentLog.warn("YaCyDefaultServlet", "Unknown mimetype for " + request.getRequestURI());
|
|
|
|
|
ConcurrentLog.warn("FILEHANDLER","YaCyDefaultServlet: Unknown mimetype for " + request.getRequestURI());
|
|
|
|
|
}
|
|
|
|
|
MultiPartOutputStream multi = new MultiPartOutputStream(out);
|
|
|
|
|
response.setStatus(HttpServletResponse.SC_PARTIAL_CONTENT);
|
|
|
|
|