VIVO-82 FileServingServlet must use an existing WADF.
Request-specific WebappDaoFactory objects are not initialized on image requests.
This commit is contained in:
parent
69ab12c4bc
commit
57c962e82a
1 changed files with 4 additions and 4 deletions
|
@ -87,19 +87,19 @@ public class FileServingServlet extends VitroHttpServlet {
|
||||||
InputStream in;
|
InputStream in;
|
||||||
String mimeType = null;
|
String mimeType = null;
|
||||||
try {
|
try {
|
||||||
FileInfo fileInfo = figureFileInfo(
|
FileInfo fileInfo = figureFileInfo(request.getWebappDaoFactory(),
|
||||||
request.getFullWebappDaoFactory(), path);
|
path);
|
||||||
mimeType = fileInfo.getMimeType();
|
mimeType = fileInfo.getMimeType();
|
||||||
|
|
||||||
String actualFilename = findAndValidateFilename(fileInfo, path);
|
String actualFilename = findAndValidateFilename(fileInfo, path);
|
||||||
|
|
||||||
in = openImageInputStream(fileInfo, actualFilename);
|
in = openImageInputStream(fileInfo, actualFilename);
|
||||||
} catch (FileServingException e) {
|
} catch (FileServingException e) {
|
||||||
log.info("Failed to serve the file at '" + path + "' -- " + e.getMessage());
|
log.info("Failed to serve the file at '" + path + "' -- " + e);
|
||||||
in = openMissingLinkImage(request);
|
in = openMissingLinkImage(request);
|
||||||
mimeType = "image/png";
|
mimeType = "image/png";
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.warn("Failed to serve the file at '" + path + "' -- " + e.getMessage());
|
log.warn("Failed to serve the file at '" + path + "' -- " + e);
|
||||||
in = openMissingLinkImage(request);
|
in = openMissingLinkImage(request);
|
||||||
mimeType = "image/png";
|
mimeType = "image/png";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue