ADD week 5
This commit is contained in:
12
02-Easy5/E5/sources/kotlin/io/path/CopyActionContext.java
Normal file
12
02-Easy5/E5/sources/kotlin/io/path/CopyActionContext.java
Normal file
@ -0,0 +1,12 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.nio.file.Path;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: CopyActionContext.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\bg\u0018\u00002\u00020\u0001J\u001c\u0010\u0002\u001a\u00020\u0003*\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0006\u001a\u00020\u0007H&¨\u0006\b"}, d2 = {"Lkotlin/io/path/CopyActionContext;", "", "copyToIgnoringExistingDirectory", "Lkotlin/io/path/CopyActionResult;", "Ljava/nio/file/Path;", TypedValues.AttributesType.S_TARGET, "followLinks", "", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface CopyActionContext {
|
||||
CopyActionResult copyToIgnoringExistingDirectory(Path path, Path path2, boolean z);
|
||||
}
|
12
02-Easy5/E5/sources/kotlin/io/path/CopyActionResult.java
Normal file
12
02-Easy5/E5/sources/kotlin/io/path/CopyActionResult.java
Normal file
@ -0,0 +1,12 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: CopyActionResult.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0005\b\u0087\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005¨\u0006\u0006"}, d2 = {"Lkotlin/io/path/CopyActionResult;", "", "(Ljava/lang/String;I)V", "CONTINUE", "SKIP_SUBTREE", "TERMINATE", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public enum CopyActionResult {
|
||||
CONTINUE,
|
||||
SKIP_SUBTREE,
|
||||
TERMINATE
|
||||
}
|
@ -0,0 +1,66 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: PathRecursiveFunctions.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\bÃ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u001c\u0010\u0003\u001a\u00020\u0004*\u00020\u00052\u0006\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0007\u001a\u00020\bH\u0016¨\u0006\t"}, d2 = {"Lkotlin/io/path/DefaultCopyActionContext;", "Lkotlin/io/path/CopyActionContext;", "()V", "copyToIgnoringExistingDirectory", "Lkotlin/io/path/CopyActionResult;", "Ljava/nio/file/Path;", TypedValues.AttributesType.S_TARGET, "followLinks", "", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class DefaultCopyActionContext implements CopyActionContext {
|
||||
public static final DefaultCopyActionContext INSTANCE = new DefaultCopyActionContext();
|
||||
|
||||
private DefaultCopyActionContext() {
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:4:0x0038, code lost:
|
||||
|
||||
if (r0 == false) goto L6;
|
||||
*/
|
||||
@Override // kotlin.io.path.CopyActionContext
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public kotlin.io.path.CopyActionResult copyToIgnoringExistingDirectory(java.nio.file.Path r5, java.nio.file.Path r6, boolean r7) {
|
||||
/*
|
||||
r4 = this;
|
||||
java.lang.String r0 = "<this>"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r5, r0)
|
||||
java.lang.String r0 = "target"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r6, r0)
|
||||
kotlin.io.path.LinkFollowing r0 = kotlin.io.path.LinkFollowing.INSTANCE
|
||||
java.nio.file.LinkOption[] r7 = r0.toLinkOptions(r7)
|
||||
int r0 = r7.length
|
||||
java.lang.Object[] r0 = java.util.Arrays.copyOf(r7, r0)
|
||||
java.nio.file.LinkOption[] r0 = (java.nio.file.LinkOption[]) r0
|
||||
int r1 = r0.length
|
||||
java.lang.Object[] r0 = java.util.Arrays.copyOf(r0, r1)
|
||||
java.nio.file.LinkOption[] r0 = (java.nio.file.LinkOption[]) r0
|
||||
boolean r0 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m(r5, r0)
|
||||
if (r0 == 0) goto L3a
|
||||
r0 = 1
|
||||
java.nio.file.LinkOption[] r1 = new java.nio.file.LinkOption[r0]
|
||||
r2 = 0
|
||||
java.nio.file.LinkOption r3 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1523m()
|
||||
r1[r2] = r3
|
||||
java.lang.Object[] r0 = java.util.Arrays.copyOf(r1, r0)
|
||||
java.nio.file.LinkOption[] r0 = (java.nio.file.LinkOption[]) r0
|
||||
boolean r0 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m(r6, r0)
|
||||
if (r0 != 0) goto L51
|
||||
L3a:
|
||||
int r0 = r7.length
|
||||
java.lang.Object[] r7 = java.util.Arrays.copyOf(r7, r0)
|
||||
java.nio.file.CopyOption[] r7 = (java.nio.file.CopyOption[]) r7
|
||||
int r0 = r7.length
|
||||
java.lang.Object[] r7 = java.util.Arrays.copyOf(r7, r0)
|
||||
java.nio.file.CopyOption[] r7 = (java.nio.file.CopyOption[]) r7
|
||||
java.nio.file.Path r5 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m(r5, r6, r7)
|
||||
java.lang.String r6 = "copy(this, target, *options)"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r5, r6)
|
||||
L51:
|
||||
kotlin.io.path.CopyActionResult r5 = kotlin.io.path.CopyActionResult.CONTINUE
|
||||
return r5
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.path.DefaultCopyActionContext.copyToIgnoringExistingDirectory(java.nio.file.Path, java.nio.file.Path, boolean):kotlin.io.path.CopyActionResult");
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArrayDeque;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\b\u0003\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u0018\u0010\f\u001a\u00020\r2\u0006\u0010\u000e\u001a\u00020\u00022\u0006\u0010\u000f\u001a\u00020\u0010H\u0016J\u0014\u0010\u0011\u001a\b\u0012\u0004\u0012\u00020\u00070\u00122\u0006\u0010\u0006\u001a\u00020\u0007J\u0018\u0010\u0013\u001a\u00020\r2\u0006\u0010\u0014\u001a\u00020\u00022\u0006\u0010\u000f\u001a\u00020\u0010H\u0016R\u0010\u0010\u0006\u001a\u0004\u0018\u00010\u0007X\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\b\u001a\b\u0012\u0004\u0012\u00020\u00070\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u0011\u0010\u0003\u001a\u00020\u0004¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000b¨\u0006\u0015"}, d2 = {"Lkotlin/io/path/DirectoryEntriesReader;", "Ljava/nio/file/SimpleFileVisitor;", "Ljava/nio/file/Path;", "followLinks", "", "(Z)V", "directoryNode", "Lkotlin/io/path/PathNode;", "entries", "Lkotlin/collections/ArrayDeque;", "getFollowLinks", "()Z", "preVisitDirectory", "Ljava/nio/file/FileVisitResult;", "dir", "attrs", "Ljava/nio/file/attribute/BasicFileAttributes;", "readEntries", "", "visitFile", "file", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class DirectoryEntriesReader extends SimpleFileVisitor<Path> {
|
||||
private PathNode directoryNode;
|
||||
private ArrayDeque<PathNode> entries = new ArrayDeque<>();
|
||||
private final boolean followLinks;
|
||||
|
||||
public final boolean getFollowLinks() {
|
||||
return this.followLinks;
|
||||
}
|
||||
|
||||
public DirectoryEntriesReader(boolean z) {
|
||||
this.followLinks = z;
|
||||
}
|
||||
|
||||
@Override // java.nio.file.SimpleFileVisitor, java.nio.file.FileVisitor
|
||||
public /* bridge */ /* synthetic */ FileVisitResult preVisitDirectory(Object obj, BasicFileAttributes basicFileAttributes) {
|
||||
return preVisitDirectory(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj), basicFileAttributes);
|
||||
}
|
||||
|
||||
@Override // java.nio.file.SimpleFileVisitor, java.nio.file.FileVisitor
|
||||
public /* bridge */ /* synthetic */ FileVisitResult visitFile(Object obj, BasicFileAttributes basicFileAttributes) {
|
||||
return visitFile(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj), basicFileAttributes);
|
||||
}
|
||||
|
||||
public final List<PathNode> readEntries(PathNode directoryNode) {
|
||||
Intrinsics.checkNotNullParameter(directoryNode, "directoryNode");
|
||||
this.directoryNode = directoryNode;
|
||||
Files.walkFileTree(directoryNode.getPath(), LinkFollowing.INSTANCE.toVisitOptions(this.followLinks), 1, PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1522m((Object) this));
|
||||
this.entries.removeFirst();
|
||||
ArrayDeque<PathNode> arrayDeque = this.entries;
|
||||
this.entries = new ArrayDeque<>();
|
||||
return arrayDeque;
|
||||
}
|
||||
|
||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
|
||||
Object fileKey;
|
||||
Intrinsics.checkNotNullParameter(dir, "dir");
|
||||
Intrinsics.checkNotNullParameter(attrs, "attrs");
|
||||
fileKey = attrs.fileKey();
|
||||
this.entries.add(new PathNode(dir, fileKey, this.directoryNode));
|
||||
FileVisitResult preVisitDirectory = super.preVisitDirectory((DirectoryEntriesReader) dir, attrs);
|
||||
Intrinsics.checkNotNullExpressionValue(preVisitDirectory, "super.preVisitDirectory(dir, attrs)");
|
||||
return preVisitDirectory;
|
||||
}
|
||||
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
Intrinsics.checkNotNullParameter(attrs, "attrs");
|
||||
this.entries.add(new PathNode(file, null, this.directoryNode));
|
||||
FileVisitResult visitFile = super.visitFile((DirectoryEntriesReader) file, attrs);
|
||||
Intrinsics.checkNotNullExpressionValue(visitFile, "super.visitFile(file, attrs)");
|
||||
return visitFile;
|
||||
}
|
||||
}
|
78
02-Easy5/E5/sources/kotlin/io/path/ExceptionsCollector.java
Normal file
78
02-Easy5/E5/sources/kotlin/io/path/ExceptionsCollector.java
Normal file
@ -0,0 +1,78 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: PathRecursiveFunctions.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010!\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\t\n\u0002\u0010\u0002\n\u0002\b\u0005\b\u0002\u0018\u00002\u00020\u0001B\u000f\u0012\b\b\u0002\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\u0012\u0010\u0015\u001a\u00020\u00162\n\u0010\u0017\u001a\u00060\u0007j\u0002`\bJ\u000e\u0010\u0018\u001a\u00020\u00162\u0006\u0010\u0019\u001a\u00020\fJ\u000e\u0010\u001a\u001a\u00020\u00162\u0006\u0010\u0019\u001a\u00020\fR\u001b\u0010\u0005\u001a\f\u0012\b\u0012\u00060\u0007j\u0002`\b0\u0006¢\u0006\b\n\u0000\u001a\u0004\b\t\u0010\nR\u000e\u0010\u0002\u001a\u00020\u0003X\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\u000b\u001a\u0004\u0018\u00010\fX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\r\u0010\u000e\"\u0004\b\u000f\u0010\u0010R\u001e\u0010\u0012\u001a\u00020\u00032\u0006\u0010\u0011\u001a\u00020\u0003@BX\u0086\u000e¢\u0006\b\n\u0000\u001a\u0004\b\u0013\u0010\u0014¨\u0006\u001b"}, d2 = {"Lkotlin/io/path/ExceptionsCollector;", "", "limit", "", "(I)V", "collectedExceptions", "", "Ljava/lang/Exception;", "Lkotlin/Exception;", "getCollectedExceptions", "()Ljava/util/List;", "path", "Ljava/nio/file/Path;", "getPath", "()Ljava/nio/file/Path;", "setPath", "(Ljava/nio/file/Path;)V", "<set-?>", "totalExceptions", "getTotalExceptions", "()I", "collect", "", "exception", "enterEntry", "name", "exitEntry", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class ExceptionsCollector {
|
||||
private final List<Exception> collectedExceptions;
|
||||
private final int limit;
|
||||
private Path path;
|
||||
private int totalExceptions;
|
||||
|
||||
public ExceptionsCollector() {
|
||||
this(0, 1, null);
|
||||
}
|
||||
|
||||
public final List<Exception> getCollectedExceptions() {
|
||||
return this.collectedExceptions;
|
||||
}
|
||||
|
||||
public final Path getPath() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public final int getTotalExceptions() {
|
||||
return this.totalExceptions;
|
||||
}
|
||||
|
||||
public final void setPath(Path path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public ExceptionsCollector(int i) {
|
||||
this.limit = i;
|
||||
this.collectedExceptions = new ArrayList();
|
||||
}
|
||||
|
||||
public /* synthetic */ ExceptionsCollector(int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this((i2 & 1) != 0 ? 64 : i);
|
||||
}
|
||||
|
||||
public final void enterEntry(Path name) {
|
||||
Intrinsics.checkNotNullParameter(name, "name");
|
||||
Path path = this.path;
|
||||
this.path = path != null ? path.resolve(name) : null;
|
||||
}
|
||||
|
||||
public final void exitEntry(Path name) {
|
||||
Intrinsics.checkNotNullParameter(name, "name");
|
||||
Path path = this.path;
|
||||
if (!Intrinsics.areEqual(name, path != null ? path.getFileName() : null)) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
Path path2 = this.path;
|
||||
this.path = path2 != null ? path2.getParent() : null;
|
||||
}
|
||||
|
||||
public final void collect(Exception exception) {
|
||||
Throwable initCause;
|
||||
Intrinsics.checkNotNullParameter(exception, "exception");
|
||||
this.totalExceptions++;
|
||||
if (this.collectedExceptions.size() < this.limit) {
|
||||
if (this.path != null) {
|
||||
PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1();
|
||||
initCause = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1518m(String.valueOf(this.path)).initCause(exception);
|
||||
Intrinsics.checkNotNull(initCause, "null cannot be cast to non-null type java.nio.file.FileSystemException");
|
||||
exception = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1517m((Object) initCause);
|
||||
}
|
||||
this.collectedExceptions.add(exception);
|
||||
}
|
||||
}
|
||||
}
|
23
02-Easy5/E5/sources/kotlin/io/path/ExperimentalPathApi.java
Normal file
23
02-Easy5/E5/sources/kotlin/io/path/ExperimentalPathApi.java
Normal file
@ -0,0 +1,23 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.annotation.AnnotationRetention;
|
||||
import kotlin.annotation.AnnotationTarget;
|
||||
import kotlin.annotation.MustBeDocumented;
|
||||
|
||||
/* compiled from: ExperimentalPathApi.kt */
|
||||
@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR, ElementType.LOCAL_VARIABLE, ElementType.ANNOTATION_TYPE})
|
||||
@kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPEALIAS})
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
@kotlin.annotation.Retention(AnnotationRetention.BINARY)
|
||||
@MustBeDocumented
|
||||
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u001b\n\u0000\b\u0087\u0002\u0018\u00002\u00020\u0001B\u0000¨\u0006\u0002"}, d2 = {"Lkotlin/io/path/ExperimentalPathApi;", "", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
@Documented
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ExperimentalPathApi {
|
||||
}
|
21
02-Easy5/E5/sources/kotlin/io/path/FileVisitorBuilder.java
Normal file
21
02-Easy5/E5/sources/kotlin/io/path/FileVisitorBuilder.java
Normal file
@ -0,0 +1,21 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
|
||||
/* compiled from: FileVisitorBuilder.kt */
|
||||
@Metadata(d1 = {"\u0000:\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\bw\u0018\u00002\u00020\u0001JB\u0010\u0002\u001a\u00020\u000328\u0010\u0004\u001a4\u0012\u0013\u0012\u00110\u0006¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\t\u0012\u0015\u0012\u0013\u0018\u00010\n¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\u000b\u0012\u0004\u0012\u00020\f0\u0005H&J@\u0010\r\u001a\u00020\u000326\u0010\u0004\u001a2\u0012\u0013\u0012\u00110\u0006¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\t\u0012\u0013\u0012\u00110\u000e¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\u000f\u0012\u0004\u0012\u00020\f0\u0005H&J@\u0010\u0010\u001a\u00020\u000326\u0010\u0004\u001a2\u0012\u0013\u0012\u00110\u0006¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\u0011\u0012\u0013\u0012\u00110\u000e¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\u000f\u0012\u0004\u0012\u00020\f0\u0005H&J@\u0010\u0012\u001a\u00020\u000326\u0010\u0004\u001a2\u0012\u0013\u0012\u00110\u0006¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\u0011\u0012\u0013\u0012\u00110\n¢\u0006\f\b\u0007\u0012\b\b\b\u0012\u0004\b\b(\u000b\u0012\u0004\u0012\u00020\f0\u0005H&\u0082\u0001\u0001\u0013¨\u0006\u0014"}, d2 = {"Lkotlin/io/path/FileVisitorBuilder;", "", "onPostVisitDirectory", "", "function", "Lkotlin/Function2;", "Ljava/nio/file/Path;", "Lkotlin/ParameterName;", "name", "directory", "Ljava/io/IOException;", "exception", "Ljava/nio/file/FileVisitResult;", "onPreVisitDirectory", "Ljava/nio/file/attribute/BasicFileAttributes;", "attributes", "onVisitFile", "file", "onVisitFileFailed", "Lkotlin/io/path/FileVisitorBuilderImpl;", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public interface FileVisitorBuilder {
|
||||
void onPostVisitDirectory(Function2<? super Path, ? super IOException, ? extends FileVisitResult> function);
|
||||
|
||||
void onPreVisitDirectory(Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> function);
|
||||
|
||||
void onVisitFile(Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> function);
|
||||
|
||||
void onVisitFileFailed(Function2<? super Path, ? super IOException, ? extends FileVisitResult> function);
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.FileVisitor;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: FileVisitorBuilder.kt */
|
||||
@Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\u0005\b\u0001\u0018\u00002\u00020\u0001B\u0005¢\u0006\u0002\u0010\u0002J\f\u0010\u000e\u001a\b\u0012\u0004\u0012\u00020\u00070\u000fJ\b\u0010\u0010\u001a\u00020\u0011H\u0002J\u001a\u0010\u0012\u001a\u00020\u00112\b\u0010\u0013\u001a\u0004\u0018\u00010\u00142\u0006\u0010\u0015\u001a\u00020\u0016H\u0002JB\u0010\u0005\u001a\u00020\u001128\u0010\u0013\u001a4\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u0018\u0012\u0015\u0012\u0013\u0018\u00010\b¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u0019\u0012\u0004\u0012\u00020\t0\u0006H\u0016J@\u0010\n\u001a\u00020\u001126\u0010\u0013\u001a2\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u0018\u0012\u0013\u0012\u00110\u000b¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u001a\u0012\u0004\u0012\u00020\t0\u0006H\u0016J@\u0010\f\u001a\u00020\u001126\u0010\u0013\u001a2\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u001b\u0012\u0013\u0012\u00110\u000b¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u001a\u0012\u0004\u0012\u00020\t0\u0006H\u0016J@\u0010\r\u001a\u00020\u001126\u0010\u0013\u001a2\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u001b\u0012\u0013\u0012\u00110\b¢\u0006\f\b\u0017\u0012\b\b\u0015\u0012\u0004\b\b(\u0019\u0012\u0004\u0012\u00020\t0\u0006H\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R$\u0010\u0005\u001a\u0018\u0012\u0004\u0012\u00020\u0007\u0012\u0006\u0012\u0004\u0018\u00010\b\u0012\u0004\u0012\u00020\t\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\"\u0010\n\u001a\u0016\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\t\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\"\u0010\f\u001a\u0016\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\u000b\u0012\u0004\u0012\u00020\t\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\"\u0010\r\u001a\u0016\u0012\u0004\u0012\u00020\u0007\u0012\u0004\u0012\u00020\b\u0012\u0004\u0012\u00020\t\u0018\u00010\u0006X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u001c"}, d2 = {"Lkotlin/io/path/FileVisitorBuilderImpl;", "Lkotlin/io/path/FileVisitorBuilder;", "()V", "isBuilt", "", "onPostVisitDirectory", "Lkotlin/Function2;", "Ljava/nio/file/Path;", "Ljava/io/IOException;", "Ljava/nio/file/FileVisitResult;", "onPreVisitDirectory", "Ljava/nio/file/attribute/BasicFileAttributes;", "onVisitFile", "onVisitFileFailed", "build", "Ljava/nio/file/FileVisitor;", "checkIsNotBuilt", "", "checkNotDefined", "function", "", "name", "", "Lkotlin/ParameterName;", "directory", "exception", "attributes", "file", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FileVisitorBuilderImpl implements FileVisitorBuilder {
|
||||
private boolean isBuilt;
|
||||
private Function2<? super Path, ? super IOException, ? extends FileVisitResult> onPostVisitDirectory;
|
||||
private Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> onPreVisitDirectory;
|
||||
private Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> onVisitFile;
|
||||
private Function2<? super Path, ? super IOException, ? extends FileVisitResult> onVisitFileFailed;
|
||||
|
||||
@Override // kotlin.io.path.FileVisitorBuilder
|
||||
public void onPreVisitDirectory(Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
checkIsNotBuilt();
|
||||
checkNotDefined(this.onPreVisitDirectory, "onPreVisitDirectory");
|
||||
this.onPreVisitDirectory = function;
|
||||
}
|
||||
|
||||
@Override // kotlin.io.path.FileVisitorBuilder
|
||||
public void onVisitFile(Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
checkIsNotBuilt();
|
||||
checkNotDefined(this.onVisitFile, "onVisitFile");
|
||||
this.onVisitFile = function;
|
||||
}
|
||||
|
||||
@Override // kotlin.io.path.FileVisitorBuilder
|
||||
public void onVisitFileFailed(Function2<? super Path, ? super IOException, ? extends FileVisitResult> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
checkIsNotBuilt();
|
||||
checkNotDefined(this.onVisitFileFailed, "onVisitFileFailed");
|
||||
this.onVisitFileFailed = function;
|
||||
}
|
||||
|
||||
@Override // kotlin.io.path.FileVisitorBuilder
|
||||
public void onPostVisitDirectory(Function2<? super Path, ? super IOException, ? extends FileVisitResult> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
checkIsNotBuilt();
|
||||
checkNotDefined(this.onPostVisitDirectory, "onPostVisitDirectory");
|
||||
this.onPostVisitDirectory = function;
|
||||
}
|
||||
|
||||
public final FileVisitor<Path> build() {
|
||||
checkIsNotBuilt();
|
||||
this.isBuilt = true;
|
||||
return PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1522m((Object) new FileVisitorImpl(this.onPreVisitDirectory, this.onVisitFile, this.onVisitFileFailed, this.onPostVisitDirectory));
|
||||
}
|
||||
|
||||
private final void checkIsNotBuilt() {
|
||||
if (this.isBuilt) {
|
||||
throw new IllegalStateException("This builder was already built");
|
||||
}
|
||||
}
|
||||
|
||||
private final void checkNotDefined(Object function, String name) {
|
||||
if (function == null) {
|
||||
return;
|
||||
}
|
||||
throw new IllegalStateException(name + " was already defined");
|
||||
}
|
||||
}
|
99
02-Easy5/E5/sources/kotlin/io/path/FileVisitorImpl.java
Normal file
99
02-Easy5/E5/sources/kotlin/io/path/FileVisitorImpl.java
Normal file
@ -0,0 +1,99 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SimpleFileVisitor;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: FileVisitorBuilder.kt */
|
||||
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u000b\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001Bw\u0012\u001a\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004\u0012\u001a\u0010\u0007\u001a\u0016\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004\u0012\u001a\u0010\b\u001a\u0016\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004\u0012\u001c\u0010\n\u001a\u0018\u0012\u0004\u0012\u00020\u0002\u0012\u0006\u0012\u0004\u0018\u00010\t\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004¢\u0006\u0002\u0010\u000bJ\u001a\u0010\f\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\u00022\b\u0010\u000e\u001a\u0004\u0018\u00010\tH\u0016J\u0018\u0010\u000f\u001a\u00020\u00062\u0006\u0010\r\u001a\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u0005H\u0016J\u0018\u0010\u0011\u001a\u00020\u00062\u0006\u0010\u0012\u001a\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u0005H\u0016J\u0018\u0010\u0013\u001a\u00020\u00062\u0006\u0010\u0012\u001a\u00020\u00022\u0006\u0010\u000e\u001a\u00020\tH\u0016R$\u0010\n\u001a\u0018\u0012\u0004\u0012\u00020\u0002\u0012\u0006\u0012\u0004\u0018\u00010\t\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\"\u0010\u0003\u001a\u0016\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\"\u0010\u0007\u001a\u0016\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0005\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\"\u0010\b\u001a\u0016\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\t\u0012\u0004\u0012\u00020\u0006\u0018\u00010\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0014"}, d2 = {"Lkotlin/io/path/FileVisitorImpl;", "Ljava/nio/file/SimpleFileVisitor;", "Ljava/nio/file/Path;", "onPreVisitDirectory", "Lkotlin/Function2;", "Ljava/nio/file/attribute/BasicFileAttributes;", "Ljava/nio/file/FileVisitResult;", "onVisitFile", "onVisitFileFailed", "Ljava/io/IOException;", "onPostVisitDirectory", "(Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)V", "postVisitDirectory", "dir", "exc", "preVisitDirectory", "attrs", "visitFile", "file", "visitFileFailed", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class FileVisitorImpl extends SimpleFileVisitor<Path> {
|
||||
private final Function2<Path, IOException, FileVisitResult> onPostVisitDirectory;
|
||||
private final Function2<Path, BasicFileAttributes, FileVisitResult> onPreVisitDirectory;
|
||||
private final Function2<Path, BasicFileAttributes, FileVisitResult> onVisitFile;
|
||||
private final Function2<Path, IOException, FileVisitResult> onVisitFileFailed;
|
||||
|
||||
@Override // java.nio.file.SimpleFileVisitor, java.nio.file.FileVisitor
|
||||
public /* bridge */ /* synthetic */ FileVisitResult postVisitDirectory(Object obj, IOException iOException) {
|
||||
return postVisitDirectory(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj), iOException);
|
||||
}
|
||||
|
||||
@Override // java.nio.file.SimpleFileVisitor, java.nio.file.FileVisitor
|
||||
public /* bridge */ /* synthetic */ FileVisitResult preVisitDirectory(Object obj, BasicFileAttributes basicFileAttributes) {
|
||||
return preVisitDirectory(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj), basicFileAttributes);
|
||||
}
|
||||
|
||||
@Override // java.nio.file.SimpleFileVisitor, java.nio.file.FileVisitor
|
||||
public /* bridge */ /* synthetic */ FileVisitResult visitFile(Object obj, BasicFileAttributes basicFileAttributes) {
|
||||
return visitFile(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj), basicFileAttributes);
|
||||
}
|
||||
|
||||
@Override // java.nio.file.SimpleFileVisitor, java.nio.file.FileVisitor
|
||||
public /* bridge */ /* synthetic */ FileVisitResult visitFileFailed(Object obj, IOException iOException) {
|
||||
return visitFileFailed(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj), iOException);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public FileVisitorImpl(Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> function2, Function2<? super Path, ? super BasicFileAttributes, ? extends FileVisitResult> function22, Function2<? super Path, ? super IOException, ? extends FileVisitResult> function23, Function2<? super Path, ? super IOException, ? extends FileVisitResult> function24) {
|
||||
this.onPreVisitDirectory = function2;
|
||||
this.onVisitFile = function22;
|
||||
this.onVisitFileFailed = function23;
|
||||
this.onPostVisitDirectory = function24;
|
||||
}
|
||||
|
||||
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) {
|
||||
FileVisitResult m1521m;
|
||||
Intrinsics.checkNotNullParameter(dir, "dir");
|
||||
Intrinsics.checkNotNullParameter(attrs, "attrs");
|
||||
Function2<Path, BasicFileAttributes, FileVisitResult> function2 = this.onPreVisitDirectory;
|
||||
if (function2 != null && (m1521m = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1521m((Object) function2.invoke(dir, attrs))) != null) {
|
||||
return m1521m;
|
||||
}
|
||||
FileVisitResult preVisitDirectory = super.preVisitDirectory((FileVisitorImpl) dir, attrs);
|
||||
Intrinsics.checkNotNullExpressionValue(preVisitDirectory, "super.preVisitDirectory(dir, attrs)");
|
||||
return preVisitDirectory;
|
||||
}
|
||||
|
||||
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) {
|
||||
FileVisitResult m1521m;
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
Intrinsics.checkNotNullParameter(attrs, "attrs");
|
||||
Function2<Path, BasicFileAttributes, FileVisitResult> function2 = this.onVisitFile;
|
||||
if (function2 != null && (m1521m = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1521m((Object) function2.invoke(file, attrs))) != null) {
|
||||
return m1521m;
|
||||
}
|
||||
FileVisitResult visitFile = super.visitFile((FileVisitorImpl) file, attrs);
|
||||
Intrinsics.checkNotNullExpressionValue(visitFile, "super.visitFile(file, attrs)");
|
||||
return visitFile;
|
||||
}
|
||||
|
||||
public FileVisitResult visitFileFailed(Path file, IOException exc) {
|
||||
FileVisitResult m1521m;
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
Intrinsics.checkNotNullParameter(exc, "exc");
|
||||
Function2<Path, IOException, FileVisitResult> function2 = this.onVisitFileFailed;
|
||||
if (function2 != null && (m1521m = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1521m((Object) function2.invoke(file, exc))) != null) {
|
||||
return m1521m;
|
||||
}
|
||||
FileVisitResult visitFileFailed = super.visitFileFailed((FileVisitorImpl) file, exc);
|
||||
Intrinsics.checkNotNullExpressionValue(visitFileFailed, "super.visitFileFailed(file, exc)");
|
||||
return visitFileFailed;
|
||||
}
|
||||
|
||||
public FileVisitResult postVisitDirectory(Path dir, IOException exc) {
|
||||
FileVisitResult m1521m;
|
||||
Intrinsics.checkNotNullParameter(dir, "dir");
|
||||
Function2<Path, IOException, FileVisitResult> function2 = this.onPostVisitDirectory;
|
||||
if (function2 != null && (m1521m = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1521m((Object) function2.invoke(dir, exc))) != null) {
|
||||
return m1521m;
|
||||
}
|
||||
FileVisitResult postVisitDirectory = super.postVisitDirectory((FileVisitorImpl) dir, exc);
|
||||
Intrinsics.checkNotNullExpressionValue(postVisitDirectory, "super.postVisitDirectory(dir, exc)");
|
||||
return postVisitDirectory;
|
||||
}
|
||||
}
|
40
02-Easy5/E5/sources/kotlin/io/path/LinkFollowing.java
Normal file
40
02-Easy5/E5/sources/kotlin/io/path/LinkFollowing.java
Normal file
@ -0,0 +1,40 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.FileVisitOption;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.util.Set;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.SetsKt;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\"\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u000b\n\u0002\b\u0003\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0019\u0010\f\u001a\b\u0012\u0004\u0012\u00020\u00050\u00042\u0006\u0010\r\u001a\u00020\u000e¢\u0006\u0002\u0010\u000fJ\u0014\u0010\u0010\u001a\b\u0012\u0004\u0012\u00020\t0\b2\u0006\u0010\r\u001a\u00020\u000eR\u0016\u0010\u0003\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0006R\u0014\u0010\u0007\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\n\u001a\b\u0012\u0004\u0012\u00020\u00050\u0004X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0006R\u0014\u0010\u000b\u001a\b\u0012\u0004\u0012\u00020\t0\bX\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0011"}, d2 = {"Lkotlin/io/path/LinkFollowing;", "", "()V", "followLinkOption", "", "Ljava/nio/file/LinkOption;", "[Ljava/nio/file/LinkOption;", "followVisitOption", "", "Ljava/nio/file/FileVisitOption;", "nofollowLinkOption", "nofollowVisitOption", "toLinkOptions", "followLinks", "", "(Z)[Ljava/nio/file/LinkOption;", "toVisitOptions", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LinkFollowing {
|
||||
public static final LinkFollowing INSTANCE = new LinkFollowing();
|
||||
private static final LinkOption[] followLinkOption;
|
||||
private static final Set<FileVisitOption> followVisitOption;
|
||||
private static final LinkOption[] nofollowLinkOption;
|
||||
private static final Set<FileVisitOption> nofollowVisitOption;
|
||||
|
||||
public final LinkOption[] toLinkOptions(boolean followLinks) {
|
||||
return followLinks ? followLinkOption : nofollowLinkOption;
|
||||
}
|
||||
|
||||
public final Set<FileVisitOption> toVisitOptions(boolean followLinks) {
|
||||
return followLinks ? followVisitOption : nofollowVisitOption;
|
||||
}
|
||||
|
||||
private LinkFollowing() {
|
||||
}
|
||||
|
||||
static {
|
||||
LinkOption linkOption;
|
||||
FileVisitOption fileVisitOption;
|
||||
linkOption = LinkOption.NOFOLLOW_LINKS;
|
||||
nofollowLinkOption = new LinkOption[]{linkOption};
|
||||
followLinkOption = new LinkOption[0];
|
||||
nofollowVisitOption = SetsKt.emptySet();
|
||||
fileVisitOption = FileVisitOption.FOLLOW_LINKS;
|
||||
followVisitOption = SetsKt.setOf(fileVisitOption);
|
||||
}
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/io/path/OnErrorResult.java
Normal file
11
02-Easy5/E5/sources/kotlin/io/path/OnErrorResult.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: OnErrorResult.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0087\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004¨\u0006\u0005"}, d2 = {"Lkotlin/io/path/OnErrorResult;", "", "(Ljava/lang/String;I)V", "SKIP_SUBTREE", "TERMINATE", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public enum OnErrorResult {
|
||||
SKIP_SUBTREE,
|
||||
TERMINATE
|
||||
}
|
43
02-Easy5/E5/sources/kotlin/io/path/PathNode.java
Normal file
43
02-Easy5/E5/sources/kotlin/io/path/PathNode.java
Normal file
@ -0,0 +1,43 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010(\n\u0002\b\u000b\b\u0002\u0018\u00002\u00020\u0001B!\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\b\u0010\u0004\u001a\u0004\u0018\u00010\u0001\u0012\b\u0010\u0005\u001a\u0004\u0018\u00010\u0000¢\u0006\u0002\u0010\u0006R\"\u0010\u0007\u001a\n\u0012\u0004\u0012\u00020\u0000\u0018\u00010\bX\u0086\u000e¢\u0006\u000e\n\u0000\u001a\u0004\b\t\u0010\n\"\u0004\b\u000b\u0010\fR\u0013\u0010\u0004\u001a\u0004\u0018\u00010\u0001¢\u0006\b\n\u0000\u001a\u0004\b\r\u0010\u000eR\u0013\u0010\u0005\u001a\u0004\u0018\u00010\u0000¢\u0006\b\n\u0000\u001a\u0004\b\u000f\u0010\u0010R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0011\u0010\u0012¨\u0006\u0013"}, d2 = {"Lkotlin/io/path/PathNode;", "", "path", "Ljava/nio/file/Path;", "key", "parent", "(Ljava/nio/file/Path;Ljava/lang/Object;Lkotlin/io/path/PathNode;)V", "contentIterator", "", "getContentIterator", "()Ljava/util/Iterator;", "setContentIterator", "(Ljava/util/Iterator;)V", "getKey", "()Ljava/lang/Object;", "getParent", "()Lkotlin/io/path/PathNode;", "getPath", "()Ljava/nio/file/Path;", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class PathNode {
|
||||
private Iterator<PathNode> contentIterator;
|
||||
private final Object key;
|
||||
private final PathNode parent;
|
||||
private final Path path;
|
||||
|
||||
public final Iterator<PathNode> getContentIterator() {
|
||||
return this.contentIterator;
|
||||
}
|
||||
|
||||
public final Object getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public final PathNode getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
public final Path getPath() {
|
||||
return this.path;
|
||||
}
|
||||
|
||||
public final void setContentIterator(Iterator<PathNode> it) {
|
||||
this.contentIterator = it;
|
||||
}
|
||||
|
||||
public PathNode(Path path, Object obj, PathNode pathNode) {
|
||||
Intrinsics.checkNotNullParameter(path, "path");
|
||||
this.path = path;
|
||||
this.key = obj;
|
||||
this.parent = pathNode;
|
||||
}
|
||||
}
|
79
02-Easy5/E5/sources/kotlin/io/path/PathRelativizer.java
Normal file
79
02-Easy5/E5/sources/kotlin/io/path/PathRelativizer.java
Normal file
@ -0,0 +1,79 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.FileSystem;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.StringsKt;
|
||||
|
||||
/* compiled from: PathUtils.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\bÂ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\u0016\u0010\u0007\u001a\u00020\u00042\u0006\u0010\b\u001a\u00020\u00042\u0006\u0010\t\u001a\u00020\u0004R\u0016\u0010\u0003\u001a\n \u0005*\u0004\u0018\u00010\u00040\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u0016\u0010\u0006\u001a\n \u0005*\u0004\u0018\u00010\u00040\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\n"}, d2 = {"Lkotlin/io/path/PathRelativizer;", "", "()V", "emptyPath", "Ljava/nio/file/Path;", "kotlin.jvm.PlatformType", "parentPath", "tryRelativeTo", "path", "base", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class PathRelativizer {
|
||||
public static final PathRelativizer INSTANCE = new PathRelativizer();
|
||||
private static final Path emptyPath;
|
||||
private static final Path parentPath;
|
||||
|
||||
private PathRelativizer() {
|
||||
}
|
||||
|
||||
static {
|
||||
Path path;
|
||||
Path path2;
|
||||
path = Paths.get("", new String[0]);
|
||||
emptyPath = path;
|
||||
path2 = Paths.get("..", new String[0]);
|
||||
parentPath = path2;
|
||||
}
|
||||
|
||||
public final Path tryRelativeTo(Path path, Path base) {
|
||||
Path normalize;
|
||||
Path r;
|
||||
Path relativize;
|
||||
int nameCount;
|
||||
int nameCount2;
|
||||
FileSystem fileSystem;
|
||||
String separator;
|
||||
FileSystem fileSystem2;
|
||||
FileSystem fileSystem3;
|
||||
String separator2;
|
||||
Path name;
|
||||
Path name2;
|
||||
Intrinsics.checkNotNullParameter(path, "path");
|
||||
Intrinsics.checkNotNullParameter(base, "base");
|
||||
normalize = base.normalize();
|
||||
r = path.normalize();
|
||||
relativize = normalize.relativize(r);
|
||||
nameCount = normalize.getNameCount();
|
||||
nameCount2 = r.getNameCount();
|
||||
int min = Math.min(nameCount, nameCount2);
|
||||
for (int i = 0; i < min; i++) {
|
||||
name = normalize.getName(i);
|
||||
Path path2 = parentPath;
|
||||
if (!Intrinsics.areEqual(name, path2)) {
|
||||
break;
|
||||
}
|
||||
name2 = r.getName(i);
|
||||
if (!Intrinsics.areEqual(name2, path2)) {
|
||||
throw new IllegalArgumentException("Unable to compute relative path");
|
||||
}
|
||||
}
|
||||
if (Intrinsics.areEqual(r, normalize) || !Intrinsics.areEqual(normalize, emptyPath)) {
|
||||
String obj = relativize.toString();
|
||||
fileSystem = relativize.getFileSystem();
|
||||
separator = fileSystem.getSeparator();
|
||||
Intrinsics.checkNotNullExpressionValue(separator, "rn.fileSystem.separator");
|
||||
if (StringsKt.endsWith$default(obj, separator, false, 2, (Object) null)) {
|
||||
fileSystem2 = relativize.getFileSystem();
|
||||
fileSystem3 = relativize.getFileSystem();
|
||||
separator2 = fileSystem3.getSeparator();
|
||||
r = fileSystem2.getPath(StringsKt.dropLast(obj, separator2.length()), new String[0]);
|
||||
} else {
|
||||
r = relativize;
|
||||
}
|
||||
}
|
||||
Intrinsics.checkNotNullExpressionValue(r, "r");
|
||||
return r;
|
||||
}
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import android.content.res.loader.ResourcesLoader;
|
||||
import android.graphics.drawable.ColorStateListDrawable;
|
||||
import android.view.autofill.AutofillManager;
|
||||
import java.nio.file.FileSystemException;
|
||||
import java.nio.file.FileSystemLoopException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.FileVisitor;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
|
||||
/* compiled from: D8$$SyntheticClass */
|
||||
/* loaded from: classes.dex */
|
||||
public final /* synthetic */ class PathTreeWalk$$ExternalSyntheticApiModelOutline0 {
|
||||
public static /* synthetic */ ResourcesLoader m() {
|
||||
return new ResourcesLoader();
|
||||
}
|
||||
|
||||
public static /* bridge */ /* synthetic */ ColorStateListDrawable m(Object obj) {
|
||||
return (ColorStateListDrawable) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ AutofillManager m1512m(Object obj) {
|
||||
return (AutofillManager) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ Class m1514m() {
|
||||
return BasicFileAttributes.class;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ FileSystemException m1517m(Object obj) {
|
||||
return (FileSystemException) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* synthetic */ FileSystemException m1518m(String str) {
|
||||
return new FileSystemException(str);
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* synthetic */ FileSystemLoopException m1519m(String str) {
|
||||
return new FileSystemLoopException(str);
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ FileVisitResult m1521m(Object obj) {
|
||||
return (FileVisitResult) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ FileVisitor m1522m(Object obj) {
|
||||
return (FileVisitor) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ Path m1524m(Object obj) {
|
||||
return (Path) obj;
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* synthetic */ void m1528m() {
|
||||
}
|
||||
|
||||
/* renamed from: m, reason: collision with other method in class */
|
||||
public static /* bridge */ /* synthetic */ boolean m1531m(Object obj) {
|
||||
return obj instanceof ColorStateListDrawable;
|
||||
}
|
||||
|
||||
public static /* synthetic */ void m$1() {
|
||||
}
|
||||
|
||||
public static /* synthetic */ void m$2() {
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.sequences.SequenceScope;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlin/sequences/SequenceScope;", "Ljava/nio/file/Path;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.io.path.PathTreeWalk$bfsIterator$1", f = "PathTreeWalk.kt", i = {0, 0, 0, 0, 0, 0, 1, 1, 1}, l = {184, 190}, m = "invokeSuspend", n = {"$this$iterator", "queue", "entriesReader", "pathNode", "this_$iv", "path$iv", "$this$iterator", "queue", "entriesReader"}, s = {"L$0", "L$1", "L$2", "L$3", "L$4", "L$5", "L$0", "L$1", "L$2"})
|
||||
/* loaded from: classes.dex */
|
||||
final class PathTreeWalk$bfsIterator$1 extends RestrictedSuspendLambda implements Function2<SequenceScope<? super Path>, Continuation<? super Unit>, Object> {
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
Object L$3;
|
||||
Object L$4;
|
||||
Object L$5;
|
||||
int label;
|
||||
final /* synthetic */ PathTreeWalk this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
PathTreeWalk$bfsIterator$1(PathTreeWalk pathTreeWalk, Continuation<? super PathTreeWalk$bfsIterator$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = pathTreeWalk;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
PathTreeWalk$bfsIterator$1 pathTreeWalk$bfsIterator$1 = new PathTreeWalk$bfsIterator$1(this.this$0, continuation);
|
||||
pathTreeWalk$bfsIterator$1.L$0 = obj;
|
||||
return pathTreeWalk$bfsIterator$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super Path> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((PathTreeWalk$bfsIterator$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:34:0x00fc */
|
||||
/* JADX WARN: Removed duplicated region for block: B:9:0x008c */
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:21:0x00fa -> B:6:0x0082). Please report as a decompilation issue!!! */
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:22:0x00fc -> B:6:0x0082). Please report as a decompilation issue!!! */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object invokeSuspend(java.lang.Object r15) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 323
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.path.PathTreeWalk$bfsIterator$1.invokeSuspend(java.lang.Object):java.lang.Object");
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.Path;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.coroutines.jvm.internal.DebugMetadata;
|
||||
import kotlin.coroutines.jvm.internal.RestrictedSuspendLambda;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.sequences.SequenceScope;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u000e\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0000\u0010\u0003\u001a\u00020\u0002*\b\u0012\u0004\u0012\u00020\u00010\u0000H\u008a@"}, d2 = {"Lkotlin/sequences/SequenceScope;", "Ljava/nio/file/Path;", "", "<anonymous>"}, k = 3, mv = {1, 8, 0})
|
||||
@DebugMetadata(c = "kotlin.io.path.PathTreeWalk$dfsIterator$1", f = "PathTreeWalk.kt", i = {0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3}, l = {184, 190, 199, 205}, m = "invokeSuspend", n = {"$this$iterator", "stack", "entriesReader", "startNode", "this_$iv", "path$iv", "$this$iterator", "stack", "entriesReader", "$this$iterator", "stack", "entriesReader", "pathNode", "this_$iv", "path$iv", "$this$iterator", "stack", "entriesReader"}, s = {"L$0", "L$1", "L$2", "L$3", "L$4", "L$5", "L$0", "L$1", "L$2", "L$0", "L$1", "L$2", "L$3", "L$4", "L$5", "L$0", "L$1", "L$2"})
|
||||
/* loaded from: classes.dex */
|
||||
final class PathTreeWalk$dfsIterator$1 extends RestrictedSuspendLambda implements Function2<SequenceScope<? super Path>, Continuation<? super Unit>, Object> {
|
||||
private /* synthetic */ Object L$0;
|
||||
Object L$1;
|
||||
Object L$2;
|
||||
Object L$3;
|
||||
Object L$4;
|
||||
Object L$5;
|
||||
int label;
|
||||
final /* synthetic */ PathTreeWalk this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
PathTreeWalk$dfsIterator$1(PathTreeWalk pathTreeWalk, Continuation<? super PathTreeWalk$dfsIterator$1> continuation) {
|
||||
super(2, continuation);
|
||||
this.this$0 = pathTreeWalk;
|
||||
}
|
||||
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
public final Continuation<Unit> create(Object obj, Continuation<?> continuation) {
|
||||
PathTreeWalk$dfsIterator$1 pathTreeWalk$dfsIterator$1 = new PathTreeWalk$dfsIterator$1(this.this$0, continuation);
|
||||
pathTreeWalk$dfsIterator$1.L$0 = obj;
|
||||
return pathTreeWalk$dfsIterator$1;
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Object invoke(SequenceScope<? super Path> sequenceScope, Continuation<? super Unit> continuation) {
|
||||
return ((PathTreeWalk$dfsIterator$1) create(sequenceScope, continuation)).invokeSuspend(Unit.INSTANCE);
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:14:0x01e3 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:18:0x0158 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:56:0x010a */
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:13:0x01e1 -> B:14:0x014e). Please report as a decompilation issue!!! */
|
||||
/* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:38:0x01e3 -> B:14:0x014e). Please report as a decompilation issue!!! */
|
||||
@Override // kotlin.coroutines.jvm.internal.BaseContinuationImpl
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final java.lang.Object invokeSuspend(java.lang.Object r19) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 563
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.path.PathTreeWalk$dfsIterator$1.invokeSuspend(java.lang.Object):java.lang.Object");
|
||||
}
|
||||
}
|
106
02-Easy5/E5/sources/kotlin/io/path/PathTreeWalk.java
Normal file
106
02-Easy5/E5/sources/kotlin/io/path/PathTreeWalk.java
Normal file
@ -0,0 +1,106 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.nio.file.Path;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.coroutines.Continuation;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.sequences.Sequence;
|
||||
import kotlin.sequences.SequenceScope;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000V\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010(\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010 \n\u0002\b\u0002\b\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\u001d\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u000e\u0010\u0004\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060\u0005¢\u0006\u0002\u0010\u0007J\u000e\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u00020\u0015H\u0002J\u000e\u0010\u0016\u001a\b\u0012\u0004\u0012\u00020\u00020\u0015H\u0002J\u000f\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00020\u0015H\u0096\u0002JE\u0010\u0018\u001a\u00020\u0019*\b\u0012\u0004\u0012\u00020\u00020\u001a2\u0006\u0010\u001b\u001a\u00020\u001c2\u0006\u0010\u001d\u001a\u00020\u001e2\u0018\u0010\u001f\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u001c0!\u0012\u0004\u0012\u00020\u00190 H\u0082Hø\u0001\u0000¢\u0006\u0002\u0010\"R\u0014\u0010\b\u001a\u00020\t8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\n\u0010\u000bR\u0014\u0010\f\u001a\u00020\t8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\r\u0010\u000bR\u0014\u0010\u000e\u001a\u00020\t8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000bR\u001a\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u00100\u00058BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u0011\u0010\u0012R\u0018\u0010\u0004\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0004\n\u0002\u0010\u0013R\u000e\u0010\u0003\u001a\u00020\u0002X\u0082\u0004¢\u0006\u0002\n\u0000\u0082\u0002\u0004\n\u0002\b\u0019¨\u0006#"}, d2 = {"Lkotlin/io/path/PathTreeWalk;", "Lkotlin/sequences/Sequence;", "Ljava/nio/file/Path;", "start", "options", "", "Lkotlin/io/path/PathWalkOption;", "(Ljava/nio/file/Path;[Lkotlin/io/path/PathWalkOption;)V", "followLinks", "", "getFollowLinks", "()Z", "includeDirectories", "getIncludeDirectories", "isBFS", "linkOptions", "Ljava/nio/file/LinkOption;", "getLinkOptions", "()[Ljava/nio/file/LinkOption;", "[Lkotlin/io/path/PathWalkOption;", "bfsIterator", "", "dfsIterator", "iterator", "yieldIfNeeded", "", "Lkotlin/sequences/SequenceScope;", "node", "Lkotlin/io/path/PathNode;", "entriesReader", "Lkotlin/io/path/DirectoryEntriesReader;", "entriesAction", "Lkotlin/Function1;", "", "(Lkotlin/sequences/SequenceScope;Lkotlin/io/path/PathNode;Lkotlin/io/path/DirectoryEntriesReader;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class PathTreeWalk implements Sequence<Path> {
|
||||
private final PathWalkOption[] options;
|
||||
private final Path start;
|
||||
|
||||
public PathTreeWalk(Path start, PathWalkOption[] options) {
|
||||
Intrinsics.checkNotNullParameter(start, "start");
|
||||
Intrinsics.checkNotNullParameter(options, "options");
|
||||
this.start = start;
|
||||
this.options = options;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final boolean getFollowLinks() {
|
||||
return ArraysKt.contains(this.options, PathWalkOption.FOLLOW_LINKS);
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final LinkOption[] getLinkOptions() {
|
||||
return LinkFollowing.INSTANCE.toLinkOptions(getFollowLinks());
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public final boolean getIncludeDirectories() {
|
||||
return ArraysKt.contains(this.options, PathWalkOption.INCLUDE_DIRECTORIES);
|
||||
}
|
||||
|
||||
private final boolean isBFS() {
|
||||
return ArraysKt.contains(this.options, PathWalkOption.BREADTH_FIRST);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<Path> iterator() {
|
||||
return isBFS() ? bfsIterator() : dfsIterator();
|
||||
}
|
||||
|
||||
private final Object yieldIfNeeded(SequenceScope<? super Path> sequenceScope, PathNode pathNode, DirectoryEntriesReader directoryEntriesReader, Function1<? super List<PathNode>, Unit> function1, Continuation<? super Unit> continuation) {
|
||||
boolean isDirectory;
|
||||
LinkOption linkOption;
|
||||
boolean exists;
|
||||
boolean createsCycle;
|
||||
boolean isDirectory2;
|
||||
Path path = pathNode.getPath();
|
||||
LinkOption[] linkOptions = getLinkOptions();
|
||||
LinkOption[] linkOptionArr = (LinkOption[]) Arrays.copyOf(linkOptions, linkOptions.length);
|
||||
isDirectory = Files.isDirectory(path, (LinkOption[]) Arrays.copyOf(linkOptionArr, linkOptionArr.length));
|
||||
if (isDirectory) {
|
||||
createsCycle = PathTreeWalkKt.createsCycle(pathNode);
|
||||
if (!createsCycle) {
|
||||
if (getIncludeDirectories()) {
|
||||
InlineMarker.mark(0);
|
||||
sequenceScope.yield(path, continuation);
|
||||
InlineMarker.mark(1);
|
||||
}
|
||||
LinkOption[] linkOptions2 = getLinkOptions();
|
||||
LinkOption[] linkOptionArr2 = (LinkOption[]) Arrays.copyOf(linkOptions2, linkOptions2.length);
|
||||
isDirectory2 = Files.isDirectory(path, (LinkOption[]) Arrays.copyOf(linkOptionArr2, linkOptionArr2.length));
|
||||
if (isDirectory2) {
|
||||
function1.invoke(directoryEntriesReader.readEntries(pathNode));
|
||||
}
|
||||
} else {
|
||||
PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$2();
|
||||
throw PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1519m(path.toString());
|
||||
}
|
||||
} else {
|
||||
linkOption = LinkOption.NOFOLLOW_LINKS;
|
||||
exists = Files.exists(path, (LinkOption[]) Arrays.copyOf(new LinkOption[]{linkOption}, 1));
|
||||
if (exists) {
|
||||
InlineMarker.mark(0);
|
||||
sequenceScope.yield(path, continuation);
|
||||
InlineMarker.mark(1);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
}
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
private final Iterator<Path> dfsIterator() {
|
||||
return SequencesKt.iterator(new PathTreeWalk$dfsIterator$1(this, null));
|
||||
}
|
||||
|
||||
private final Iterator<Path> bfsIterator() {
|
||||
return SequencesKt.iterator(new PathTreeWalk$bfsIterator$1(this, null));
|
||||
}
|
||||
}
|
52
02-Easy5/E5/sources/kotlin/io/path/PathTreeWalkKt.java
Normal file
52
02-Easy5/E5/sources/kotlin/io/path/PathTreeWalkKt.java
Normal file
@ -0,0 +1,52 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.util.Arrays;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: PathTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0000\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0000\u001a%\u0010\u0000\u001a\u0004\u0018\u00010\u00012\u0006\u0010\u0002\u001a\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005H\u0002¢\u0006\u0002\u0010\u0007\u001a\f\u0010\b\u001a\u00020\t*\u00020\nH\u0002¨\u0006\u000b"}, d2 = {"keyOf", "", "path", "Ljava/nio/file/Path;", "linkOptions", "", "Ljava/nio/file/LinkOption;", "(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Ljava/lang/Object;", "createsCycle", "", "Lkotlin/io/path/PathNode;", "kotlin-stdlib-jdk7"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class PathTreeWalkKt {
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final Object keyOf(Path path, LinkOption[] linkOptionArr) {
|
||||
BasicFileAttributes readAttributes;
|
||||
Object fileKey;
|
||||
try {
|
||||
LinkOption[] linkOptionArr2 = (LinkOption[]) Arrays.copyOf(linkOptionArr, linkOptionArr.length);
|
||||
readAttributes = Files.readAttributes(path, (Class<BasicFileAttributes>) PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1514m(), (LinkOption[]) Arrays.copyOf(linkOptionArr2, linkOptionArr2.length));
|
||||
Intrinsics.checkNotNullExpressionValue(readAttributes, "readAttributes(this, A::class.java, *options)");
|
||||
fileKey = readAttributes.fileKey();
|
||||
return fileKey;
|
||||
} catch (Throwable unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final boolean createsCycle(PathNode pathNode) {
|
||||
boolean isSameFile;
|
||||
for (PathNode parent = pathNode.getParent(); parent != null; parent = parent.getParent()) {
|
||||
if (parent.getKey() != null && pathNode.getKey() != null) {
|
||||
if (Intrinsics.areEqual(parent.getKey(), pathNode.getKey())) {
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
isSameFile = Files.isSameFile(parent.getPath(), pathNode.getPath());
|
||||
if (isSameFile) {
|
||||
return true;
|
||||
}
|
||||
} catch (IOException | SecurityException unused) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
12
02-Easy5/E5/sources/kotlin/io/path/PathWalkOption.java
Normal file
12
02-Easy5/E5/sources/kotlin/io/path/PathWalkOption.java
Normal file
@ -0,0 +1,12 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: PathWalkOption.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0005\b\u0087\u0001\u0018\u00002\b\u0012\u0004\u0012\u00020\u00000\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002j\u0002\b\u0003j\u0002\b\u0004j\u0002\b\u0005¨\u0006\u0006"}, d2 = {"Lkotlin/io/path/PathWalkOption;", "", "(Ljava/lang/String;I)V", "INCLUDE_DIRECTORIES", "BREADTH_FIRST", "FOLLOW_LINKS", "kotlin-stdlib-jdk7"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public enum PathWalkOption {
|
||||
INCLUDE_DIRECTORIES,
|
||||
BREADTH_FIRST,
|
||||
FOLLOW_LINKS
|
||||
}
|
10
02-Easy5/E5/sources/kotlin/io/path/PathsKt.java
Normal file
10
02-Easy5/E5/sources/kotlin/io/path/PathsKt.java
Normal file
@ -0,0 +1,10 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"kotlin/io/path/PathsKt__PathReadWriteKt", "kotlin/io/path/PathsKt__PathRecursiveFunctionsKt", "kotlin/io/path/PathsKt__PathUtilsKt"}, k = 4, mv = {1, 8, 0}, xi = 49)
|
||||
/* loaded from: classes.dex */
|
||||
public final class PathsKt extends PathsKt__PathUtilsKt {
|
||||
private PathsKt() {
|
||||
}
|
||||
}
|
444
02-Easy5/E5/sources/kotlin/io/path/PathsKt__PathReadWriteKt.java
Normal file
444
02-Easy5/E5/sources/kotlin/io/path/PathsKt__PathReadWriteKt.java
Normal file
File diff suppressed because one or more lines are too long
@ -0,0 +1,582 @@
|
||||
package kotlin.io.path;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.nio.file.CopyOption;
|
||||
import java.nio.file.DirectoryStream;
|
||||
import java.nio.file.FileSystemException;
|
||||
import java.nio.file.FileVisitResult;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.LinkOption;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.SecureDirectoryStream;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.nio.file.attribute.BasicFileAttributes;
|
||||
import java.nio.file.attribute.FileAttributeView;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import kotlin.ExceptionsKt;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.NoWhenBranchMatchedException;
|
||||
import kotlin.Unit;
|
||||
import kotlin.io.CloseableKt;
|
||||
import kotlin.jvm.functions.Function0;
|
||||
import kotlin.jvm.functions.Function3;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.SpreadBuilder;
|
||||
import kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0;
|
||||
|
||||
/* compiled from: PathRecursiveFunctions.kt */
|
||||
@Metadata(d1 = {"\u0000v\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u000b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a$\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00010\u0005H\u0082\b¢\u0006\u0002\b\u0006\u001a\u001d\u0010\u0007\u001a\u00020\u00012\u0006\u0010\b\u001a\u00020\t2\u0006\u0010\u0002\u001a\u00020\u0003H\u0002¢\u0006\u0002\b\n\u001a\u001d\u0010\u000b\u001a\u00020\u00012\u0006\u0010\f\u001a\u00020\t2\u0006\u0010\u0002\u001a\u00020\u0003H\u0002¢\u0006\u0002\b\r\u001a&\u0010\u000e\u001a\u0004\u0018\u0001H\u000f\"\u0004\b\u0000\u0010\u000f2\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u0002H\u000f0\u0005H\u0082\b¢\u0006\u0004\b\u0010\u0010\u0011\u001aw\u0010\u0012\u001a\u00020\t*\u00020\t2\u0006\u0010\u0013\u001a\u00020\t2Q\b\u0002\u0010\u0014\u001aK\u0012\u0013\u0012\u00110\t¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0018\u0012\u0013\u0012\u00110\t¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0013\u0012\u0017\u0012\u00150\u0019j\u0002`\u001a¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u001b\u0012\u0004\u0012\u00020\u001c0\u00152\u0006\u0010\u001d\u001a\u00020\u001e2\u0006\u0010\u001f\u001a\u00020\u001eH\u0007\u001a´\u0001\u0010\u0012\u001a\u00020\t*\u00020\t2\u0006\u0010\u0013\u001a\u00020\t2Q\b\u0002\u0010\u0014\u001aK\u0012\u0013\u0012\u00110\t¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0018\u0012\u0013\u0012\u00110\t¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0013\u0012\u0017\u0012\u00150\u0019j\u0002`\u001a¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u001b\u0012\u0004\u0012\u00020\u001c0\u00152\u0006\u0010\u001d\u001a\u00020\u001e2C\b\u0002\u0010 \u001a=\u0012\u0004\u0012\u00020!\u0012\u0013\u0012\u00110\t¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0018\u0012\u0013\u0012\u00110\t¢\u0006\f\b\u0016\u0012\b\b\u0017\u0012\u0004\b\b(\u0013\u0012\u0004\u0012\u00020\"0\u0015¢\u0006\u0002\b#H\u0007\u001a\f\u0010$\u001a\u00020\u0001*\u00020\tH\u0007\u001a\u001b\u0010%\u001a\f\u0012\b\u0012\u00060\u0019j\u0002`\u001a0&*\u00020\tH\u0002¢\u0006\u0002\b'\u001a'\u0010(\u001a\u00020\u0001*\b\u0012\u0004\u0012\u00020\t0)2\u0006\u0010\u0017\u001a\u00020\t2\u0006\u0010\u0002\u001a\u00020\u0003H\u0002¢\u0006\u0002\b*\u001a'\u0010+\u001a\u00020\u0001*\b\u0012\u0004\u0012\u00020\t0)2\u0006\u0010\u0017\u001a\u00020\t2\u0006\u0010\u0002\u001a\u00020\u0003H\u0002¢\u0006\u0002\b,\u001a5\u0010-\u001a\u00020\u001e*\b\u0012\u0004\u0012\u00020\t0)2\u0006\u0010.\u001a\u00020\t2\u0012\u0010/\u001a\n\u0012\u0006\b\u0001\u0012\u00020100\"\u000201H\u0002¢\u0006\u0004\b2\u00103\u001a\u0011\u00104\u001a\u000205*\u00020\"H\u0003¢\u0006\u0002\b6\u001a\u0011\u00104\u001a\u000205*\u00020\u001cH\u0003¢\u0006\u0002\b6¨\u00067"}, d2 = {"collectIfThrows", "", "collector", "Lkotlin/io/path/ExceptionsCollector;", "function", "Lkotlin/Function0;", "collectIfThrows$PathsKt__PathRecursiveFunctionsKt", "insecureEnterDirectory", "path", "Ljava/nio/file/Path;", "insecureEnterDirectory$PathsKt__PathRecursiveFunctionsKt", "insecureHandleEntry", "entry", "insecureHandleEntry$PathsKt__PathRecursiveFunctionsKt", "tryIgnoreNoSuchFileException", "R", "tryIgnoreNoSuchFileException$PathsKt__PathRecursiveFunctionsKt", "(Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;", "copyToRecursively", TypedValues.AttributesType.S_TARGET, "onError", "Lkotlin/Function3;", "Lkotlin/ParameterName;", "name", "source", "Ljava/lang/Exception;", "Lkotlin/Exception;", "exception", "Lkotlin/io/path/OnErrorResult;", "followLinks", "", "overwrite", "copyAction", "Lkotlin/io/path/CopyActionContext;", "Lkotlin/io/path/CopyActionResult;", "Lkotlin/ExtensionFunctionType;", "deleteRecursively", "deleteRecursivelyImpl", "", "deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt", "enterDirectory", "Ljava/nio/file/SecureDirectoryStream;", "enterDirectory$PathsKt__PathRecursiveFunctionsKt", "handleEntry", "handleEntry$PathsKt__PathRecursiveFunctionsKt", "isDirectory", "entryName", "options", "", "Ljava/nio/file/LinkOption;", "isDirectory$PathsKt__PathRecursiveFunctionsKt", "(Ljava/nio/file/SecureDirectoryStream;Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z", "toFileVisitResult", "Ljava/nio/file/FileVisitResult;", "toFileVisitResult$PathsKt__PathRecursiveFunctionsKt", "kotlin-stdlib-jdk7"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/io/path/PathsKt")
|
||||
/* loaded from: classes.dex */
|
||||
class PathsKt__PathRecursiveFunctionsKt extends PathsKt__PathReadWriteKt {
|
||||
|
||||
/* compiled from: PathRecursiveFunctions.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
public /* synthetic */ class WhenMappings {
|
||||
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
||||
public static final /* synthetic */ int[] $EnumSwitchMapping$1;
|
||||
|
||||
static {
|
||||
int[] iArr = new int[CopyActionResult.values().length];
|
||||
try {
|
||||
iArr[CopyActionResult.CONTINUE.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
iArr[CopyActionResult.TERMINATE.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
iArr[CopyActionResult.SKIP_SUBTREE.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
$EnumSwitchMapping$0 = iArr;
|
||||
int[] iArr2 = new int[OnErrorResult.values().length];
|
||||
try {
|
||||
iArr2[OnErrorResult.TERMINATE.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
iArr2[OnErrorResult.SKIP_SUBTREE.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
$EnumSwitchMapping$1 = iArr2;
|
||||
}
|
||||
}
|
||||
|
||||
public static /* synthetic */ Path copyToRecursively$default(Path path, Path path2, Function3 function3, boolean z, boolean z2, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
function3 = new Function3() { // from class: kotlin.io.path.PathsKt__PathRecursiveFunctionsKt$copyToRecursively$1
|
||||
@Override // kotlin.jvm.functions.Function3
|
||||
public /* bridge */ /* synthetic */ Object invoke(Object obj2, Object obj3, Object obj4) {
|
||||
return invoke(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj2), PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj3), (Exception) obj4);
|
||||
}
|
||||
|
||||
public final Void invoke(Path path3, Path path4, Exception exception) {
|
||||
Intrinsics.checkNotNullParameter(path3, "<anonymous parameter 0>");
|
||||
Intrinsics.checkNotNullParameter(path4, "<anonymous parameter 1>");
|
||||
Intrinsics.checkNotNullParameter(exception, "exception");
|
||||
throw exception;
|
||||
}
|
||||
};
|
||||
}
|
||||
return PathsKt.copyToRecursively(path, path2, (Function3<? super Path, ? super Path, ? super Exception, ? extends OnErrorResult>) function3, z, z2);
|
||||
}
|
||||
|
||||
public static final Path copyToRecursively(Path path, Path target, Function3<? super Path, ? super Path, ? super Exception, ? extends OnErrorResult> onError, final boolean z, boolean z2) {
|
||||
Intrinsics.checkNotNullParameter(path, "<this>");
|
||||
Intrinsics.checkNotNullParameter(target, "target");
|
||||
Intrinsics.checkNotNullParameter(onError, "onError");
|
||||
if (z2) {
|
||||
return PathsKt.copyToRecursively(path, target, onError, z, new Function3<CopyActionContext, Path, Path, CopyActionResult>() { // from class: kotlin.io.path.PathsKt__PathRecursiveFunctionsKt$copyToRecursively$2
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function3
|
||||
public /* bridge */ /* synthetic */ CopyActionResult invoke(CopyActionContext copyActionContext, Path path2, Path path3) {
|
||||
return invoke2(copyActionContext, PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m((Object) path2), PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m((Object) path3));
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final CopyActionResult invoke2(CopyActionContext copyToRecursively, Path src, Path dst) {
|
||||
LinkOption linkOption;
|
||||
boolean isDirectory;
|
||||
boolean isDirectory2;
|
||||
StandardCopyOption standardCopyOption;
|
||||
Path copy;
|
||||
Intrinsics.checkNotNullParameter(copyToRecursively, "$this$copyToRecursively");
|
||||
Intrinsics.checkNotNullParameter(src, "src");
|
||||
Intrinsics.checkNotNullParameter(dst, "dst");
|
||||
LinkOption[] linkOptions = LinkFollowing.INSTANCE.toLinkOptions(z);
|
||||
linkOption = LinkOption.NOFOLLOW_LINKS;
|
||||
isDirectory = Files.isDirectory(dst, (LinkOption[]) Arrays.copyOf(new LinkOption[]{linkOption}, 1));
|
||||
LinkOption[] linkOptionArr = (LinkOption[]) Arrays.copyOf(linkOptions, linkOptions.length);
|
||||
isDirectory2 = Files.isDirectory(src, (LinkOption[]) Arrays.copyOf(linkOptionArr, linkOptionArr.length));
|
||||
if (!isDirectory2 || !isDirectory) {
|
||||
if (isDirectory) {
|
||||
PathsKt.deleteRecursively(dst);
|
||||
}
|
||||
SpreadBuilder spreadBuilder = new SpreadBuilder(2);
|
||||
spreadBuilder.addSpread(linkOptions);
|
||||
standardCopyOption = StandardCopyOption.REPLACE_EXISTING;
|
||||
spreadBuilder.add(standardCopyOption);
|
||||
CopyOption[] copyOptionArr = (CopyOption[]) spreadBuilder.toArray(new CopyOption[spreadBuilder.size()]);
|
||||
copy = Files.copy(src, dst, (CopyOption[]) Arrays.copyOf(copyOptionArr, copyOptionArr.length));
|
||||
Intrinsics.checkNotNullExpressionValue(copy, "copy(this, target, *options)");
|
||||
}
|
||||
return CopyActionResult.CONTINUE;
|
||||
}
|
||||
});
|
||||
}
|
||||
return PathsKt.copyToRecursively$default(path, target, onError, z, (Function3) null, 8, (Object) null);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Path copyToRecursively$default(Path path, Path path2, Function3 function3, final boolean z, Function3 function32, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
function3 = new Function3() { // from class: kotlin.io.path.PathsKt__PathRecursiveFunctionsKt$copyToRecursively$3
|
||||
@Override // kotlin.jvm.functions.Function3
|
||||
public /* bridge */ /* synthetic */ Object invoke(Object obj2, Object obj3, Object obj4) {
|
||||
return invoke(PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj2), PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(obj3), (Exception) obj4);
|
||||
}
|
||||
|
||||
public final Void invoke(Path path3, Path path4, Exception exception) {
|
||||
Intrinsics.checkNotNullParameter(path3, "<anonymous parameter 0>");
|
||||
Intrinsics.checkNotNullParameter(path4, "<anonymous parameter 1>");
|
||||
Intrinsics.checkNotNullParameter(exception, "exception");
|
||||
throw exception;
|
||||
}
|
||||
};
|
||||
}
|
||||
if ((i & 8) != 0) {
|
||||
function32 = new Function3<CopyActionContext, Path, Path, CopyActionResult>() { // from class: kotlin.io.path.PathsKt__PathRecursiveFunctionsKt$copyToRecursively$4
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(3);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function3
|
||||
public /* bridge */ /* synthetic */ CopyActionResult invoke(CopyActionContext copyActionContext, Path path3, Path path4) {
|
||||
return invoke2(copyActionContext, PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m((Object) path3), PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m((Object) path4));
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final CopyActionResult invoke2(CopyActionContext copyActionContext, Path src, Path dst) {
|
||||
Intrinsics.checkNotNullParameter(copyActionContext, "$this$null");
|
||||
Intrinsics.checkNotNullParameter(src, "src");
|
||||
Intrinsics.checkNotNullParameter(dst, "dst");
|
||||
return copyActionContext.copyToIgnoringExistingDirectory(src, dst, z);
|
||||
}
|
||||
};
|
||||
}
|
||||
return PathsKt.copyToRecursively(path, path2, (Function3<? super Path, ? super Path, ? super Exception, ? extends OnErrorResult>) function3, z, (Function3<? super CopyActionContext, ? super Path, ? super Path, ? extends CopyActionResult>) function32);
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:15:0x0062, code lost:
|
||||
|
||||
if (r2 == false) goto L18;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:20:0x0085, code lost:
|
||||
|
||||
if (r0 == false) goto L34;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:21:0x00af, code lost:
|
||||
|
||||
kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:22:0x00c0, code lost:
|
||||
|
||||
throw kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r6.toString(), r7.toString(), "Recursively copying a directory into its subdirectory is prohibited.");
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:29:0x00ac, code lost:
|
||||
|
||||
if (r0 == false) goto L34;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:7:0x0043, code lost:
|
||||
|
||||
if (r1 == false) goto L9;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:14:0x005e */
|
||||
/* JADX WARN: Removed duplicated region for block: B:18:0x0073 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public static final java.nio.file.Path copyToRecursively(final java.nio.file.Path r6, final java.nio.file.Path r7, final kotlin.jvm.functions.Function3<? super java.nio.file.Path, ? super java.nio.file.Path, ? super java.lang.Exception, ? extends kotlin.io.path.OnErrorResult> r8, boolean r9, final kotlin.jvm.functions.Function3<? super kotlin.io.path.CopyActionContext, ? super java.nio.file.Path, ? super java.nio.file.Path, ? extends kotlin.io.path.CopyActionResult> r10) {
|
||||
/*
|
||||
java.lang.String r0 = "<this>"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r6, r0)
|
||||
java.lang.String r0 = "target"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r7, r0)
|
||||
java.lang.String r0 = "onError"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r8, r0)
|
||||
java.lang.String r0 = "copyAction"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r10, r0)
|
||||
kotlin.io.path.LinkFollowing r0 = kotlin.io.path.LinkFollowing.INSTANCE
|
||||
java.nio.file.LinkOption[] r0 = r0.toLinkOptions(r9)
|
||||
int r1 = r0.length
|
||||
java.lang.Object[] r0 = java.util.Arrays.copyOf(r0, r1)
|
||||
java.nio.file.LinkOption[] r0 = (java.nio.file.LinkOption[]) r0
|
||||
int r1 = r0.length
|
||||
java.lang.Object[] r0 = java.util.Arrays.copyOf(r0, r1)
|
||||
java.nio.file.LinkOption[] r0 = (java.nio.file.LinkOption[]) r0
|
||||
boolean r0 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1(r6, r0)
|
||||
if (r0 == 0) goto Ld2
|
||||
r0 = 0
|
||||
java.nio.file.LinkOption[] r1 = new java.nio.file.LinkOption[r0]
|
||||
java.lang.Object[] r1 = java.util.Arrays.copyOf(r1, r0)
|
||||
java.nio.file.LinkOption[] r1 = (java.nio.file.LinkOption[]) r1
|
||||
boolean r1 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1(r6, r1)
|
||||
if (r1 == 0) goto Lc1
|
||||
if (r9 != 0) goto L45
|
||||
boolean r1 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1642m(r6)
|
||||
if (r1 != 0) goto Lc1
|
||||
L45:
|
||||
java.nio.file.LinkOption[] r1 = new java.nio.file.LinkOption[r0]
|
||||
java.lang.Object[] r1 = java.util.Arrays.copyOf(r1, r0)
|
||||
java.nio.file.LinkOption[] r1 = (java.nio.file.LinkOption[]) r1
|
||||
boolean r1 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1(r7, r1)
|
||||
if (r1 == 0) goto L5b
|
||||
boolean r1 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1642m(r7)
|
||||
if (r1 != 0) goto L5b
|
||||
r1 = 1
|
||||
goto L5c
|
||||
L5b:
|
||||
r1 = 0
|
||||
L5c:
|
||||
if (r1 == 0) goto L64
|
||||
boolean r2 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1532m(r6, r7)
|
||||
if (r2 != 0) goto Lc1
|
||||
L64:
|
||||
java.nio.file.FileSystem r2 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1516m(r6)
|
||||
java.nio.file.FileSystem r3 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1516m(r7)
|
||||
boolean r2 = kotlin.jvm.internal.Intrinsics.areEqual(r2, r3)
|
||||
if (r2 != 0) goto L73
|
||||
goto Lc1
|
||||
L73:
|
||||
if (r1 == 0) goto L88
|
||||
java.nio.file.LinkOption[] r1 = new java.nio.file.LinkOption[r0]
|
||||
java.nio.file.Path r1 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r7, r1)
|
||||
java.nio.file.LinkOption[] r0 = new java.nio.file.LinkOption[r0]
|
||||
java.nio.file.Path r0 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r6, r0)
|
||||
boolean r0 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1643m(r1, r0)
|
||||
if (r0 != 0) goto Laf
|
||||
goto Lc1
|
||||
L88:
|
||||
java.nio.file.Path r1 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1(r7)
|
||||
if (r1 == 0) goto Lc1
|
||||
java.nio.file.LinkOption[] r2 = new java.nio.file.LinkOption[r0]
|
||||
java.lang.Object[] r2 = java.util.Arrays.copyOf(r2, r0)
|
||||
java.nio.file.LinkOption[] r2 = (java.nio.file.LinkOption[]) r2
|
||||
boolean r2 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1(r1, r2)
|
||||
if (r2 == 0) goto Lc1
|
||||
java.nio.file.LinkOption[] r2 = new java.nio.file.LinkOption[r0]
|
||||
java.nio.file.Path r1 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r1, r2)
|
||||
java.nio.file.LinkOption[] r0 = new java.nio.file.LinkOption[r0]
|
||||
java.nio.file.Path r0 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r6, r0)
|
||||
boolean r0 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1643m(r1, r0)
|
||||
if (r0 != 0) goto Laf
|
||||
goto Lc1
|
||||
Laf:
|
||||
kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1()
|
||||
java.lang.String r6 = r6.toString()
|
||||
java.lang.String r7 = r7.toString()
|
||||
java.lang.String r8 = "Recursively copying a directory into its subdirectory is prohibited."
|
||||
java.nio.file.FileSystemException r6 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r6, r7, r8)
|
||||
throw r6
|
||||
Lc1:
|
||||
r1 = 0
|
||||
kotlin.io.path.PathsKt__PathRecursiveFunctionsKt$copyToRecursively$5 r0 = new kotlin.io.path.PathsKt__PathRecursiveFunctionsKt$copyToRecursively$5
|
||||
r0.<init>()
|
||||
r3 = r0
|
||||
kotlin.jvm.functions.Function1 r3 = (kotlin.jvm.functions.Function1) r3
|
||||
r4 = 1
|
||||
r5 = 0
|
||||
r0 = r6
|
||||
r2 = r9
|
||||
kotlin.io.path.PathsKt.visitFileTree$default(r0, r1, r2, r3, r4, r5)
|
||||
return r7
|
||||
Ld2:
|
||||
kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1638m()
|
||||
java.lang.String r6 = r6.toString()
|
||||
java.lang.String r7 = r7.toString()
|
||||
java.lang.String r8 = "The source file doesn't exist."
|
||||
java.nio.file.NoSuchFileException r6 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1620m(r6, r7, r8)
|
||||
throw r6
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.path.PathsKt__PathRecursiveFunctionsKt.copyToRecursively(java.nio.file.Path, java.nio.file.Path, kotlin.jvm.functions.Function3, boolean, kotlin.jvm.functions.Function3):java.nio.file.Path");
|
||||
}
|
||||
|
||||
private static final Path copyToRecursively$destination$PathsKt__PathRecursiveFunctionsKt(Path path, Path path2, Path path3) {
|
||||
Path resolve;
|
||||
resolve = path2.resolve(PathsKt.relativeTo(path3, path).toString());
|
||||
Intrinsics.checkNotNullExpressionValue(resolve, "target.resolve(relativePath.pathString)");
|
||||
return resolve;
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final FileVisitResult copyToRecursively$error$PathsKt__PathRecursiveFunctionsKt(Function3<? super Path, ? super Path, ? super Exception, ? extends OnErrorResult> function3, Path path, Path path2, Path path3, Exception exc) {
|
||||
return toFileVisitResult$PathsKt__PathRecursiveFunctionsKt(function3.invoke(path3, copyToRecursively$destination$PathsKt__PathRecursiveFunctionsKt(path, path2, path3), exc));
|
||||
}
|
||||
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final FileVisitResult copyToRecursively$copy$PathsKt__PathRecursiveFunctionsKt(Function3<? super CopyActionContext, ? super Path, ? super Path, ? extends CopyActionResult> function3, Path path, Path path2, Function3<? super Path, ? super Path, ? super Exception, ? extends OnErrorResult> function32, Path path3, BasicFileAttributes basicFileAttributes) {
|
||||
try {
|
||||
return toFileVisitResult$PathsKt__PathRecursiveFunctionsKt(function3.invoke(DefaultCopyActionContext.INSTANCE, path3, copyToRecursively$destination$PathsKt__PathRecursiveFunctionsKt(path, path2, path3)));
|
||||
} catch (Exception e) {
|
||||
return copyToRecursively$error$PathsKt__PathRecursiveFunctionsKt(function32, path, path2, path3, e);
|
||||
}
|
||||
}
|
||||
|
||||
private static final FileVisitResult toFileVisitResult$PathsKt__PathRecursiveFunctionsKt(CopyActionResult copyActionResult) {
|
||||
FileVisitResult fileVisitResult;
|
||||
FileVisitResult fileVisitResult2;
|
||||
FileVisitResult fileVisitResult3;
|
||||
int i = WhenMappings.$EnumSwitchMapping$0[copyActionResult.ordinal()];
|
||||
if (i == 1) {
|
||||
fileVisitResult = FileVisitResult.CONTINUE;
|
||||
return fileVisitResult;
|
||||
}
|
||||
if (i == 2) {
|
||||
fileVisitResult2 = FileVisitResult.TERMINATE;
|
||||
return fileVisitResult2;
|
||||
}
|
||||
if (i != 3) {
|
||||
throw new NoWhenBranchMatchedException();
|
||||
}
|
||||
fileVisitResult3 = FileVisitResult.SKIP_SUBTREE;
|
||||
return fileVisitResult3;
|
||||
}
|
||||
|
||||
private static final FileVisitResult toFileVisitResult$PathsKt__PathRecursiveFunctionsKt(OnErrorResult onErrorResult) {
|
||||
FileVisitResult fileVisitResult;
|
||||
FileVisitResult fileVisitResult2;
|
||||
int i = WhenMappings.$EnumSwitchMapping$1[onErrorResult.ordinal()];
|
||||
if (i == 1) {
|
||||
fileVisitResult = FileVisitResult.TERMINATE;
|
||||
return fileVisitResult;
|
||||
}
|
||||
if (i != 2) {
|
||||
throw new NoWhenBranchMatchedException();
|
||||
}
|
||||
fileVisitResult2 = FileVisitResult.SKIP_SUBTREE;
|
||||
return fileVisitResult2;
|
||||
}
|
||||
|
||||
public static final void deleteRecursively(Path path) {
|
||||
Intrinsics.checkNotNullParameter(path, "<this>");
|
||||
List<Exception> deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt = deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt(path);
|
||||
if (!deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt.isEmpty()) {
|
||||
FileSystemException m1518m = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1518m("Failed to delete one or more files. See suppressed exceptions for details.");
|
||||
Iterator<T> it = deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt.iterator();
|
||||
while (it.hasNext()) {
|
||||
ExceptionsKt.addSuppressed(m1518m, (Exception) it.next());
|
||||
}
|
||||
throw m1518m;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:0x003d, code lost:
|
||||
|
||||
if (r1 != false) goto L22;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private static final java.util.List<java.lang.Exception> deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt(java.nio.file.Path r8) {
|
||||
/*
|
||||
kotlin.io.path.ExceptionsCollector r0 = new kotlin.io.path.ExceptionsCollector
|
||||
r1 = 0
|
||||
r2 = 1
|
||||
r3 = 0
|
||||
r0.<init>(r1, r2, r3)
|
||||
java.nio.file.Path r4 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m$1(r8)
|
||||
if (r4 == 0) goto L47
|
||||
java.nio.file.DirectoryStream r5 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1617m(r4) // Catch: java.lang.Throwable -> L13
|
||||
goto L15
|
||||
L13:
|
||||
r5 = r3
|
||||
L15:
|
||||
if (r5 == 0) goto L47
|
||||
java.io.Closeable r5 = (java.io.Closeable) r5
|
||||
java.nio.file.DirectoryStream r6 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m(r5) // Catch: java.lang.Throwable -> L40
|
||||
boolean r7 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1641m(r6) // Catch: java.lang.Throwable -> L40
|
||||
if (r7 == 0) goto L37
|
||||
r0.setPath(r4) // Catch: java.lang.Throwable -> L40
|
||||
java.nio.file.SecureDirectoryStream r2 = kotlin.streams.jdk8.StreamsKt$$ExternalSyntheticApiModelOutline0.m1623m(r6) // Catch: java.lang.Throwable -> L40
|
||||
java.nio.file.Path r4 = kotlin.io.path.PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1525m(r8) // Catch: java.lang.Throwable -> L40
|
||||
java.lang.String r6 = "this.fileName"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r4, r6) // Catch: java.lang.Throwable -> L40
|
||||
handleEntry$PathsKt__PathRecursiveFunctionsKt(r2, r4, r0) // Catch: java.lang.Throwable -> L40
|
||||
goto L38
|
||||
L37:
|
||||
r1 = 1
|
||||
L38:
|
||||
kotlin.Unit r2 = kotlin.Unit.INSTANCE // Catch: java.lang.Throwable -> L40
|
||||
kotlin.io.CloseableKt.closeFinally(r5, r3)
|
||||
if (r1 == 0) goto L4a
|
||||
goto L47
|
||||
L40:
|
||||
r8 = move-exception
|
||||
throw r8 // Catch: java.lang.Throwable -> L42
|
||||
L42:
|
||||
r0 = move-exception
|
||||
kotlin.io.CloseableKt.closeFinally(r5, r8)
|
||||
throw r0
|
||||
L47:
|
||||
insecureHandleEntry$PathsKt__PathRecursiveFunctionsKt(r8, r0)
|
||||
L4a:
|
||||
java.util.List r8 = r0.getCollectedExceptions()
|
||||
return r8
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.path.PathsKt__PathRecursiveFunctionsKt.deleteRecursivelyImpl$PathsKt__PathRecursiveFunctionsKt(java.nio.file.Path):java.util.List");
|
||||
}
|
||||
|
||||
private static final void collectIfThrows$PathsKt__PathRecursiveFunctionsKt(ExceptionsCollector exceptionsCollector, Function0<Unit> function0) {
|
||||
try {
|
||||
function0.invoke();
|
||||
} catch (Exception e) {
|
||||
exceptionsCollector.collect(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static final <R> R tryIgnoreNoSuchFileException$PathsKt__PathRecursiveFunctionsKt(Function0<? extends R> function0) {
|
||||
try {
|
||||
return function0.invoke();
|
||||
} catch (NoSuchFileException unused) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
private static final void handleEntry$PathsKt__PathRecursiveFunctionsKt(SecureDirectoryStream<Path> secureDirectoryStream, Path path, ExceptionsCollector exceptionsCollector) {
|
||||
LinkOption linkOption;
|
||||
exceptionsCollector.enterEntry(path);
|
||||
try {
|
||||
linkOption = LinkOption.NOFOLLOW_LINKS;
|
||||
try {
|
||||
if (isDirectory$PathsKt__PathRecursiveFunctionsKt(secureDirectoryStream, path, linkOption)) {
|
||||
int totalExceptions = exceptionsCollector.getTotalExceptions();
|
||||
enterDirectory$PathsKt__PathRecursiveFunctionsKt(secureDirectoryStream, path, exceptionsCollector);
|
||||
if (totalExceptions == exceptionsCollector.getTotalExceptions()) {
|
||||
secureDirectoryStream.deleteDirectory(path);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
}
|
||||
} else {
|
||||
secureDirectoryStream.deleteFile(path);
|
||||
Unit unit2 = Unit.INSTANCE;
|
||||
}
|
||||
} catch (NoSuchFileException unused) {
|
||||
}
|
||||
} catch (Exception e) {
|
||||
exceptionsCollector.collect(e);
|
||||
}
|
||||
exceptionsCollector.exitEntry(path);
|
||||
}
|
||||
|
||||
private static final void enterDirectory$PathsKt__PathRecursiveFunctionsKt(SecureDirectoryStream<Path> secureDirectoryStream, Path path, ExceptionsCollector exceptionsCollector) {
|
||||
SecureDirectoryStream secureDirectoryStream2;
|
||||
Iterator it;
|
||||
Path fileName;
|
||||
LinkOption linkOption;
|
||||
try {
|
||||
try {
|
||||
linkOption = LinkOption.NOFOLLOW_LINKS;
|
||||
secureDirectoryStream2 = secureDirectoryStream.newDirectoryStream(path, linkOption);
|
||||
} catch (Exception e) {
|
||||
exceptionsCollector.collect(e);
|
||||
return;
|
||||
}
|
||||
} catch (NoSuchFileException unused) {
|
||||
secureDirectoryStream2 = null;
|
||||
}
|
||||
if (secureDirectoryStream2 == null) {
|
||||
return;
|
||||
}
|
||||
SecureDirectoryStream secureDirectoryStream3 = secureDirectoryStream2;
|
||||
try {
|
||||
SecureDirectoryStream m1623m = StreamsKt$$ExternalSyntheticApiModelOutline0.m1623m((Object) secureDirectoryStream3);
|
||||
it = m1623m.iterator();
|
||||
while (it.hasNext()) {
|
||||
fileName = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(it.next()).getFileName();
|
||||
Intrinsics.checkNotNullExpressionValue(fileName, "entry.fileName");
|
||||
handleEntry$PathsKt__PathRecursiveFunctionsKt(m1623m, fileName, exceptionsCollector);
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
CloseableKt.closeFinally(secureDirectoryStream3, null);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
private static final boolean isDirectory$PathsKt__PathRecursiveFunctionsKt(SecureDirectoryStream<Path> secureDirectoryStream, Path path, LinkOption... linkOptionArr) {
|
||||
Boolean bool;
|
||||
FileAttributeView fileAttributeView;
|
||||
BasicFileAttributes readAttributes;
|
||||
boolean isDirectory;
|
||||
try {
|
||||
fileAttributeView = secureDirectoryStream.getFileAttributeView(path, StreamsKt$$ExternalSyntheticApiModelOutline0.m(), (LinkOption[]) Arrays.copyOf(linkOptionArr, linkOptionArr.length));
|
||||
readAttributes = StreamsKt$$ExternalSyntheticApiModelOutline0.m1625m((Object) fileAttributeView).readAttributes();
|
||||
isDirectory = readAttributes.isDirectory();
|
||||
bool = Boolean.valueOf(isDirectory);
|
||||
} catch (NoSuchFileException unused) {
|
||||
bool = null;
|
||||
}
|
||||
if (bool != null) {
|
||||
return bool.booleanValue();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private static final void insecureHandleEntry$PathsKt__PathRecursiveFunctionsKt(Path path, ExceptionsCollector exceptionsCollector) {
|
||||
LinkOption linkOption;
|
||||
boolean isDirectory;
|
||||
try {
|
||||
linkOption = LinkOption.NOFOLLOW_LINKS;
|
||||
isDirectory = Files.isDirectory(path, (LinkOption[]) Arrays.copyOf(new LinkOption[]{linkOption}, 1));
|
||||
if (isDirectory) {
|
||||
int totalExceptions = exceptionsCollector.getTotalExceptions();
|
||||
insecureEnterDirectory$PathsKt__PathRecursiveFunctionsKt(path, exceptionsCollector);
|
||||
if (totalExceptions == exceptionsCollector.getTotalExceptions()) {
|
||||
Files.deleteIfExists(path);
|
||||
}
|
||||
} else {
|
||||
Files.deleteIfExists(path);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
exceptionsCollector.collect(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static final void insecureEnterDirectory$PathsKt__PathRecursiveFunctionsKt(Path path, ExceptionsCollector exceptionsCollector) {
|
||||
DirectoryStream directoryStream;
|
||||
Iterator it;
|
||||
try {
|
||||
try {
|
||||
directoryStream = Files.newDirectoryStream(path);
|
||||
} catch (Exception e) {
|
||||
exceptionsCollector.collect(e);
|
||||
return;
|
||||
}
|
||||
} catch (NoSuchFileException unused) {
|
||||
directoryStream = null;
|
||||
}
|
||||
if (directoryStream == null) {
|
||||
return;
|
||||
}
|
||||
DirectoryStream directoryStream2 = directoryStream;
|
||||
try {
|
||||
it = StreamsKt$$ExternalSyntheticApiModelOutline0.m((Object) directoryStream2).iterator();
|
||||
while (it.hasNext()) {
|
||||
Path entry = PathTreeWalk$$ExternalSyntheticApiModelOutline0.m1524m(it.next());
|
||||
Intrinsics.checkNotNullExpressionValue(entry, "entry");
|
||||
insecureHandleEntry$PathsKt__PathRecursiveFunctionsKt(entry, exceptionsCollector);
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
CloseableKt.closeFinally(directoryStream2, null);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
822
02-Easy5/E5/sources/kotlin/io/path/PathsKt__PathUtilsKt.java
Normal file
822
02-Easy5/E5/sources/kotlin/io/path/PathsKt__PathUtilsKt.java
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user