aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.http.server/src
diff options
context:
space:
mode:
Diffstat (limited to 'org.eclipse.jgit.http.server/src')
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java2
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java10
-rw-r--r--org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java13
3 files changed, 9 insertions, 16 deletions
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
index 2ebe1b7d2f..51de8abd0e 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/GitFilter.java
@@ -202,7 +202,7 @@ public class GitFilter extends MetaFilter {
if (resolver == null) {
File root = getFile(filterConfig, "base-path");
boolean exportAll = getBoolean(filterConfig, "export-all");
- setRepositoryResolver(new FileResolver<HttpServletRequest>(root, exportAll));
+ setRepositoryResolver(new FileResolver<>(root, exportAll));
}
initialized = true;
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
index b6d73b5591..256279bfed 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/ServletUtils.java
@@ -64,7 +64,6 @@ import javax.servlet.ServletRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.eclipse.jgit.internal.storage.dfs.DfsRepository;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.Repository;
@@ -276,12 +275,11 @@ public final class ServletUtils {
}
static String identify(Repository git) {
- if (git instanceof DfsRepository) {
- return ((DfsRepository) git).getDescription().getRepositoryName();
- } else if (git.getDirectory() != null) {
- return git.getDirectory().getPath();
+ String identifier = git.getIdentifier();
+ if (identifier == null) {
+ return "unknown";
}
- return "unknown";
+ return identifier;
}
private ServletUtils() {
diff --git a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java
index d8fa712ebf..14b6506ad3 100644
--- a/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java
+++ b/org.eclipse.jgit.http.server/src/org/eclipse/jgit/http/server/glue/MetaServlet.java
@@ -47,7 +47,6 @@ import static javax.servlet.http.HttpServletResponse.SC_NOT_FOUND;
import java.io.IOException;
-import javax.servlet.FilterChain;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -140,14 +139,10 @@ public class MetaServlet extends HttpServlet {
@Override
protected void service(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
- filter.doFilter(req, res, new FilterChain() {
- @Override
- public void doFilter(ServletRequest request,
- ServletResponse response) throws IOException,
- ServletException {
- ((HttpServletResponse) response).sendError(SC_NOT_FOUND);
- }
- });
+ filter.doFilter(req, res,
+ (ServletRequest request, ServletResponse response) -> {
+ ((HttpServletResponse) response).sendError(SC_NOT_FOUND);
+ });
}
/**