|
22 | 22 | import java.nio.charset.StandardCharsets; |
23 | 23 | import java.nio.file.Files; |
24 | 24 | import java.nio.file.Path; |
25 | | -import java.nio.file.attribute.AclEntry; |
26 | | -import java.nio.file.attribute.AclFileAttributeView; |
27 | 25 | import java.util.ArrayList; |
28 | 26 | import java.util.Arrays; |
| 27 | +import java.util.LinkedList; |
29 | 28 | import java.util.List; |
30 | 29 | import java.util.function.Consumer; |
31 | 30 | import java.util.function.UnaryOperator; |
@@ -169,9 +168,15 @@ protected void assertOnResources(FormatterFunc step, String unformattedPath, Str |
169 | 168 | } |
170 | 169 |
|
171 | 170 | /** Reads file attributes from the output file and compares it to the attributes from the input file. */ |
172 | | - protected void assertFileAttributesEqual(File input, File output) throws IOException { |
173 | | - List<AclEntry> inputAttributes = Files.getFileAttributeView(input.toPath(), AclFileAttributeView.class).getAcl(); |
174 | | - List<AclEntry> outputAttributes = Files.getFileAttributeView(output.toPath(), AclFileAttributeView.class).getAcl(); |
| 171 | + protected void assertFileAttributesEqual(File input, File output) { |
| 172 | + List<Boolean> inputAttributes = new LinkedList<>(); |
| 173 | + List<Boolean> outputAttributes = new LinkedList<>(); |
| 174 | + inputAttributes.add(Files.isReadable(input.toPath())); |
| 175 | + inputAttributes.add(Files.isWritable(input.toPath())); |
| 176 | + inputAttributes.add(Files.isExecutable(input.toPath())); |
| 177 | + outputAttributes.add(Files.isReadable(output.toPath())); |
| 178 | + outputAttributes.add(Files.isWritable(output.toPath())); |
| 179 | + outputAttributes.add(Files.isExecutable(output.toPath())); |
175 | 180 | Assertions.assertThat(outputAttributes).isEqualTo(inputAttributes); |
176 | 181 | } |
177 | 182 |
|
|
0 commit comments