Skip to content

Commit

Permalink
GRAD2-1806
Browse files Browse the repository at this point in the history
New Report for SSW: Projected Grad
  • Loading branch information
arybakov-cgi committed Oct 3, 2024
1 parent 6627155 commit 07d2834
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,18 @@ Certificate getCertificate(ReportData reportData) {

InputStream openImageResource(final String resource) throws IOException {
/** final URL url = getReportResource(resource); **/
validateResourcePath(resource);
URL url = this.getClass().getResource(String.format(DIR_IMAGE_BASE, resource));
assert url != null;
return url.openStream();
}

void validateResourcePath(String resource) {
if(StringUtils.isBlank(resource) || resource.contains("..") || resource.contains("/") || resource.contains("\\")) {
throw new IllegalArgumentException("Invalid resource path");
}
}

GraduationReport getGraduationReport(String methodName, List<String> excludePrograms) throws IOException {
Parameters<String, Object> parameters = createParameters();

Expand Down

0 comments on commit 07d2834

Please sign in to comment.