Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/main/java/org/maring/util/js/JavascriptComboService.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,17 @@ private void processRequest(HttpServletRequest request, HttpServletResponse resp

StringBuffer fileData = new StringBuffer();
FileReader fileReader = null;
try {
fileReader = new FileReader(this.getServletContext().getRealPath(fileRef));
} catch (FileNotFoundException fnfe) {
log.warn("file " + this.getServletContext().getRealPath(fileRef) + " was not found");
String realPath = this.getServletContext().getRealPath(fileRef);

if (realPath != null) {
try {
fileReader = new FileReader(this.getServletContext().getRealPath(fileRef));
} catch (FileNotFoundException fnfe) {
log.warn("file " + this.getServletContext().getRealPath(fileRef) + " was not found");
continue;
}
} else {
log.warn("file " + fileRef + " was not found");
continue;
}
BufferedReader reader = new BufferedReader(fileReader);
Expand Down