bug 60153: java.nio.charset.StandardCharsets is not available until Java 7. Use Charset.forName for Java 6 compatibility
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1763997 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
02b3019f6c
commit
c0b2d60d28
@ -19,7 +19,6 @@
|
|||||||
|
|
||||||
package org.apache.poi.xssf.streaming;
|
package org.apache.poi.xssf.streaming;
|
||||||
|
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
||||||
import static org.junit.Assert.assertEquals;
|
import static org.junit.Assert.assertEquals;
|
||||||
import static org.junit.Assert.assertFalse;
|
import static org.junit.Assert.assertFalse;
|
||||||
import static org.junit.Assert.assertTrue;
|
import static org.junit.Assert.assertTrue;
|
||||||
@ -32,9 +31,9 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
import java.nio.charset.Charset;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.crypto.Cipher;
|
import javax.crypto.Cipher;
|
||||||
@ -115,6 +114,11 @@ public final class TestSXSSFWorkbookWithCustomZipEntrySource {
|
|||||||
opc.close();
|
opc.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Java 7 and above:
|
||||||
|
// import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
|
// Java 6 and below:
|
||||||
|
private static final Charset UTF_8 = Charset.forName("UTF-8");
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void validateTempFilesAreEncrypted() throws IOException {
|
public void validateTempFilesAreEncrypted() throws IOException {
|
||||||
TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource workbook = new TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource();
|
TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource workbook = new TempFileRecordingSXSSFWorkbookWithCustomZipEntrySource();
|
||||||
|
Loading…
Reference in New Issue
Block a user