1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-16 03:06:22 +00:00

keep filename in temporary file

This commit is contained in:
bgamard
2022-05-16 19:22:54 +02:00
parent dc0c20cd0c
commit 5e7f06070e
2 changed files with 10 additions and 5 deletions

View File

@@ -69,13 +69,18 @@ public class FileService extends AbstractScheduledService {
return Scheduler.newFixedDelaySchedule(0, 5, TimeUnit.SECONDS);
}
public Path createTemporaryFile() throws IOException {
return createTemporaryFile(null);
}
/**
* Create a temporary file.
*
* @param name Wanted file name
* @return New temporary file
*/
public Path createTemporaryFile() throws IOException {
Path path = Files.createTempFile("sismics_docs", null);
public Path createTemporaryFile(String name) throws IOException {
Path path = Files.createTempFile("sismics_docs", name);
referenceSet.add(new TemporaryPathReference(path, referenceQueue));
return path;
}