| | |
| | |
|
| | | import javax.servlet.http.HttpServletRequest;
|
| | |
|
| | | import org.apache.wicket.protocol.http.IWebApplicationFactory;
|
| | | import org.apache.wicket.protocol.http.WebApplication;
|
| | | import org.apache.wicket.protocol.http.WicketFilter;
|
| | | import org.apache.wicket.util.string.Strings;
|
| | | import org.eclipse.jgit.lib.Repository;
|
| | |
| | | */
|
| | | public class GitblitWicketFilter extends WicketFilter {
|
| | |
|
| | | public GitblitWicketFilter() {
|
| | | }
|
| | |
|
| | | @Override
|
| | | protected IWebApplicationFactory getApplicationFactory() {
|
| | | return new IWebApplicationFactory() {
|
| | | @Override
|
| | | public WebApplication createApplication(WicketFilter filter) {
|
| | | return new GitBlitWebApp();
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | /**
|
| | | * Determines the last-modified date of the requested resource.
|
| | | *
|
| | |
| | | @Override
|
| | | protected long getLastModified(final HttpServletRequest servletRequest) {
|
| | | final String pathInfo = getRelativePath(servletRequest);
|
| | | if (Strings.isEmpty(pathInfo))
|
| | | if (Strings.isEmpty(pathInfo)) {
|
| | | return -1;
|
| | | }
|
| | | long lastModified = super.getLastModified(servletRequest);
|
| | | if (lastModified > -1) {
|
| | | return lastModified;
|