-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from pagopa/hotfix-zip-function
Hotfix zip function
- Loading branch information
Showing
8 changed files
with
138 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,70 @@ | ||
|
||
{ | ||
"openapi": "3.0.1", | ||
"info": { | ||
"description": "PagoPA Print Payment Notices Functions", | ||
"termsOfService": "https://www.pagopa.gov.it/", | ||
"title": "pagopa-print-payment-notice-functions", | ||
"version": "1.0.0-1-hotfix-zip-function" | ||
}, | ||
"servers": [ | ||
{ | ||
"url": "http://localhost", | ||
"description": "Generated server url" | ||
} | ||
], | ||
"paths": { | ||
"/info": { | ||
"get": { | ||
"description": "Return OK if application is started", | ||
"operationId": "healthCheck", | ||
"responses": { | ||
"200": { | ||
"content": { | ||
"*/*": { | ||
"schema": { | ||
"$ref": "#/components/schemas/AppInfo" | ||
} | ||
} | ||
}, | ||
"description": "OK" | ||
} | ||
}, | ||
"security": [ | ||
{ | ||
"ApiKey": [] | ||
} | ||
], | ||
"summary": "health check", | ||
"tags": [ | ||
"Home" | ||
] | ||
} | ||
} | ||
}, | ||
"components": { | ||
"schemas": { | ||
"AppInfo": { | ||
"type": "object", | ||
"properties": { | ||
"environment": { | ||
"type": "string" | ||
}, | ||
"name": { | ||
"type": "string" | ||
}, | ||
"version": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"securitySchemes": { | ||
"ApiKey": { | ||
"description": "The API key to access this function app.", | ||
"in": "header", | ||
"name": "Ocp-Apim-Subscription-Key", | ||
"type": "apiKey" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/it/gov/pagopa/print/payment/notice/functions/utils/WorkingDirectoryUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package it.gov.pagopa.print.payment.notice.functions.utils; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.NoArgsConstructor; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.apache.commons.io.FileUtils; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import java.nio.file.Files; | ||
|
||
/** | ||
* Utils methods for working directory | ||
*/ | ||
@Slf4j | ||
@NoArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class WorkingDirectoryUtils { | ||
|
||
public static File createWorkingDirectory() throws IOException { | ||
File workingDirectory = new File("temp"); | ||
if(!workingDirectory.exists()) { | ||
Files.createDirectory(workingDirectory.toPath()); | ||
} | ||
return workingDirectory; | ||
} | ||
|
||
public static void clearTempDirectory(java.nio.file.Path workingDirPath) { | ||
try { | ||
FileUtils.deleteDirectory(workingDirPath.toFile()); | ||
} catch (IOException e) { | ||
log.warn("Unable to clear working directory", e); | ||
} | ||
} | ||
|
||
} |