.class public final Lkotlin/io/path/PathTreeWalk; .super Ljava/lang/Object; .source "PathTreeWalk.kt" # interfaces .implements Lkotlin/sequences/Sequence; # annotations .annotation system Ldalvik/annotation/Signature; value = { "Ljava/lang/Object;", "Lkotlin/sequences/Sequence<", "Ljava/nio/file/Path;", ">;" } .end annotation .annotation runtime Lkotlin/Metadata; d1 = { "\u0000V\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0011\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u000b\n\u0002\u0008\u0006\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0010(\n\u0002\u0008\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\u0008\u0002\u0008\u0001\u0018\u00002\u0008\u0012\u0004\u0012\u00020\u00020\u0001B\u001d\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\u000e\u0010\u0004\u001a\n\u0012\u0006\u0008\u0001\u0012\u00020\u00060\u0005\u00a2\u0006\u0002\u0010\u0007J\u000e\u0010\u0014\u001a\u0008\u0012\u0004\u0012\u00020\u00020\u0015H\u0002J\u000e\u0010\u0016\u001a\u0008\u0012\u0004\u0012\u00020\u00020\u0015H\u0002J\u000f\u0010\u0017\u001a\u0008\u0012\u0004\u0012\u00020\u00020\u0015H\u0096\u0002JB\u0010\u0018\u001a\u00020\u0019*\u0008\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\u0008\u0012\u0004\u0012\u00020\u001c0!\u0012\u0004\u0012\u00020\u00190 H\u0082H\u00a2\u0006\u0002\u0010\"R\u0014\u0010\u0008\u001a\u00020\t8BX\u0082\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\n\u0010\u000bR\u0014\u0010\u000c\u001a\u00020\t8BX\u0082\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\r\u0010\u000bR\u0014\u0010\u000e\u001a\u00020\t8BX\u0082\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\u000e\u0010\u000bR\u001a\u0010\u000f\u001a\u0008\u0012\u0004\u0012\u00020\u00100\u00058BX\u0082\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\u0011\u0010\u0012R\u0018\u0010\u0004\u001a\n\u0012\u0006\u0008\u0001\u0012\u00020\u00060\u0005X\u0082\u0004\u00a2\u0006\u0004\n\u0002\u0010\u0013R\u000e\u0010\u0003\u001a\u00020\u0002X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\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 = 0x1 mv = { 0x1, 0x9, 0x0 } xi = 0x30 .end annotation # instance fields .field private final options:[Lkotlin/io/path/PathWalkOption; .field private final start:Ljava/nio/file/Path; # direct methods .method public constructor (Ljava/nio/file/Path;[Lkotlin/io/path/PathWalkOption;)V .locals 1 const-string v0, "start" invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V const-string v0, "options" invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V .line 20 invoke-direct {p0}, Ljava/lang/Object;->()V iput-object p1, p0, Lkotlin/io/path/PathTreeWalk;->start:Ljava/nio/file/Path; iput-object p2, p0, Lkotlin/io/path/PathTreeWalk;->options:[Lkotlin/io/path/PathWalkOption; return-void .end method .method public static final synthetic access$getFollowLinks(Lkotlin/io/path/PathTreeWalk;)Z .locals 0 .line 20 invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->getFollowLinks()Z move-result p0 return p0 .end method .method public static final synthetic access$getIncludeDirectories(Lkotlin/io/path/PathTreeWalk;)Z .locals 0 .line 20 invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->getIncludeDirectories()Z move-result p0 return p0 .end method .method public static final synthetic access$getLinkOptions(Lkotlin/io/path/PathTreeWalk;)[Ljava/nio/file/LinkOption; .locals 0 .line 20 invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->getLinkOptions()[Ljava/nio/file/LinkOption; move-result-object p0 return-object p0 .end method .method public static final synthetic access$getStart$p(Lkotlin/io/path/PathTreeWalk;)Ljava/nio/file/Path; .locals 0 .line 20 iget-object p0, p0, Lkotlin/io/path/PathTreeWalk;->start:Ljava/nio/file/Path; return-object p0 .end method .method private final bfsIterator()Ljava/util/Iterator; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/Iterator<", "Ljava/nio/file/Path;", ">;" } .end annotation .line 89 new-instance v0, Lkotlin/io/path/PathTreeWalk$bfsIterator$1; const/4 v1, 0x0 invoke-direct {v0, p0, v1}, Lkotlin/io/path/PathTreeWalk$bfsIterator$1;->(Lkotlin/io/path/PathTreeWalk;Lkotlin/coroutines/Continuation;)V check-cast v0, Lkotlin/jvm/functions/Function2; invoke-static {v0}, Lkotlin/sequences/SequencesKt;->iterator(Lkotlin/jvm/functions/Function2;)Ljava/util/Iterator; move-result-object p0 return-object p0 .end method .method private final dfsIterator()Ljava/util/Iterator; .locals 2 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/Iterator<", "Ljava/nio/file/Path;", ">;" } .end annotation .line 61 new-instance v0, Lkotlin/io/path/PathTreeWalk$dfsIterator$1; const/4 v1, 0x0 invoke-direct {v0, p0, v1}, Lkotlin/io/path/PathTreeWalk$dfsIterator$1;->(Lkotlin/io/path/PathTreeWalk;Lkotlin/coroutines/Continuation;)V check-cast v0, Lkotlin/jvm/functions/Function2; invoke-static {v0}, Lkotlin/sequences/SequencesKt;->iterator(Lkotlin/jvm/functions/Function2;)Ljava/util/Iterator; move-result-object p0 return-object p0 .end method .method private final getFollowLinks()Z .locals 1 iget-object p0, p0, Lkotlin/io/path/PathTreeWalk;->options:[Lkotlin/io/path/PathWalkOption; .line 27 sget-object v0, Lkotlin/io/path/PathWalkOption;->FOLLOW_LINKS:Lkotlin/io/path/PathWalkOption; invoke-static {p0, v0}, Lkotlin/collections/ArraysKt;->contains([Ljava/lang/Object;Ljava/lang/Object;)Z move-result p0 return p0 .end method .method private final getIncludeDirectories()Z .locals 1 iget-object p0, p0, Lkotlin/io/path/PathTreeWalk;->options:[Lkotlin/io/path/PathWalkOption; .line 33 sget-object v0, Lkotlin/io/path/PathWalkOption;->INCLUDE_DIRECTORIES:Lkotlin/io/path/PathWalkOption; invoke-static {p0, v0}, Lkotlin/collections/ArraysKt;->contains([Ljava/lang/Object;Ljava/lang/Object;)Z move-result p0 return p0 .end method .method private final getLinkOptions()[Ljava/nio/file/LinkOption; .locals 1 .line 30 sget-object v0, Lkotlin/io/path/LinkFollowing;->INSTANCE:Lkotlin/io/path/LinkFollowing; invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->getFollowLinks()Z move-result p0 invoke-virtual {v0, p0}, Lkotlin/io/path/LinkFollowing;->toLinkOptions(Z)[Ljava/nio/file/LinkOption; move-result-object p0 return-object p0 .end method .method private final isBFS()Z .locals 1 iget-object p0, p0, Lkotlin/io/path/PathTreeWalk;->options:[Lkotlin/io/path/PathWalkOption; .line 36 sget-object v0, Lkotlin/io/path/PathWalkOption;->BREADTH_FIRST:Lkotlin/io/path/PathWalkOption; invoke-static {p0, v0}, Lkotlin/collections/ArraysKt;->contains([Ljava/lang/Object;Ljava/lang/Object;)Z move-result p0 return p0 .end method .method private final yieldIfNeeded(Lkotlin/sequences/SequenceScope;Lkotlin/io/path/PathNode;Lkotlin/io/path/DirectoryEntriesReader;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; .locals 4 .annotation system Ldalvik/annotation/Signature; value = { "(", "Lkotlin/sequences/SequenceScope<", "-", "Ljava/nio/file/Path;", ">;", "Lkotlin/io/path/PathNode;", "Lkotlin/io/path/DirectoryEntriesReader;", "Lkotlin/jvm/functions/Function1<", "-", "Ljava/util/List<", "Lkotlin/io/path/PathNode;", ">;", "Lkotlin/Unit;", ">;", "Lkotlin/coroutines/Continuation<", "-", "Lkotlin/Unit;", ">;)", "Ljava/lang/Object;" } .end annotation .line 45 invoke-virtual {p2}, Lkotlin/io/path/PathNode;->getPath()Ljava/nio/file/Path; move-result-object v0 .line 46 invoke-static {p0}, Lkotlin/io/path/PathTreeWalk;->access$getLinkOptions(Lkotlin/io/path/PathTreeWalk;)[Ljava/nio/file/LinkOption; move-result-object v1 array-length v2, v1 invoke-static {v1, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object v1 check-cast v1, [Ljava/nio/file/LinkOption; array-length v2, v1 invoke-static {v1, v2}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object v1 check-cast v1, [Ljava/nio/file/LinkOption; invoke-static {v0, v1}, Ljava/nio/file/Files;->isDirectory(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z move-result v1 const/4 v2, 0x0 const/4 v3, 0x1 if-eqz v1, :cond_2 .line 47 invoke-static {p2}, Lkotlin/io/path/PathTreeWalkKt;->access$createsCycle(Lkotlin/io/path/PathNode;)Z move-result v1 if-nez v1, :cond_1 .line 50 invoke-static {p0}, Lkotlin/io/path/PathTreeWalk;->access$getIncludeDirectories(Lkotlin/io/path/PathTreeWalk;)Z move-result v1 if-eqz v1, :cond_0 .line 51 invoke-static {v2}, Lkotlin/jvm/internal/InlineMarker;->mark(I)V invoke-virtual {p1, v0, p5}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->mark(I)V .line 53 :cond_0 invoke-static {p0}, Lkotlin/io/path/PathTreeWalk;->access$getLinkOptions(Lkotlin/io/path/PathTreeWalk;)[Ljava/nio/file/LinkOption; move-result-object p0 array-length p1, p0 invoke-static {p0, p1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object p0 check-cast p0, [Ljava/nio/file/LinkOption; array-length p1, p0 invoke-static {p0, p1}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object p0 check-cast p0, [Ljava/nio/file/LinkOption; invoke-static {v0, p0}, Ljava/nio/file/Files;->isDirectory(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z move-result p0 if-eqz p0, :cond_3 .line 54 invoke-virtual {p3, p2}, Lkotlin/io/path/DirectoryEntriesReader;->readEntries(Lkotlin/io/path/PathNode;)Ljava/util/List; move-result-object p0 invoke-interface {p4, p0}, Lkotlin/jvm/functions/Function1;->invoke(Ljava/lang/Object;)Ljava/lang/Object; goto :goto_0 .line 48 :cond_1 new-instance p0, Ljava/nio/file/FileSystemLoopException; invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String; move-result-object p1 invoke-direct {p0, p1}, Ljava/nio/file/FileSystemLoopException;->(Ljava/lang/String;)V throw p0 :cond_2 new-array p0, v3, [Ljava/nio/file/LinkOption; .line 56 sget-object p2, Ljava/nio/file/LinkOption;->NOFOLLOW_LINKS:Ljava/nio/file/LinkOption; aput-object p2, p0, v2 invoke-static {p0, v3}, Ljava/util/Arrays;->copyOf([Ljava/lang/Object;I)[Ljava/lang/Object; move-result-object p0 check-cast p0, [Ljava/nio/file/LinkOption; invoke-static {v0, p0}, Ljava/nio/file/Files;->exists(Ljava/nio/file/Path;[Ljava/nio/file/LinkOption;)Z move-result p0 if-eqz p0, :cond_3 .line 57 invoke-static {v2}, Lkotlin/jvm/internal/InlineMarker;->mark(I)V invoke-virtual {p1, v0, p5}, Lkotlin/sequences/SequenceScope;->yield(Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; invoke-static {v3}, Lkotlin/jvm/internal/InlineMarker;->mark(I)V sget-object p0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; return-object p0 .line 59 :cond_3 :goto_0 sget-object p0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit; return-object p0 .end method # virtual methods .method public iterator()Ljava/util/Iterator; .locals 1 .annotation system Ldalvik/annotation/Signature; value = { "()", "Ljava/util/Iterator<", "Ljava/nio/file/Path;", ">;" } .end annotation .line 38 invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->isBFS()Z move-result v0 if-eqz v0, :cond_0 invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->bfsIterator()Ljava/util/Iterator; move-result-object p0 goto :goto_0 :cond_0 invoke-direct {p0}, Lkotlin/io/path/PathTreeWalk;->dfsIterator()Ljava/util/Iterator; move-result-object p0 :goto_0 return-object p0 .end method