Skip to content

Commit

Permalink
no message
Browse files Browse the repository at this point in the history
  • Loading branch information
grada84 committed Nov 4, 2024
1 parent 2900d3d commit aa3db48
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static HttpClient getNewHttpClient() {
HttpParams httpParams = httpClient.getParams();
httpParams.setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, timeout * 1000);
httpParams.setParameter(CoreConnectionPNames.SO_TIMEOUT, timeout * 1000);
httpParams.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, new Long(timeout * 1000));
httpParams.setParameter(ClientPNames.CONN_MANAGER_TIMEOUT, timeout * 1000);
return httpClient;
}
} catch (Exception e) {
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/net/lacnic/portal/auth/client/UtilsFiles.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,12 @@ public static File obtenerFile(byte[] bytes, String extension) {
try {
String uuid = UUID.randomUUID().toString();
File file = new File(System.getProperty("jboss.server.temp.dir").concat("/") + uuid + "." + extension);
file.createNewFile();

try (FileOutputStream fos = new FileOutputStream(file)) {
fos.write(bytes);
fos.flush();
boolean created = file.createNewFile();
if (created) {
try (FileOutputStream fos = new FileOutputStream(file)) {
fos.write(bytes);
fos.flush();
}
}

return file;
Expand Down

0 comments on commit aa3db48

Please sign in to comment.