Author: centic Date: Mon May 20 17:35:54 2019 New Revision: 1859575 URL: http://svn.apache.org/viewvc?rev=1859575&view=rev Log: Use TempFile to avoid problems with temporary directories in Maven builds
Modified: poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java Modified: poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java URL: http://svn.apache.org/viewvc/poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java?rev=1859575&r1=1859574&r2=1859575&view=diff ============================================================================== --- poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java (original) +++ poi/trunk/src/testcases/org/apache/poi/poifs/filesystem/TestFileMagic.java Mon May 20 17:35:54 2019 @@ -19,6 +19,7 @@ package org.apache.poi.poifs.filesystem; import org.apache.commons.codec.Charsets; import org.apache.poi.POIDataSamples; +import org.apache.poi.util.TempFile; import org.junit.Test; import java.io.BufferedInputStream; @@ -108,7 +109,7 @@ public class TestFileMagic { // having a file shorter than 8 bytes previously caused an exception byte[] data = new byte[] { -1, -40, -1, -32, 0 }; - File file = File.createTempFile("TestFileMagic", ".bin"); + File file = TempFile.createTempFile("TestFileMagic", ".bin"); try { try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(data); @@ -124,7 +125,7 @@ public class TestFileMagic { public void testMarkRequired() throws IOException { byte[] data = new byte[] { -1, -40, -1, -32, 0 }; - File file = File.createTempFile("TestFileMagic", ".bin"); + File file = TempFile.createTempFile("TestFileMagic", ".bin"); try { try (FileOutputStream fos = new FileOutputStream(file)) { fos.write(data); --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@poi.apache.org For additional commands, e-mail: commits-h...@poi.apache.org