Skip to content

Commit

Permalink
Security Hostpots Reviewed and more
Browse files Browse the repository at this point in the history
  • Loading branch information
yazmin48 committed Jan 3, 2025
1 parent 99a90c3 commit 2661485
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.wicket.Page;
import org.apache.wicket.markup.html.form.SubmitLink;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.markup.html.link.DownloadLink;
Expand All @@ -28,7 +29,7 @@ public class UploadCensusFilePanel extends Panel {
private byte[] censusFile;
private String fileName;

public UploadCensusFilePanel(String id, Election election, Class responsePage) {
public <T extends Page> UploadCensusFilePanel(String id, Election election, Class<T> responsePage) {
super(id);
try {
setOutputMarkupId(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -24,7 +23,7 @@ public static Properties getEmailProperties() {
try (InputStream input = new FileInputStream(System.getProperty("jboss.server.config.dir").concat("/email.properties"))) {
props.load(input);
} catch (Exception ex) {
ex.printStackTrace();
appLogger.error(ex);
}
return props;
}
Expand Down Expand Up @@ -87,16 +86,14 @@ public static File convertBytesArrayToFile(byte[] bytes, String ruta) {
fileOuputStream.write(bytes);
fileOuputStream.flush();
return new File(ruta);
} catch (FileNotFoundException e) {
appLogger.error(e);
} catch (IOException e) {
appLogger.error(e);
} finally {
if (fileOuputStream != null) {
try {
fileOuputStream.close();
} catch (IOException e) {
e.printStackTrace();
appLogger.error(e);
}
}
}
Expand Down

0 comments on commit 2661485

Please sign in to comment.