handler = genericFileSerializer;
return handler.handleRequest(request, response, file);
}
public boolean handleRequest(HttpServletRequest request, HttpServletResponse response, IFileStore file) throws ServletException {
IFileInfo fileInfo;
try {
fileInfo = file.fetchInfo(EFS.NONE, null);
} catch (CoreException e) {
if (handleAuthFailure(request, response, e))
return true;
//assume file does not exist
fileInfo = new FileInfo(file.getName());
((FileInfo) fileInfo).setExists(false);
}
if (!request.getMethod().equals("PUT") && !fileInfo.exists()) //$NON-NLS-1$
return statusHandler.handleRequest(request, response, new ServerStatus(IStatus.ERROR, 404, NLS.bind("File not found: {0}", EncodingUtils.encodeForHTML(request.getPathInfo())), null));
if (fileInfo.isDirectory())
return handleDirectory(request, response, file);
return handleFile(request, response, file);
}