Skip to content

Commit

Permalink
Test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Sep 10, 2024
1 parent 96f80db commit ae439db
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@
*/
public class AS2ResourceHelper implements Closeable
{
private static final String TEMP_FILE_PREFIX = "as2-lib-res-";
private static final String TEMP_FILE_SUFFIX = ".tmp";
private static final Logger LOGGER = LoggerFactory.getLogger (AS2ResourceHelper.class);

private static File s_aTempDir;

/**
Expand Down Expand Up @@ -128,7 +131,12 @@ public File createTempFile () throws IOException
throw new IllegalStateException ("ResourceManager is already closing/closed!");

// Create
final File ret = Files.createTempFile (s_aTempDir.toPath (), "as2-lib-res-", ".tmp").toFile ();
final File ret = s_aTempDir != null ? Files.createTempFile (s_aTempDir.toPath (),
TEMP_FILE_PREFIX,
TEMP_FILE_SUFFIX).toFile () : Files.createTempFile (
TEMP_FILE_PREFIX,
TEMP_FILE_SUFFIX)
.toFile ();
// And remember
m_aRWLock.writeLocked ( () -> m_aTempFiles.add (ret));
return ret;
Expand Down

0 comments on commit ae439db

Please sign in to comment.