aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src
diff options
context:
space:
mode:
authorPJ Fanning <fanningpj@apache.org>2022-01-26 19:40:47 +0000
committerPJ Fanning <fanningpj@apache.org>2022-01-26 19:40:47 +0000
commit0e6efc52f26ce5a2dd170b6e0f7bc78ba7320806 (patch)
tree174f29bb0e1d97a7a6fe68e5944e94aef8178e79 /poi/src
parentfc49da56ae2e95b6eff27b23bfd0f07d109ac551 (diff)
downloadpoi-0e6efc52f26ce5a2dd170b6e0f7bc78ba7320806.tar.gz
poi-0e6efc52f26ce5a2dd170b6e0f7bc78ba7320806.zip
[bug-65849] file attributes may cause issues on windows
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897516 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poi/src')
-rw-r--r--poi/src/main/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java16
1 files changed, 1 insertions, 15 deletions
diff --git a/poi/src/main/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java b/poi/src/main/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java
index b5ff8afbeb..342bbeb4f5 100644
--- a/poi/src/main/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java
+++ b/poi/src/main/java/org/apache/poi/util/DefaultTempFileCreationStrategy.java
@@ -22,11 +22,6 @@ import static org.apache.poi.util.TempFile.JAVA_IO_TMPDIR;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
-import java.nio.file.attribute.FileAttribute;
-import java.nio.file.attribute.PosixFilePermission;
-import java.nio.file.attribute.PosixFilePermissions;
-import java.util.HashSet;
-import java.util.Set;
/**
* Default implementation of the {@link TempFileCreationStrategy} used by {@link TempFile}:
@@ -46,8 +41,6 @@ public class DefaultTempFileCreationStrategy implements TempFileCreationStrategy
/** To use files.deleteOnExit after clean JVM exit, set the <code>-Dpoi.delete.tmp.files.on.exit</code> JVM property */
public static final String DELETE_FILES_ON_EXIT = "poi.delete.tmp.files.on.exit";
- private final FileAttribute<Set<PosixFilePermission>> userPermissions;
-
/** The directory where the temporary files will be created (<code>null</code> to use the default directory). */
private File dir;
@@ -69,10 +62,6 @@ public class DefaultTempFileCreationStrategy implements TempFileCreationStrategy
*/
public DefaultTempFileCreationStrategy(File dir) {
this.dir = dir;
- Set<PosixFilePermission> permissions = new HashSet<>();
- permissions.add(PosixFilePermission.OWNER_READ);
- permissions.add(PosixFilePermission.OWNER_WRITE);
- userPermissions = PosixFilePermissions.asFileAttribute(permissions);
}
private void createPOIFilesDirectory() throws IOException {
@@ -115,10 +104,7 @@ public class DefaultTempFileCreationStrategy implements TempFileCreationStrategy
createPOIFilesDirectory();
// Generate a unique new filename
- HashSet<PosixFilePermission> permissions = new HashSet<>();
- permissions.add(PosixFilePermission.OWNER_READ);
- permissions.add(PosixFilePermission.OWNER_WRITE);
- File newFile = Files.createTempFile(dir.toPath(), prefix, suffix, userPermissions).toFile();
+ File newFile = Files.createTempFile(dir.toPath(), prefix, suffix).toFile();
// Set the delete on exit flag, but only when explicitly disabled
if (System.getProperty(DELETE_FILES_ON_EXIT) != null) {