You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Modified AttributeCachingFileSystemTests.kt cached acl attributes do not get modified by concurrent operation test to use only readAttributes and setAttribute
Added AttributeCachingFileSystemTests.kt `acl attributes accessed from Files getFileAttributeView() are not cached` test to demonstrate we cannot cache attributes via FileAttributeViews
Added README.md note to use Files.readAttributes() and Files.setAttribute() to access proper caching functionality
Copy file name to clipboardExpand all lines: file-attribute-caching/src/test/kotlin/com/pkware/filesystem/attributecaching/AttributeCachingFileSystemTests.kt
+83-6Lines changed: 83 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -530,9 +530,11 @@ class AttributeCachingFileSystemTests {
530
530
// Test with original file owner on default filesystem because it's a large amount of work to create our
531
531
// own test user there.
532
532
533
-
val originalAttributeView =Files.getFileAttributeView(cachingPath, AclFileAttributeView::class.java)
534
-
val originalOwner = originalAttributeView.owner
535
-
val originalAclEntries = originalAttributeView.acl
533
+
val originalAttributeMap =Files.readAttributes(cachingPath, "acl:*")
534
+
val originalOwner = originalAttributeMap["owner"] as?UserPrincipal
535
+
536
+
@Suppress("UNCHECKED_CAST")
537
+
val originalAclEntries = originalAttributeMap["acl"] as?List<AclEntry>
536
538
537
539
// simulate concurrent modification on default filesystem
538
540
val concurrentPath = defaultFileSystem.getPath(
@@ -555,13 +557,12 @@ class AttributeCachingFileSystemTests {
0 commit comments