use of org.eclipse.jetty.http.pathmap.MappedResource in project jetty.project by eclipse.
the class DefaultServlet method getWelcomeFile.
/* ------------------------------------------------------------ */
@Override
public String getWelcomeFile(String pathInContext) {
if (_welcomes == null)
return null;
String welcome_servlet = null;
for (int i = 0; i < _welcomes.length; i++) {
String welcome_in_context = URIUtil.addPaths(pathInContext, _welcomes[i]);
Resource welcome = getResource(welcome_in_context);
if (welcome != null && welcome.exists())
return _welcomes[i];
if ((_welcomeServlets || _welcomeExactServlets) && welcome_servlet == null) {
MappedResource<ServletHolder> entry = _servletHandler.getHolderEntry(welcome_in_context);
if (entry != null && entry.getResource() != _defaultHolder && (_welcomeServlets || (_welcomeExactServlets && entry.getPathSpec().getDeclaration().equals(welcome_in_context))))
welcome_servlet = welcome_in_context;
}
}
return welcome_servlet;
}
use of org.eclipse.jetty.http.pathmap.MappedResource in project jetty.project by eclipse.
the class NativeWebSocketConfiguration method removeMapping.
@Override
public boolean removeMapping(String rawspec) {
PathSpec pathSpec = toPathSpec(rawspec);
boolean removed = false;
for (Iterator<MappedResource<WebSocketCreator>> iterator = mappings.iterator(); iterator.hasNext(); ) {
MappedResource<WebSocketCreator> mapping = iterator.next();
if (mapping.getPathSpec().equals(pathSpec)) {
iterator.remove();
removed = true;
}
}
return removed;
}
Aggregations