poi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kiwiwi...@apache.org
Subject svn commit: r1753004 - /poi/trunk/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSecureTempZip.java
Date Sun, 17 Jul 2016 00:27:52 GMT
Author: kiwiwings
Date: Sun Jul 17 00:27:52 2016
New Revision: 1753004

URL: http://svn.apache.org/viewvc?rev=1753004&view=rev
Log:
use real TempFile

Modified:
    poi/trunk/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSecureTempZip.java

Modified: poi/trunk/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSecureTempZip.java
URL: http://svn.apache.org/viewvc/poi/trunk/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSecureTempZip.java?rev=1753004&r1=1753003&r2=1753004&view=diff
==============================================================================
--- poi/trunk/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSecureTempZip.java (original)
+++ poi/trunk/src/ooxml/testcases/org/apache/poi/poifs/crypt/TestSecureTempZip.java Sun Jul
17 00:27:52 2016
@@ -45,6 +45,7 @@ import org.apache.poi.openxml4j.opc.OPCP
 import org.apache.poi.openxml4j.util.ZipEntrySource;
 import org.apache.poi.poifs.filesystem.POIFSFileSystem;
 import org.apache.poi.util.IOUtils;
+import org.apache.poi.util.TempFile;
 import org.apache.poi.xssf.XSSFTestDataSamples;
 import org.apache.poi.xssf.extractor.XSSFEventBasedExcelExtractor;
 import org.apache.poi.xssf.usermodel.XSSFWorkbook;
@@ -58,7 +59,7 @@ public class TestSecureTempZip {
      */
     @Test
     public void protectedTempZip() throws IOException, GeneralSecurityException, XmlException,
OpenXML4JException {
-        final File tmpFile = new File("build/tmp", "protectedXlsx.zip");
+        final File tmpFile = TempFile.createTempFile("protectedXlsx", ".zip");
         File tikaProt = XSSFTestDataSamples.getSampleFile("protected_passtika.xlsx");
         FileInputStream fis = new FileInputStream(tikaProt);
         POIFSFileSystem poifs = new POIFSFileSystem(fis);
@@ -101,6 +102,7 @@ public class TestSecureTempZip {
         source.close();
         poifs.close();
         fis.close();
+        tmpFile.delete();
     }
     
     private void copyToFile(InputStream is, File tmpFile, CipherAlgorithm cipherAlgorithm,
byte keyBytes[], byte ivBytes[]) throws IOException, GeneralSecurityException {



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org


Mime
View raw message