diff --git a/android/guava/src/com/google/common/io/FileBackedOutputStream.java b/android/guava/src/com/google/common/io/FileBackedOutputStream.java index 51b279971ef7..dd297e90a8b2 100644 --- a/android/guava/src/com/google/common/io/FileBackedOutputStream.java +++ b/android/guava/src/com/google/common/io/FileBackedOutputStream.java @@ -58,13 +58,6 @@ * *
This class is thread-safe. * - *
Warning for Windows users: This class is one of the Guava APIs known to not work - * under Windows. Note that we do not run our - * CI under Windows, we know that some of - * our tests fail under Windows, and we warn - * about using some features of Guava under Windows, especially I/O features, and that warning - * applies even to APIs whose documentation doesn't include individual warnings like this one. - * * @author Chris Nokleberg * @since 1.0 */ diff --git a/android/guava/src/com/google/common/io/Files.java b/android/guava/src/com/google/common/io/Files.java index ffa92f6bfc58..2a25d2fcd896 100644 --- a/android/guava/src/com/google/common/io/Files.java +++ b/android/guava/src/com/google/common/io/Files.java @@ -412,20 +412,13 @@ public static boolean equal(File file1, File file2) throws IOException { *
This method assumes that the temporary volume is writable, has free inodes and free blocks, * and that it will not be called thousands of times per second. * - *
Warning for Windows users: This method is one of the Guava APIs known to not - * work under Windows. Note that we do not - * run our CI under Windows, we know - * that some of our tests fail under Windows, and we warn about using some features of Guava under - * Windows, especially I/O features, and that warning applies even to APIs whose documentation - * doesn't include individual warnings like this one. - * *
{@link java.nio.file.Path} equivalent: {@link
* java.nio.file.Files#createTempDirectory}.
*
* @return the newly-created directory
- * @throws IllegalStateException if the directory could not be created, such as if the system does
- * not support creating temporary directories securely
+ * @throws IllegalStateException if the directory could not be created
+ * @throws UnsupportedOperationException if the system does not support creating temporary
+ * directories securely
* @deprecated For Android users, see the Data and File
* Storage overview to select an appropriate temporary directory (perhaps {@code
diff --git a/android/guava/src/com/google/common/io/TempFileCreator.java b/android/guava/src/com/google/common/io/TempFileCreator.java
index 03c5ae99cec6..e3de72283399 100644
--- a/android/guava/src/com/google/common/io/TempFileCreator.java
+++ b/android/guava/src/com/google/common/io/TempFileCreator.java
@@ -15,17 +15,37 @@
package com.google.common.io;
import static com.google.common.base.StandardSystemProperty.JAVA_IO_TMPDIR;
+import static java.nio.file.attribute.AclEntryFlag.DIRECTORY_INHERIT;
+import static java.nio.file.attribute.AclEntryFlag.FILE_INHERIT;
+import static java.nio.file.attribute.AclEntryPermission.APPEND_DATA;
+import static java.nio.file.attribute.AclEntryPermission.DELETE;
+import static java.nio.file.attribute.AclEntryPermission.DELETE_CHILD;
+import static java.nio.file.attribute.AclEntryPermission.EXECUTE;
+import static java.nio.file.attribute.AclEntryPermission.READ_ACL;
+import static java.nio.file.attribute.AclEntryPermission.READ_ATTRIBUTES;
+import static java.nio.file.attribute.AclEntryPermission.READ_DATA;
+import static java.nio.file.attribute.AclEntryPermission.READ_NAMED_ATTRS;
+import static java.nio.file.attribute.AclEntryPermission.SYNCHRONIZE;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_ACL;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_ATTRIBUTES;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_NAMED_ATTRS;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_OWNER;
+import static java.nio.file.attribute.AclEntryType.ALLOW;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
+import com.google.common.collect.ImmutableList;
import com.google.j2objc.annotations.J2ObjCIncompatible;
import java.io.File;
import java.io.IOException;
+import java.nio.file.FileSystems;
import java.nio.file.Paths;
+import java.nio.file.attribute.AclEntry;
import java.nio.file.attribute.FileAttribute;
-import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
+import java.nio.file.attribute.UserPrincipal;
import java.util.Set;
+import javax.annotation.CheckForNull;
/**
* Creates temporary files and directories whose permissions are restricted to the current user or,
@@ -90,16 +110,62 @@ private static TempFileCreator pickSecureCreator() {
@IgnoreJRERequirement // used only when Path is available
private static final class JavaNioCreator extends TempFileCreator {
- private static final FileAttribute This class is thread-safe.
*
- * Warning for Windows users: This class is one of the Guava APIs known to not work
- * under Windows. Note that we do not run our
- * CI under Windows, we know that some of
- * our tests fail under Windows, and we warn
- * about using some features of Guava under Windows, especially I/O features, and that warning
- * applies even to APIs whose documentation doesn't include individual warnings like this one.
- *
* @author Chris Nokleberg
* @since 1.0
*/
diff --git a/guava/src/com/google/common/io/Files.java b/guava/src/com/google/common/io/Files.java
index ffa92f6bfc58..2a25d2fcd896 100644
--- a/guava/src/com/google/common/io/Files.java
+++ b/guava/src/com/google/common/io/Files.java
@@ -412,20 +412,13 @@ public static boolean equal(File file1, File file2) throws IOException {
* This method assumes that the temporary volume is writable, has free inodes and free blocks,
* and that it will not be called thousands of times per second.
*
- * Warning for Windows users: This method is one of the Guava APIs known to not
- * work under Windows. Note that we do not
- * run our CI under Windows, we know
- * that some of our tests fail under Windows, and we warn about using some features of Guava under
- * Windows, especially I/O features, and that warning applies even to APIs whose documentation
- * doesn't include individual warnings like this one.
- *
* {@link java.nio.file.Path} equivalent: {@link
* java.nio.file.Files#createTempDirectory}.
*
* @return the newly-created directory
- * @throws IllegalStateException if the directory could not be created, such as if the system does
- * not support creating temporary directories securely
+ * @throws IllegalStateException if the directory could not be created
+ * @throws UnsupportedOperationException if the system does not support creating temporary
+ * directories securely
* @deprecated For Android users, see the Data and File
* Storage overview to select an appropriate temporary directory (perhaps {@code
diff --git a/guava/src/com/google/common/io/TempFileCreator.java b/guava/src/com/google/common/io/TempFileCreator.java
index 03c5ae99cec6..e3de72283399 100644
--- a/guava/src/com/google/common/io/TempFileCreator.java
+++ b/guava/src/com/google/common/io/TempFileCreator.java
@@ -15,17 +15,37 @@
package com.google.common.io;
import static com.google.common.base.StandardSystemProperty.JAVA_IO_TMPDIR;
+import static java.nio.file.attribute.AclEntryFlag.DIRECTORY_INHERIT;
+import static java.nio.file.attribute.AclEntryFlag.FILE_INHERIT;
+import static java.nio.file.attribute.AclEntryPermission.APPEND_DATA;
+import static java.nio.file.attribute.AclEntryPermission.DELETE;
+import static java.nio.file.attribute.AclEntryPermission.DELETE_CHILD;
+import static java.nio.file.attribute.AclEntryPermission.EXECUTE;
+import static java.nio.file.attribute.AclEntryPermission.READ_ACL;
+import static java.nio.file.attribute.AclEntryPermission.READ_ATTRIBUTES;
+import static java.nio.file.attribute.AclEntryPermission.READ_DATA;
+import static java.nio.file.attribute.AclEntryPermission.READ_NAMED_ATTRS;
+import static java.nio.file.attribute.AclEntryPermission.SYNCHRONIZE;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_ACL;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_ATTRIBUTES;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_NAMED_ATTRS;
+import static java.nio.file.attribute.AclEntryPermission.WRITE_OWNER;
+import static java.nio.file.attribute.AclEntryType.ALLOW;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.annotations.J2ktIncompatible;
+import com.google.common.collect.ImmutableList;
import com.google.j2objc.annotations.J2ObjCIncompatible;
import java.io.File;
import java.io.IOException;
+import java.nio.file.FileSystems;
import java.nio.file.Paths;
+import java.nio.file.attribute.AclEntry;
import java.nio.file.attribute.FileAttribute;
-import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.PosixFilePermissions;
+import java.nio.file.attribute.UserPrincipal;
import java.util.Set;
+import javax.annotation.CheckForNull;
/**
* Creates temporary files and directories whose permissions are restricted to the current user or,
@@ -90,16 +110,62 @@ private static TempFileCreator pickSecureCreator() {
@IgnoreJRERequirement // used only when Path is available
private static final class JavaNioCreator extends TempFileCreator {
- private static final FileAttribute