ADD week 5
This commit is contained in:
21
02-Easy5/E5/sources/kotlin/io/AccessDeniedException.java
Normal file
21
02-Easy5/E5/sources/kotlin/io/AccessDeniedException.java
Normal file
@ -0,0 +1,21 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Exceptions.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\n\b\u0002\u0010\u0004\u001a\u0004\u0018\u00010\u0003\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"Lkotlin/io/AccessDeniedException;", "Lkotlin/io/FileSystemException;", "file", "Ljava/io/File;", "other", "reason", "", "(Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class AccessDeniedException extends FileSystemException {
|
||||
public /* synthetic */ AccessDeniedException(File file, File file2, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(file, (i & 2) != 0 ? null : file2, (i & 4) != 0 ? null : str);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public AccessDeniedException(File file, File file2, String str) {
|
||||
super(file, file2, str);
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
}
|
||||
}
|
256
02-Easy5/E5/sources/kotlin/io/ByteStreamsKt.java
Normal file
256
02-Easy5/E5/sources/kotlin/io/ByteStreamsKt.java
Normal file
@ -0,0 +1,256 @@
|
||||
package kotlin.io;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.DeprecatedSinceKotlin;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.ReplaceWith;
|
||||
import kotlin.collections.ByteIterator;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.Charsets;
|
||||
|
||||
/* compiled from: IOStreams.kt */
|
||||
@Metadata(d1 = {"\u0000Z\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\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\u000e\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0017\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u0004H\u0087\b\u001a\u0017\u0010\u0000\u001a\u00020\u0005*\u00020\u00062\b\b\u0002\u0010\u0003\u001a\u00020\u0004H\u0087\b\u001a\u0017\u0010\u0007\u001a\u00020\b*\u00020\u00022\b\b\u0002\u0010\t\u001a\u00020\nH\u0087\b\u001a\u0017\u0010\u000b\u001a\u00020\f*\u00020\u00062\b\b\u0002\u0010\t\u001a\u00020\nH\u0087\b\u001a\u0017\u0010\r\u001a\u00020\u000e*\u00020\u000f2\b\b\u0002\u0010\t\u001a\u00020\nH\u0087\b\u001a\u001c\u0010\u0010\u001a\u00020\u0011*\u00020\u00022\u0006\u0010\u0012\u001a\u00020\u00062\b\b\u0002\u0010\u0003\u001a\u00020\u0004\u001a\r\u0010\u0013\u001a\u00020\u000e*\u00020\u0014H\u0087\b\u001a\u001d\u0010\u0013\u001a\u00020\u000e*\u00020\u00142\u0006\u0010\u0015\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00020\u0004H\u0087\b\u001a\r\u0010\u0017\u001a\u00020\u0018*\u00020\u0001H\u0086\u0002\u001a\f\u0010\u0019\u001a\u00020\u0014*\u00020\u0002H\u0007\u001a\u0016\u0010\u0019\u001a\u00020\u0014*\u00020\u00022\b\b\u0002\u0010\u001a\u001a\u00020\u0004H\u0007\u001a\u0017\u0010\u001b\u001a\u00020\u001c*\u00020\u00022\b\b\u0002\u0010\t\u001a\u00020\nH\u0087\b\u001a\u0017\u0010\u001d\u001a\u00020\u001e*\u00020\u00062\b\b\u0002\u0010\t\u001a\u00020\nH\u0087\b¨\u0006\u001f"}, d2 = {"buffered", "Ljava/io/BufferedInputStream;", "Ljava/io/InputStream;", "bufferSize", "", "Ljava/io/BufferedOutputStream;", "Ljava/io/OutputStream;", "bufferedReader", "Ljava/io/BufferedReader;", "charset", "Ljava/nio/charset/Charset;", "bufferedWriter", "Ljava/io/BufferedWriter;", "byteInputStream", "Ljava/io/ByteArrayInputStream;", "", "copyTo", "", "out", "inputStream", "", TypedValues.CycleType.S_WAVE_OFFSET, "length", "iterator", "Lkotlin/collections/ByteIterator;", "readBytes", "estimatedSize", "reader", "Ljava/io/InputStreamReader;", "writer", "Ljava/io/OutputStreamWriter;", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ByteStreamsKt {
|
||||
public static final ByteIterator iterator(final BufferedInputStream bufferedInputStream) {
|
||||
Intrinsics.checkNotNullParameter(bufferedInputStream, "<this>");
|
||||
return new ByteIterator() { // from class: kotlin.io.ByteStreamsKt$iterator$1
|
||||
private boolean finished;
|
||||
private int nextByte = -1;
|
||||
private boolean nextPrepared;
|
||||
|
||||
public final boolean getFinished() {
|
||||
return this.finished;
|
||||
}
|
||||
|
||||
public final int getNextByte() {
|
||||
return this.nextByte;
|
||||
}
|
||||
|
||||
public final boolean getNextPrepared() {
|
||||
return this.nextPrepared;
|
||||
}
|
||||
|
||||
public final void setFinished(boolean z) {
|
||||
this.finished = z;
|
||||
}
|
||||
|
||||
public final void setNextByte(int i) {
|
||||
this.nextByte = i;
|
||||
}
|
||||
|
||||
public final void setNextPrepared(boolean z) {
|
||||
this.nextPrepared = z;
|
||||
}
|
||||
|
||||
private final void prepareNext() {
|
||||
if (this.nextPrepared || this.finished) {
|
||||
return;
|
||||
}
|
||||
int read = bufferedInputStream.read();
|
||||
this.nextByte = read;
|
||||
this.nextPrepared = true;
|
||||
this.finished = read == -1;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
prepareNext();
|
||||
return !this.finished;
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.ByteIterator
|
||||
public byte nextByte() {
|
||||
prepareNext();
|
||||
if (this.finished) {
|
||||
throw new NoSuchElementException("Input stream is over.");
|
||||
}
|
||||
byte b = (byte) this.nextByte;
|
||||
this.nextPrepared = false;
|
||||
return b;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static final ByteArrayInputStream byteInputStream(String str, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(str, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
byte[] bytes = str.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
|
||||
return new ByteArrayInputStream(bytes);
|
||||
}
|
||||
|
||||
static /* synthetic */ ByteArrayInputStream byteInputStream$default(String str, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(str, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
byte[] bytes = str.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
|
||||
return new ByteArrayInputStream(bytes);
|
||||
}
|
||||
|
||||
private static final ByteArrayInputStream inputStream(byte[] bArr) {
|
||||
Intrinsics.checkNotNullParameter(bArr, "<this>");
|
||||
return new ByteArrayInputStream(bArr);
|
||||
}
|
||||
|
||||
private static final ByteArrayInputStream inputStream(byte[] bArr, int i, int i2) {
|
||||
Intrinsics.checkNotNullParameter(bArr, "<this>");
|
||||
return new ByteArrayInputStream(bArr, i, i2);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedInputStream buffered$default(InputStream inputStream, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream, i);
|
||||
}
|
||||
|
||||
private static final BufferedInputStream buffered(InputStream inputStream, int i) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
return inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream : new BufferedInputStream(inputStream, i);
|
||||
}
|
||||
|
||||
private static final InputStreamReader reader(InputStream inputStream, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new InputStreamReader(inputStream, charset);
|
||||
}
|
||||
|
||||
static /* synthetic */ InputStreamReader reader$default(InputStream inputStream, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new InputStreamReader(inputStream, charset);
|
||||
}
|
||||
|
||||
private static final BufferedReader bufferedReader(InputStream inputStream, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Reader inputStreamReader = new InputStreamReader(inputStream, charset);
|
||||
return inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, 8192);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedReader bufferedReader$default(InputStream inputStream, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Reader inputStreamReader = new InputStreamReader(inputStream, charset);
|
||||
return inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, 8192);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedOutputStream buffered$default(OutputStream outputStream, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
return outputStream instanceof BufferedOutputStream ? (BufferedOutputStream) outputStream : new BufferedOutputStream(outputStream, i);
|
||||
}
|
||||
|
||||
private static final BufferedOutputStream buffered(OutputStream outputStream, int i) {
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
return outputStream instanceof BufferedOutputStream ? (BufferedOutputStream) outputStream : new BufferedOutputStream(outputStream, i);
|
||||
}
|
||||
|
||||
private static final OutputStreamWriter writer(OutputStream outputStream, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new OutputStreamWriter(outputStream, charset);
|
||||
}
|
||||
|
||||
static /* synthetic */ OutputStreamWriter writer$default(OutputStream outputStream, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new OutputStreamWriter(outputStream, charset);
|
||||
}
|
||||
|
||||
private static final BufferedWriter bufferedWriter(OutputStream outputStream, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Writer outputStreamWriter = new OutputStreamWriter(outputStream, charset);
|
||||
return outputStreamWriter instanceof BufferedWriter ? (BufferedWriter) outputStreamWriter : new BufferedWriter(outputStreamWriter, 8192);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedWriter bufferedWriter$default(OutputStream outputStream, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Writer outputStreamWriter = new OutputStreamWriter(outputStream, charset);
|
||||
return outputStreamWriter instanceof BufferedWriter ? (BufferedWriter) outputStreamWriter : new BufferedWriter(outputStreamWriter, 8192);
|
||||
}
|
||||
|
||||
public static /* synthetic */ long copyTo$default(InputStream inputStream, OutputStream outputStream, int i, int i2, Object obj) {
|
||||
if ((i2 & 2) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
return copyTo(inputStream, outputStream, i);
|
||||
}
|
||||
|
||||
public static final long copyTo(InputStream inputStream, OutputStream out, int i) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(out, "out");
|
||||
byte[] bArr = new byte[i];
|
||||
int read = inputStream.read(bArr);
|
||||
long j = 0;
|
||||
while (read >= 0) {
|
||||
out.write(bArr, 0, read);
|
||||
j += read;
|
||||
read = inputStream.read(bArr);
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
public static /* synthetic */ byte[] readBytes$default(InputStream inputStream, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
return readBytes(inputStream, i);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Use readBytes() overload without estimatedSize parameter", replaceWith = @ReplaceWith(expression = "readBytes()", imports = {}))
|
||||
@DeprecatedSinceKotlin(errorSince = "1.5", warningSince = "1.3")
|
||||
public static final byte[] readBytes(InputStream inputStream, int i) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(Math.max(i, inputStream.available()));
|
||||
copyTo$default(inputStream, byteArrayOutputStream, 0, 2, null);
|
||||
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
||||
Intrinsics.checkNotNullExpressionValue(byteArray, "buffer.toByteArray()");
|
||||
return byteArray;
|
||||
}
|
||||
|
||||
public static final byte[] readBytes(InputStream inputStream) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(Math.max(8192, inputStream.available()));
|
||||
copyTo$default(inputStream, byteArrayOutputStream, 0, 2, null);
|
||||
byte[] byteArray = byteArrayOutputStream.toByteArray();
|
||||
Intrinsics.checkNotNullExpressionValue(byteArray, "buffer.toByteArray()");
|
||||
return byteArray;
|
||||
}
|
||||
}
|
58
02-Easy5/E5/sources/kotlin/io/CloseableKt.java
Normal file
58
02-Easy5/E5/sources/kotlin/io/CloseableKt.java
Normal file
@ -0,0 +1,58 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.Closeable;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.internal.PlatformImplementationsKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Closeable.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0003\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0018\u0010\u0000\u001a\u00020\u0001*\u0004\u0018\u00010\u00022\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004H\u0001\u001aH\u0010\u0005\u001a\u0002H\u0006\"\n\b\u0000\u0010\u0007*\u0004\u0018\u00010\u0002\"\u0004\b\u0001\u0010\u0006*\u0002H\u00072\u0012\u0010\b\u001a\u000e\u0012\u0004\u0012\u0002H\u0007\u0012\u0004\u0012\u0002H\u00060\tH\u0087\bø\u0001\u0000\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0001¢\u0006\u0002\u0010\n\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u000b"}, d2 = {"closeFinally", "", "Ljava/io/Closeable;", "cause", "", "use", "R", "T", "block", "Lkotlin/Function1;", "(Ljava/io/Closeable;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class CloseableKt {
|
||||
private static final <T extends Closeable, R> R use(T t, Function1<? super T, ? extends R> block) {
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
try {
|
||||
R invoke = block.invoke(t);
|
||||
InlineMarker.finallyStart(1);
|
||||
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
|
||||
closeFinally(t, null);
|
||||
} else if (t != null) {
|
||||
t.close();
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} catch (Throwable th2) {
|
||||
InlineMarker.finallyStart(1);
|
||||
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
|
||||
closeFinally(t, th);
|
||||
} else if (t != null) {
|
||||
try {
|
||||
t.close();
|
||||
} catch (Throwable unused) {
|
||||
}
|
||||
}
|
||||
InlineMarker.finallyEnd(1);
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final void closeFinally(Closeable closeable, Throwable th) {
|
||||
if (closeable != null) {
|
||||
if (th == null) {
|
||||
closeable.close();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
closeable.close();
|
||||
} catch (Throwable th2) {
|
||||
kotlin.ExceptionsKt.addSuppressed(th, th2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
118
02-Easy5/E5/sources/kotlin/io/ConsoleKt.java
Normal file
118
02-Easy5/E5/sources/kotlin/io/ConsoleKt.java
Normal file
@ -0,0 +1,118 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.nio.charset.Charset;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Console.kt */
|
||||
@Metadata(d1 = {"\u0000<\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u0000\n\u0002\u0010\u000b\n\u0002\u0010\u0005\n\u0002\u0010\f\n\u0002\u0010\u0019\n\u0002\u0010\u0006\n\u0002\u0010\u0007\n\u0002\u0010\b\n\u0002\u0010\t\n\u0002\u0010\n\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0003\u001a\u0013\u0010\u0000\u001a\u00020\u00012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003H\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0004H\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0005H\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0006H\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0007H\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\bH\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\tH\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\nH\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u000bH\u0087\b\u001a\u0011\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\fH\u0087\b\u001a\t\u0010\r\u001a\u00020\u0001H\u0087\b\u001a\u0013\u0010\r\u001a\u00020\u00012\b\u0010\u0002\u001a\u0004\u0018\u00010\u0003H\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0004H\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0005H\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0006H\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0007H\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\bH\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\tH\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\nH\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u000bH\u0087\b\u001a\u0011\u0010\r\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\fH\u0087\b\u001a\b\u0010\u000e\u001a\u0004\u0018\u00010\u000f\u001a\b\u0010\u0010\u001a\u00020\u000fH\u0007\u001a\n\u0010\u0011\u001a\u0004\u0018\u00010\u000fH\u0007¨\u0006\u0012"}, d2 = {"print", "", "message", "", "", "", "", "", "", "", "", "", "", "println", "readLine", "", "readln", "readlnOrNull", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ConsoleKt {
|
||||
private static final void print(Object obj) {
|
||||
System.out.print(obj);
|
||||
}
|
||||
|
||||
private static final void print(int i) {
|
||||
System.out.print(i);
|
||||
}
|
||||
|
||||
private static final void print(long j) {
|
||||
System.out.print(j);
|
||||
}
|
||||
|
||||
private static final void print(byte b) {
|
||||
System.out.print(Byte.valueOf(b));
|
||||
}
|
||||
|
||||
private static final void print(short s) {
|
||||
System.out.print(Short.valueOf(s));
|
||||
}
|
||||
|
||||
private static final void print(char c) {
|
||||
System.out.print(c);
|
||||
}
|
||||
|
||||
private static final void print(boolean z) {
|
||||
System.out.print(z);
|
||||
}
|
||||
|
||||
private static final void print(float f) {
|
||||
System.out.print(f);
|
||||
}
|
||||
|
||||
private static final void print(double d) {
|
||||
System.out.print(d);
|
||||
}
|
||||
|
||||
private static final void print(char[] message) {
|
||||
Intrinsics.checkNotNullParameter(message, "message");
|
||||
System.out.print(message);
|
||||
}
|
||||
|
||||
private static final void println(Object obj) {
|
||||
System.out.println(obj);
|
||||
}
|
||||
|
||||
private static final void println(int i) {
|
||||
System.out.println(i);
|
||||
}
|
||||
|
||||
private static final void println(long j) {
|
||||
System.out.println(j);
|
||||
}
|
||||
|
||||
private static final void println(byte b) {
|
||||
System.out.println(Byte.valueOf(b));
|
||||
}
|
||||
|
||||
private static final void println(short s) {
|
||||
System.out.println(Short.valueOf(s));
|
||||
}
|
||||
|
||||
private static final void println(char c) {
|
||||
System.out.println(c);
|
||||
}
|
||||
|
||||
private static final void println(boolean z) {
|
||||
System.out.println(z);
|
||||
}
|
||||
|
||||
private static final void println(float f) {
|
||||
System.out.println(f);
|
||||
}
|
||||
|
||||
private static final void println(double d) {
|
||||
System.out.println(d);
|
||||
}
|
||||
|
||||
private static final void println(char[] message) {
|
||||
Intrinsics.checkNotNullParameter(message, "message");
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
private static final void println() {
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
public static final String readln() {
|
||||
String readlnOrNull = readlnOrNull();
|
||||
if (readlnOrNull != null) {
|
||||
return readlnOrNull;
|
||||
}
|
||||
throw new ReadAfterEOFException("EOF has already been reached");
|
||||
}
|
||||
|
||||
public static final String readlnOrNull() {
|
||||
return readLine();
|
||||
}
|
||||
|
||||
public static final String readLine() {
|
||||
LineReader lineReader = LineReader.INSTANCE;
|
||||
InputStream inputStream = System.in;
|
||||
Intrinsics.checkNotNullExpressionValue(inputStream, "`in`");
|
||||
Charset defaultCharset = Charset.defaultCharset();
|
||||
Intrinsics.checkNotNullExpressionValue(defaultCharset, "defaultCharset()");
|
||||
return lineReader.readLine(inputStream, defaultCharset);
|
||||
}
|
||||
}
|
12
02-Easy5/E5/sources/kotlin/io/ConstantsKt.java
Normal file
12
02-Easy5/E5/sources/kotlin/io/ConstantsKt.java
Normal file
@ -0,0 +1,12 @@
|
||||
package kotlin.io;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Constants.kt */
|
||||
@Metadata(d1 = {"\u0000\n\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0086T¢\u0006\u0002\n\u0000\"\u000e\u0010\u0003\u001a\u00020\u0001X\u0080T¢\u0006\u0002\n\u0000¨\u0006\u0004"}, d2 = {"DEFAULT_BLOCK_SIZE", "", "DEFAULT_BUFFER_SIZE", "MINIMUM_BLOCK_SIZE", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ConstantsKt {
|
||||
public static final int DEFAULT_BLOCK_SIZE = 4096;
|
||||
public static final int DEFAULT_BUFFER_SIZE = 8192;
|
||||
public static final int MINIMUM_BLOCK_SIZE = 512;
|
||||
}
|
24
02-Easy5/E5/sources/kotlin/io/ExceptionsKt.java
Normal file
24
02-Easy5/E5/sources/kotlin/io/ExceptionsKt.java
Normal file
@ -0,0 +1,24 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Exceptions.kt */
|
||||
@Metadata(d1 = {"\u0000\u0010\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a$\u0010\u0000\u001a\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u00032\b\u0010\u0004\u001a\u0004\u0018\u00010\u00032\b\u0010\u0005\u001a\u0004\u0018\u00010\u0001H\u0002¨\u0006\u0006"}, d2 = {"constructMessage", "", "file", "Ljava/io/File;", "other", "reason", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ExceptionsKt {
|
||||
/* JADX INFO: Access modifiers changed from: private */
|
||||
public static final String constructMessage(File file, File file2, String str) {
|
||||
StringBuilder sb = new StringBuilder(file.toString());
|
||||
if (file2 != null) {
|
||||
sb.append(" -> " + file2);
|
||||
}
|
||||
if (str != null) {
|
||||
sb.append(": " + str);
|
||||
}
|
||||
String sb2 = sb.toString();
|
||||
Intrinsics.checkNotNullExpressionValue(sb2, "sb.toString()");
|
||||
return sb2;
|
||||
}
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: FileReadWrite.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0002\b\u0003\b\u0002\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004R\u0011\u0010\u0005\u001a\u00020\u00068F¢\u0006\u0006\u001a\u0004\b\u0007\u0010\b¨\u0006\t"}, d2 = {"Lkotlin/io/ExposingBufferByteArrayOutputStream;", "Ljava/io/ByteArrayOutputStream;", "size", "", "(I)V", "buffer", "", "getBuffer", "()[B", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class ExposingBufferByteArrayOutputStream extends ByteArrayOutputStream {
|
||||
public ExposingBufferByteArrayOutputStream(int i) {
|
||||
super(i);
|
||||
}
|
||||
|
||||
public final byte[] getBuffer() {
|
||||
byte[] buf = this.buf;
|
||||
Intrinsics.checkNotNullExpressionValue(buf, "buf");
|
||||
return buf;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Exceptions.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\n\b\u0002\u0010\u0004\u001a\u0004\u0018\u00010\u0003\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"Lkotlin/io/FileAlreadyExistsException;", "Lkotlin/io/FileSystemException;", "file", "Ljava/io/File;", "other", "reason", "", "(Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FileAlreadyExistsException extends FileSystemException {
|
||||
public /* synthetic */ FileAlreadyExistsException(File file, File file2, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(file, (i & 2) != 0 ? null : file2, (i & 4) != 0 ? null : str);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public FileAlreadyExistsException(File file, File file2, String str) {
|
||||
super(file, file2, str);
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
}
|
||||
}
|
102
02-Easy5/E5/sources/kotlin/io/FilePathComponents.java
Normal file
102
02-Easy5/E5/sources/kotlin/io/FilePathComponents.java
Normal file
@ -0,0 +1,102 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: FilePathComponents.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u000e\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\r\b\u0080\b\u0018\u00002\u00020\u0001B\u001d\b\u0000\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\f\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005¢\u0006\u0002\u0010\u0006J\t\u0010\u0016\u001a\u00020\u0003HÆ\u0003J\u000f\u0010\u0017\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005HÆ\u0003J#\u0010\u0018\u001a\u00020\u00002\b\b\u0002\u0010\u0002\u001a\u00020\u00032\u000e\b\u0002\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005HÆ\u0001J\u0013\u0010\u0019\u001a\u00020\b2\b\u0010\u001a\u001a\u0004\u0018\u00010\u0001HÖ\u0003J\t\u0010\u001b\u001a\u00020\u0013HÖ\u0001J\u0016\u0010\u001c\u001a\u00020\u00032\u0006\u0010\u001d\u001a\u00020\u00132\u0006\u0010\u001e\u001a\u00020\u0013J\t\u0010\u001f\u001a\u00020\rHÖ\u0001R\u0011\u0010\u0007\u001a\u00020\b8F¢\u0006\u0006\u001a\u0004\b\u0007\u0010\tR\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\u000bR\u0011\u0010\f\u001a\u00020\r8F¢\u0006\u0006\u001a\u0004\b\u000e\u0010\u000fR\u0017\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00030\u0005¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\u0011R\u0011\u0010\u0012\u001a\u00020\u00138F¢\u0006\u0006\u001a\u0004\b\u0014\u0010\u0015¨\u0006 "}, d2 = {"Lkotlin/io/FilePathComponents;", "", "root", "Ljava/io/File;", "segments", "", "(Ljava/io/File;Ljava/util/List;)V", "isRooted", "", "()Z", "getRoot", "()Ljava/io/File;", "rootName", "", "getRootName", "()Ljava/lang/String;", "getSegments", "()Ljava/util/List;", "size", "", "getSize", "()I", "component1", "component2", "copy", "equals", "other", "hashCode", "subPath", "beginIndex", "endIndex", "toString", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final /* data */ class FilePathComponents {
|
||||
private final File root;
|
||||
private final List<File> segments;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public static /* synthetic */ FilePathComponents copy$default(FilePathComponents filePathComponents, File file, List list, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
file = filePathComponents.root;
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
list = filePathComponents.segments;
|
||||
}
|
||||
return filePathComponents.copy(file, list);
|
||||
}
|
||||
|
||||
/* renamed from: component1, reason: from getter */
|
||||
public final File getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
public final List<File> component2() {
|
||||
return this.segments;
|
||||
}
|
||||
|
||||
public final FilePathComponents copy(File root, List<? extends File> segments) {
|
||||
Intrinsics.checkNotNullParameter(root, "root");
|
||||
Intrinsics.checkNotNullParameter(segments, "segments");
|
||||
return new FilePathComponents(root, segments);
|
||||
}
|
||||
|
||||
public boolean equals(Object other) {
|
||||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (!(other instanceof FilePathComponents)) {
|
||||
return false;
|
||||
}
|
||||
FilePathComponents filePathComponents = (FilePathComponents) other;
|
||||
return Intrinsics.areEqual(this.root, filePathComponents.root) && Intrinsics.areEqual(this.segments, filePathComponents.segments);
|
||||
}
|
||||
|
||||
public final File getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
public final List<File> getSegments() {
|
||||
return this.segments;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return (this.root.hashCode() * 31) + this.segments.hashCode();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "FilePathComponents(root=" + this.root + ", segments=" + this.segments + ')';
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
public FilePathComponents(File root, List<? extends File> segments) {
|
||||
Intrinsics.checkNotNullParameter(root, "root");
|
||||
Intrinsics.checkNotNullParameter(segments, "segments");
|
||||
this.root = root;
|
||||
this.segments = segments;
|
||||
}
|
||||
|
||||
public final String getRootName() {
|
||||
String path = this.root.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path, "root.path");
|
||||
return path;
|
||||
}
|
||||
|
||||
public final boolean isRooted() {
|
||||
String path = this.root.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path, "root.path");
|
||||
return path.length() > 0;
|
||||
}
|
||||
|
||||
public final int getSize() {
|
||||
return this.segments.size();
|
||||
}
|
||||
|
||||
public final File subPath(int beginIndex, int endIndex) {
|
||||
if (beginIndex < 0 || beginIndex > endIndex || endIndex > getSize()) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
List<File> subList = this.segments.subList(beginIndex, endIndex);
|
||||
String separator = File.separator;
|
||||
Intrinsics.checkNotNullExpressionValue(separator, "separator");
|
||||
return new File(CollectionsKt.joinToString$default(subList, separator, null, null, 0, null, null, 62, null));
|
||||
}
|
||||
}
|
51
02-Easy5/E5/sources/kotlin/io/FileSystemException.java
Normal file
51
02-Easy5/E5/sources/kotlin/io/FileSystemException.java
Normal file
@ -0,0 +1,51 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
|
||||
/* compiled from: Exceptions.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0007\b\u0016\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\n\b\u0002\u0010\u0004\u001a\u0004\u0018\u00010\u0003\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\tR\u0013\u0010\u0004\u001a\u0004\u0018\u00010\u0003¢\u0006\b\n\u0000\u001a\u0004\b\n\u0010\tR\u0013\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\b\n\u0000\u001a\u0004\b\u000b\u0010\f¨\u0006\r"}, d2 = {"Lkotlin/io/FileSystemException;", "Ljava/io/IOException;", "file", "Ljava/io/File;", "other", "reason", "", "(Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V", "getFile", "()Ljava/io/File;", "getOther", "getReason", "()Ljava/lang/String;", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class FileSystemException extends IOException {
|
||||
private final File file;
|
||||
private final File other;
|
||||
private final String reason;
|
||||
|
||||
public final File getFile() {
|
||||
return this.file;
|
||||
}
|
||||
|
||||
public final File getOther() {
|
||||
return this.other;
|
||||
}
|
||||
|
||||
public final String getReason() {
|
||||
return this.reason;
|
||||
}
|
||||
|
||||
public /* synthetic */ FileSystemException(File file, File file2, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(file, (i & 2) != 0 ? null : file2, (i & 4) != 0 ? null : str);
|
||||
}
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public FileSystemException(java.io.File r2, java.io.File r3, java.lang.String r4) {
|
||||
/*
|
||||
r1 = this;
|
||||
java.lang.String r0 = "file"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r2, r0)
|
||||
java.lang.String r0 = kotlin.io.ExceptionsKt.access$constructMessage(r2, r3, r4)
|
||||
r1.<init>(r0)
|
||||
r1.file = r2
|
||||
r1.other = r3
|
||||
r1.reason = r4
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.FileSystemException.<init>(java.io.File, java.io.File, java.lang.String):void");
|
||||
}
|
||||
}
|
375
02-Easy5/E5/sources/kotlin/io/FileTreeWalk.java
Normal file
375
02-Easy5/E5/sources/kotlin/io/FileTreeWalk.java
Normal file
@ -0,0 +1,375 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayDeque;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.NoWhenBranchMatchedException;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.AbstractIterator;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.sequences.Sequence;
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000L\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010(\n\u0002\b\u0006\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0003\u001a\u001b\u001cB\u0019\b\u0010\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0005¢\u0006\u0002\u0010\u0006B\u0089\u0001\b\u0002\u0012\u0006\u0010\u0003\u001a\u00020\u0002\u0012\b\b\u0002\u0010\u0004\u001a\u00020\u0005\u0012\u0014\u0010\u0007\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\t\u0018\u00010\b\u0012\u0014\u0010\n\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u000b\u0018\u00010\b\u00128\u0010\f\u001a4\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u000e\u0012\b\b\u000f\u0012\u0004\b\b(\u0010\u0012\u0013\u0012\u00110\u0011¢\u0006\f\b\u000e\u0012\b\b\u000f\u0012\u0004\b\b(\u0012\u0012\u0004\u0012\u00020\u000b\u0018\u00010\r\u0012\b\b\u0002\u0010\u0013\u001a\u00020\u0014¢\u0006\u0002\u0010\u0015J\u000f\u0010\u0016\u001a\b\u0012\u0004\u0012\u00020\u00020\u0017H\u0096\u0002J\u000e\u0010\u0013\u001a\u00020\u00002\u0006\u0010\u0018\u001a\u00020\u0014J\u001a\u0010\u0007\u001a\u00020\u00002\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\t0\bJ \u0010\f\u001a\u00020\u00002\u0018\u0010\u0019\u001a\u0014\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0011\u0012\u0004\u0012\u00020\u000b0\rJ\u001a\u0010\n\u001a\u00020\u00002\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u000b0\bR\u000e\u0010\u0004\u001a\u00020\u0005X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0013\u001a\u00020\u0014X\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\u0007\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\t\u0018\u00010\bX\u0082\u0004¢\u0006\u0002\n\u0000R@\u0010\f\u001a4\u0012\u0013\u0012\u00110\u0002¢\u0006\f\b\u000e\u0012\b\b\u000f\u0012\u0004\b\b(\u0010\u0012\u0013\u0012\u00110\u0011¢\u0006\f\b\u000e\u0012\b\b\u000f\u0012\u0004\b\b(\u0012\u0012\u0004\u0012\u00020\u000b\u0018\u00010\rX\u0082\u0004¢\u0006\u0002\n\u0000R\u001c\u0010\n\u001a\u0010\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u000b\u0018\u00010\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0003\u001a\u00020\u0002X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001d"}, d2 = {"Lkotlin/io/FileTreeWalk;", "Lkotlin/sequences/Sequence;", "Ljava/io/File;", "start", "direction", "Lkotlin/io/FileWalkDirection;", "(Ljava/io/File;Lkotlin/io/FileWalkDirection;)V", "onEnter", "Lkotlin/Function1;", "", "onLeave", "", "onFail", "Lkotlin/Function2;", "Lkotlin/ParameterName;", "name", "f", "Ljava/io/IOException;", "e", "maxDepth", "", "(Ljava/io/File;Lkotlin/io/FileWalkDirection;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;I)V", "iterator", "", "depth", "function", "DirectoryState", "FileTreeWalkIterator", "WalkState", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FileTreeWalk implements Sequence<File> {
|
||||
private final FileWalkDirection direction;
|
||||
private final int maxDepth;
|
||||
private final Function1<File, Boolean> onEnter;
|
||||
private final Function2<File, IOException, Unit> onFail;
|
||||
private final Function1<File, Unit> onLeave;
|
||||
private final File start;
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
private FileTreeWalk(File file, FileWalkDirection fileWalkDirection, Function1<? super File, Boolean> function1, Function1<? super File, Unit> function12, Function2<? super File, ? super IOException, Unit> function2, int i) {
|
||||
this.start = file;
|
||||
this.direction = fileWalkDirection;
|
||||
this.onEnter = function1;
|
||||
this.onLeave = function12;
|
||||
this.onFail = function2;
|
||||
this.maxDepth = i;
|
||||
}
|
||||
|
||||
/* synthetic */ FileTreeWalk(File file, FileWalkDirection fileWalkDirection, Function1 function1, Function1 function12, Function2 function2, int i, int i2, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(file, (i2 & 2) != 0 ? FileWalkDirection.TOP_DOWN : fileWalkDirection, function1, function12, function2, (i2 & 32) != 0 ? Integer.MAX_VALUE : i);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'this' call moved to the top of the method (can break code semantics) */
|
||||
public FileTreeWalk(File start, FileWalkDirection direction) {
|
||||
this(start, direction, null, null, null, 0, 32, null);
|
||||
Intrinsics.checkNotNullParameter(start, "start");
|
||||
Intrinsics.checkNotNullParameter(direction, "direction");
|
||||
}
|
||||
|
||||
public /* synthetic */ FileTreeWalk(File file, FileWalkDirection fileWalkDirection, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(file, (i & 2) != 0 ? FileWalkDirection.TOP_DOWN : fileWalkDirection);
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<File> iterator() {
|
||||
return new FileTreeWalkIterator();
|
||||
}
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\b\"\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\n\u0010\u0007\u001a\u0004\u0018\u00010\u0003H&R\u0011\u0010\u0002\u001a\u00020\u0003¢\u0006\b\n\u0000\u001a\u0004\b\u0005\u0010\u0006¨\u0006\b"}, d2 = {"Lkotlin/io/FileTreeWalk$WalkState;", "", "root", "Ljava/io/File;", "(Ljava/io/File;)V", "getRoot", "()Ljava/io/File;", "step", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private static abstract class WalkState {
|
||||
private final File root;
|
||||
|
||||
public final File getRoot() {
|
||||
return this.root;
|
||||
}
|
||||
|
||||
public abstract File step();
|
||||
|
||||
public WalkState(File root) {
|
||||
Intrinsics.checkNotNullParameter(root, "root");
|
||||
this.root = root;
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\"\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004¨\u0006\u0005"}, d2 = {"Lkotlin/io/FileTreeWalk$DirectoryState;", "Lkotlin/io/FileTreeWalk$WalkState;", "rootDir", "Ljava/io/File;", "(Ljava/io/File;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private static abstract class DirectoryState extends WalkState {
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public DirectoryState(File rootDir) {
|
||||
super(rootDir);
|
||||
Intrinsics.checkNotNullParameter(rootDir, "rootDir");
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\b\u0082\u0004\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001:\u0003\r\u000e\u000fB\u0005¢\u0006\u0002\u0010\u0003J\b\u0010\u0007\u001a\u00020\bH\u0014J\u0010\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\u0002H\u0002J\u000b\u0010\f\u001a\u0004\u0018\u00010\u0002H\u0082\u0010R\u0014\u0010\u0004\u001a\b\u0012\u0004\u0012\u00020\u00060\u0005X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u0010"}, d2 = {"Lkotlin/io/FileTreeWalk$FileTreeWalkIterator;", "Lkotlin/collections/AbstractIterator;", "Ljava/io/File;", "(Lkotlin/io/FileTreeWalk;)V", "state", "Ljava/util/ArrayDeque;", "Lkotlin/io/FileTreeWalk$WalkState;", "computeNext", "", "directoryState", "Lkotlin/io/FileTreeWalk$DirectoryState;", "root", "gotoNext", "BottomUpDirectoryState", "SingleFileState", "TopDownDirectoryState", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private final class FileTreeWalkIterator extends AbstractIterator<File> {
|
||||
private final ArrayDeque<WalkState> state;
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(k = 3, mv = {1, 8, 0}, xi = 48)
|
||||
public /* synthetic */ class WhenMappings {
|
||||
public static final /* synthetic */ int[] $EnumSwitchMapping$0;
|
||||
|
||||
static {
|
||||
int[] iArr = new int[FileWalkDirection.values().length];
|
||||
try {
|
||||
iArr[FileWalkDirection.TOP_DOWN.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
iArr[FileWalkDirection.BOTTOM_UP.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
$EnumSwitchMapping$0 = iArr;
|
||||
}
|
||||
}
|
||||
|
||||
public FileTreeWalkIterator() {
|
||||
ArrayDeque<WalkState> arrayDeque = new ArrayDeque<>();
|
||||
this.state = arrayDeque;
|
||||
if (FileTreeWalk.this.start.isDirectory()) {
|
||||
arrayDeque.push(directoryState(FileTreeWalk.this.start));
|
||||
} else if (FileTreeWalk.this.start.isFile()) {
|
||||
arrayDeque.push(new SingleFileState(this, FileTreeWalk.this.start));
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // kotlin.collections.AbstractIterator
|
||||
protected void computeNext() {
|
||||
File gotoNext = gotoNext();
|
||||
if (gotoNext != null) {
|
||||
setNext(gotoNext);
|
||||
} else {
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
private final DirectoryState directoryState(File root) {
|
||||
int i = WhenMappings.$EnumSwitchMapping$0[FileTreeWalk.this.direction.ordinal()];
|
||||
if (i == 1) {
|
||||
return new TopDownDirectoryState(this, root);
|
||||
}
|
||||
if (i == 2) {
|
||||
return new BottomUpDirectoryState(this, root);
|
||||
}
|
||||
throw new NoWhenBranchMatchedException();
|
||||
}
|
||||
|
||||
private final File gotoNext() {
|
||||
File step;
|
||||
while (true) {
|
||||
WalkState peek = this.state.peek();
|
||||
if (peek == null) {
|
||||
return null;
|
||||
}
|
||||
step = peek.step();
|
||||
if (step == null) {
|
||||
this.state.pop();
|
||||
} else {
|
||||
if (Intrinsics.areEqual(step, peek.getRoot()) || !step.isDirectory() || this.state.size() >= FileTreeWalk.this.maxDepth) {
|
||||
break;
|
||||
}
|
||||
this.state.push(directoryState(step));
|
||||
}
|
||||
}
|
||||
return step;
|
||||
}
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000&\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0011\n\u0002\b\u0004\b\u0082\u0004\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\n\u0010\r\u001a\u0004\u0018\u00010\u0003H\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u000e¢\u0006\u0002\n\u0000R\u0018\u0010\t\u001a\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\nX\u0082\u000e¢\u0006\u0004\n\u0002\u0010\u000bR\u000e\u0010\f\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\u000e"}, d2 = {"Lkotlin/io/FileTreeWalk$FileTreeWalkIterator$BottomUpDirectoryState;", "Lkotlin/io/FileTreeWalk$DirectoryState;", "rootDir", "Ljava/io/File;", "(Lkotlin/io/FileTreeWalk$FileTreeWalkIterator;Ljava/io/File;)V", "failed", "", "fileIndex", "", "fileList", "", "[Ljava/io/File;", "rootVisited", "step", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private final class BottomUpDirectoryState extends DirectoryState {
|
||||
private boolean failed;
|
||||
private int fileIndex;
|
||||
private File[] fileList;
|
||||
private boolean rootVisited;
|
||||
final /* synthetic */ FileTreeWalkIterator this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public BottomUpDirectoryState(FileTreeWalkIterator fileTreeWalkIterator, File rootDir) {
|
||||
super(rootDir);
|
||||
Intrinsics.checkNotNullParameter(rootDir, "rootDir");
|
||||
this.this$0 = fileTreeWalkIterator;
|
||||
}
|
||||
|
||||
@Override // kotlin.io.FileTreeWalk.WalkState
|
||||
public File step() {
|
||||
if (!this.failed && this.fileList == null) {
|
||||
Function1 function1 = FileTreeWalk.this.onEnter;
|
||||
if (function1 != null && !((Boolean) function1.invoke(getRoot())).booleanValue()) {
|
||||
return null;
|
||||
}
|
||||
File[] listFiles = getRoot().listFiles();
|
||||
this.fileList = listFiles;
|
||||
if (listFiles == null) {
|
||||
Function2 function2 = FileTreeWalk.this.onFail;
|
||||
if (function2 != null) {
|
||||
function2.invoke(getRoot(), new AccessDeniedException(getRoot(), null, "Cannot list files in a directory", 2, null));
|
||||
}
|
||||
this.failed = true;
|
||||
}
|
||||
}
|
||||
File[] fileArr = this.fileList;
|
||||
if (fileArr != null) {
|
||||
int i = this.fileIndex;
|
||||
Intrinsics.checkNotNull(fileArr);
|
||||
if (i < fileArr.length) {
|
||||
File[] fileArr2 = this.fileList;
|
||||
Intrinsics.checkNotNull(fileArr2);
|
||||
int i2 = this.fileIndex;
|
||||
this.fileIndex = i2 + 1;
|
||||
return fileArr2[i2];
|
||||
}
|
||||
}
|
||||
if (this.rootVisited) {
|
||||
Function1 function12 = FileTreeWalk.this.onLeave;
|
||||
if (function12 != null) {
|
||||
function12.invoke(getRoot());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
this.rootVisited = true;
|
||||
return getRoot();
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000(\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u0011\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0082\u0004\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\n\u0010\f\u001a\u0004\u0018\u00010\u0003H\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000R\u0018\u0010\u0007\u001a\n\u0012\u0004\u0012\u00020\u0003\u0018\u00010\bX\u0082\u000e¢\u0006\u0004\n\u0002\u0010\tR\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\r"}, d2 = {"Lkotlin/io/FileTreeWalk$FileTreeWalkIterator$TopDownDirectoryState;", "Lkotlin/io/FileTreeWalk$DirectoryState;", "rootDir", "Ljava/io/File;", "(Lkotlin/io/FileTreeWalk$FileTreeWalkIterator;Ljava/io/File;)V", "fileIndex", "", "fileList", "", "[Ljava/io/File;", "rootVisited", "", "step", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private final class TopDownDirectoryState extends DirectoryState {
|
||||
private int fileIndex;
|
||||
private File[] fileList;
|
||||
private boolean rootVisited;
|
||||
final /* synthetic */ FileTreeWalkIterator this$0;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public TopDownDirectoryState(FileTreeWalkIterator fileTreeWalkIterator, File rootDir) {
|
||||
super(rootDir);
|
||||
Intrinsics.checkNotNullParameter(rootDir, "rootDir");
|
||||
this.this$0 = fileTreeWalkIterator;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:29:0x007f, code lost:
|
||||
|
||||
if (r0.length == 0) goto L31;
|
||||
*/
|
||||
@Override // kotlin.io.FileTreeWalk.WalkState
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public java.io.File step() {
|
||||
/*
|
||||
r10 = this;
|
||||
boolean r0 = r10.rootVisited
|
||||
r1 = 0
|
||||
if (r0 != 0) goto L28
|
||||
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
|
||||
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
|
||||
kotlin.jvm.functions.Function1 r0 = kotlin.io.FileTreeWalk.access$getOnEnter$p(r0)
|
||||
if (r0 == 0) goto L20
|
||||
java.io.File r2 = r10.getRoot()
|
||||
java.lang.Object r0 = r0.invoke(r2)
|
||||
java.lang.Boolean r0 = (java.lang.Boolean) r0
|
||||
boolean r0 = r0.booleanValue()
|
||||
if (r0 != 0) goto L20
|
||||
return r1
|
||||
L20:
|
||||
r0 = 1
|
||||
r10.rootVisited = r0
|
||||
java.io.File r0 = r10.getRoot()
|
||||
return r0
|
||||
L28:
|
||||
java.io.File[] r0 = r10.fileList
|
||||
if (r0 == 0) goto L47
|
||||
int r2 = r10.fileIndex
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
|
||||
int r0 = r0.length
|
||||
if (r2 >= r0) goto L35
|
||||
goto L47
|
||||
L35:
|
||||
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
|
||||
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
|
||||
kotlin.jvm.functions.Function1 r0 = kotlin.io.FileTreeWalk.access$getOnLeave$p(r0)
|
||||
if (r0 == 0) goto L46
|
||||
java.io.File r2 = r10.getRoot()
|
||||
r0.invoke(r2)
|
||||
L46:
|
||||
return r1
|
||||
L47:
|
||||
java.io.File[] r0 = r10.fileList
|
||||
if (r0 != 0) goto L93
|
||||
java.io.File r0 = r10.getRoot()
|
||||
java.io.File[] r0 = r0.listFiles()
|
||||
r10.fileList = r0
|
||||
if (r0 != 0) goto L77
|
||||
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
|
||||
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
|
||||
kotlin.jvm.functions.Function2 r0 = kotlin.io.FileTreeWalk.access$getOnFail$p(r0)
|
||||
if (r0 == 0) goto L77
|
||||
java.io.File r2 = r10.getRoot()
|
||||
kotlin.io.AccessDeniedException r9 = new kotlin.io.AccessDeniedException
|
||||
java.io.File r4 = r10.getRoot()
|
||||
r5 = 0
|
||||
java.lang.String r6 = "Cannot list files in a directory"
|
||||
r7 = 2
|
||||
r8 = 0
|
||||
r3 = r9
|
||||
r3.<init>(r4, r5, r6, r7, r8)
|
||||
r0.invoke(r2, r9)
|
||||
L77:
|
||||
java.io.File[] r0 = r10.fileList
|
||||
if (r0 == 0) goto L81
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
|
||||
int r0 = r0.length
|
||||
if (r0 != 0) goto L93
|
||||
L81:
|
||||
kotlin.io.FileTreeWalk$FileTreeWalkIterator r0 = r10.this$0
|
||||
kotlin.io.FileTreeWalk r0 = kotlin.io.FileTreeWalk.this
|
||||
kotlin.jvm.functions.Function1 r0 = kotlin.io.FileTreeWalk.access$getOnLeave$p(r0)
|
||||
if (r0 == 0) goto L92
|
||||
java.io.File r2 = r10.getRoot()
|
||||
r0.invoke(r2)
|
||||
L92:
|
||||
return r1
|
||||
L93:
|
||||
java.io.File[] r0 = r10.fileList
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNull(r0)
|
||||
int r1 = r10.fileIndex
|
||||
int r2 = r1 + 1
|
||||
r10.fileIndex = r2
|
||||
r0 = r0[r1]
|
||||
return r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.FileTreeWalk.FileTreeWalkIterator.TopDownDirectoryState.step():java.io.File");
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\b\u0082\u0004\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\n\u0010\u0007\u001a\u0004\u0018\u00010\u0003H\u0016R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlin/io/FileTreeWalk$FileTreeWalkIterator$SingleFileState;", "Lkotlin/io/FileTreeWalk$WalkState;", "rootFile", "Ljava/io/File;", "(Lkotlin/io/FileTreeWalk$FileTreeWalkIterator;Ljava/io/File;)V", "visited", "", "step", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
private final class SingleFileState extends WalkState {
|
||||
final /* synthetic */ FileTreeWalkIterator this$0;
|
||||
private boolean visited;
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public SingleFileState(FileTreeWalkIterator fileTreeWalkIterator, File rootFile) {
|
||||
super(rootFile);
|
||||
Intrinsics.checkNotNullParameter(rootFile, "rootFile");
|
||||
this.this$0 = fileTreeWalkIterator;
|
||||
}
|
||||
|
||||
@Override // kotlin.io.FileTreeWalk.WalkState
|
||||
public File step() {
|
||||
if (this.visited) {
|
||||
return null;
|
||||
}
|
||||
this.visited = true;
|
||||
return getRoot();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public final FileTreeWalk onEnter(Function1<? super File, Boolean> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
return new FileTreeWalk(this.start, this.direction, function, this.onLeave, this.onFail, this.maxDepth);
|
||||
}
|
||||
|
||||
public final FileTreeWalk onLeave(Function1<? super File, Unit> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
return new FileTreeWalk(this.start, this.direction, this.onEnter, function, this.onFail, this.maxDepth);
|
||||
}
|
||||
|
||||
public final FileTreeWalk onFail(Function2<? super File, ? super IOException, Unit> function) {
|
||||
Intrinsics.checkNotNullParameter(function, "function");
|
||||
return new FileTreeWalk(this.start, this.direction, this.onEnter, this.onLeave, function, this.maxDepth);
|
||||
}
|
||||
|
||||
public final FileTreeWalk maxDepth(int depth) {
|
||||
if (depth <= 0) {
|
||||
throw new IllegalArgumentException("depth must be positive, but was " + depth + '.');
|
||||
}
|
||||
return new FileTreeWalk(this.start, this.direction, this.onEnter, this.onLeave, this.onFail, depth);
|
||||
}
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/io/FileWalkDirection.java
Normal file
11
02-Easy5/E5/sources/kotlin/io/FileWalkDirection.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.io;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0086\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/FileWalkDirection;", "", "(Ljava/lang/String;I)V", "TOP_DOWN", "BOTTOM_UP", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public enum FileWalkDirection {
|
||||
TOP_DOWN,
|
||||
BOTTOM_UP
|
||||
}
|
10
02-Easy5/E5/sources/kotlin/io/FilesKt.java
Normal file
10
02-Easy5/E5/sources/kotlin/io/FilesKt.java
Normal file
@ -0,0 +1,10 @@
|
||||
package kotlin.io;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
@Metadata(d1 = {"kotlin/io/FilesKt__FilePathComponentsKt", "kotlin/io/FilesKt__FileReadWriteKt", "kotlin/io/FilesKt__FileTreeWalkKt", "kotlin/io/FilesKt__UtilsKt"}, k = 4, mv = {1, 8, 0}, xi = 49)
|
||||
/* loaded from: classes.dex */
|
||||
public final class FilesKt extends FilesKt__UtilsKt {
|
||||
private FilesKt() {
|
||||
}
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.StringsKt;
|
||||
|
||||
/* compiled from: FilePathComponents.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0000\n\u0002\u0010\u000b\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\u000e\n\u0002\b\u0003\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0000\u001a\u0011\u0010\u000b\u001a\u00020\f*\u00020\bH\u0002¢\u0006\u0002\b\r\u001a\u001c\u0010\u000e\u001a\u00020\u0002*\u00020\u00022\u0006\u0010\u000f\u001a\u00020\f2\u0006\u0010\u0010\u001a\u00020\fH\u0000\u001a\f\u0010\u0011\u001a\u00020\u0012*\u00020\u0002H\u0000\"\u0015\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0000\u0010\u0003\"\u0018\u0010\u0004\u001a\u00020\u0002*\u00020\u00028@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\u0005\u0010\u0006\"\u0018\u0010\u0007\u001a\u00020\b*\u00020\u00028@X\u0080\u0004¢\u0006\u0006\u001a\u0004\b\t\u0010\n¨\u0006\u0013"}, d2 = {"isRooted", "", "Ljava/io/File;", "(Ljava/io/File;)Z", "root", "getRoot", "(Ljava/io/File;)Ljava/io/File;", "rootName", "", "getRootName", "(Ljava/io/File;)Ljava/lang/String;", "getRootLength", "", "getRootLength$FilesKt__FilePathComponentsKt", "subPath", "beginIndex", "endIndex", "toComponents", "Lkotlin/io/FilePathComponents;", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/io/FilesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class FilesKt__FilePathComponentsKt {
|
||||
private static final int getRootLength$FilesKt__FilePathComponentsKt(String str) {
|
||||
int indexOf$default;
|
||||
String str2 = str;
|
||||
int indexOf$default2 = StringsKt.indexOf$default((CharSequence) str2, File.separatorChar, 0, false, 4, (Object) null);
|
||||
if (indexOf$default2 == 0) {
|
||||
if (str.length() <= 1 || str.charAt(1) != File.separatorChar || (indexOf$default = StringsKt.indexOf$default((CharSequence) str2, File.separatorChar, 2, false, 4, (Object) null)) < 0) {
|
||||
return 1;
|
||||
}
|
||||
int indexOf$default3 = StringsKt.indexOf$default((CharSequence) str2, File.separatorChar, indexOf$default + 1, false, 4, (Object) null);
|
||||
return indexOf$default3 >= 0 ? indexOf$default3 + 1 : str.length();
|
||||
}
|
||||
if (indexOf$default2 > 0 && str.charAt(indexOf$default2 - 1) == ':') {
|
||||
return indexOf$default2 + 1;
|
||||
}
|
||||
if (indexOf$default2 == -1 && StringsKt.endsWith$default((CharSequence) str2, ':', false, 2, (Object) null)) {
|
||||
return str.length();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static final String getRootName(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
String path = file.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path, "path");
|
||||
String path2 = file.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path2, "path");
|
||||
String substring = path.substring(0, getRootLength$FilesKt__FilePathComponentsKt(path2));
|
||||
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
|
||||
return substring;
|
||||
}
|
||||
|
||||
public static final File getRoot(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
return new File(FilesKt.getRootName(file));
|
||||
}
|
||||
|
||||
public static final boolean isRooted(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
String path = file.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path, "path");
|
||||
return getRootLength$FilesKt__FilePathComponentsKt(path) > 0;
|
||||
}
|
||||
|
||||
public static final FilePathComponents toComponents(File file) {
|
||||
ArrayList arrayList;
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
String path = file.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path, "path");
|
||||
int rootLength$FilesKt__FilePathComponentsKt = getRootLength$FilesKt__FilePathComponentsKt(path);
|
||||
String substring = path.substring(0, rootLength$FilesKt__FilePathComponentsKt);
|
||||
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
|
||||
String substring2 = path.substring(rootLength$FilesKt__FilePathComponentsKt);
|
||||
Intrinsics.checkNotNullExpressionValue(substring2, "this as java.lang.String).substring(startIndex)");
|
||||
String str = substring2;
|
||||
if (str.length() == 0) {
|
||||
arrayList = CollectionsKt.emptyList();
|
||||
} else {
|
||||
List split$default = StringsKt.split$default((CharSequence) str, new char[]{File.separatorChar}, false, 0, 6, (Object) null);
|
||||
ArrayList arrayList2 = new ArrayList(CollectionsKt.collectionSizeOrDefault(split$default, 10));
|
||||
Iterator it = split$default.iterator();
|
||||
while (it.hasNext()) {
|
||||
arrayList2.add(new File((String) it.next()));
|
||||
}
|
||||
arrayList = arrayList2;
|
||||
}
|
||||
return new FilePathComponents(new File(substring), arrayList);
|
||||
}
|
||||
|
||||
public static final File subPath(File file, int i, int i2) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
return FilesKt.toComponents(file).subPath(i, i2);
|
||||
}
|
||||
}
|
362
02-Easy5/E5/sources/kotlin/io/FilesKt__FileReadWriteKt.java
Normal file
362
02-Easy5/E5/sources/kotlin/io/FilesKt__FileReadWriteKt.java
Normal file
@ -0,0 +1,362 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.Reader;
|
||||
import java.io.Writer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.ranges.RangesKt;
|
||||
import kotlin.sequences.Sequence;
|
||||
import kotlin.text.Charsets;
|
||||
|
||||
/* compiled from: FileReadWrite.kt */
|
||||
@Metadata(d1 = {"\u0000z\n\u0000\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\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\u0002\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\u001a\u0012\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004\u001a\u001c\u0010\u0005\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t\u001a!\u0010\n\u001a\u00020\u000b*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\f\u001a\u00020\rH\u0087\b\u001a!\u0010\u000e\u001a\u00020\u000f*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\t2\b\b\u0002\u0010\f\u001a\u00020\rH\u0087\b\u001aB\u0010\u0010\u001a\u00020\u0001*\u00020\u000226\u0010\u0011\u001a2\u0012\u0013\u0012\u00110\u0004¢\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\u0015\u0012\u0013\u0012\u00110\r¢\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\u0016\u0012\u0004\u0012\u00020\u00010\u0012\u001aJ\u0010\u0010\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0017\u001a\u00020\r26\u0010\u0011\u001a2\u0012\u0013\u0012\u00110\u0004¢\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\u0015\u0012\u0013\u0012\u00110\r¢\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\u0016\u0012\u0004\u0012\u00020\u00010\u0012\u001a7\u0010\u0018\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\t2!\u0010\u0011\u001a\u001d\u0012\u0013\u0012\u00110\u0007¢\u0006\f\b\u0013\u0012\b\b\u0014\u0012\u0004\b\b(\u001a\u0012\u0004\u0012\u00020\u00010\u0019\u001a\r\u0010\u001b\u001a\u00020\u001c*\u00020\u0002H\u0087\b\u001a\r\u0010\u001d\u001a\u00020\u001e*\u00020\u0002H\u0087\b\u001a\u0017\u0010\u001f\u001a\u00020 *\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\tH\u0087\b\u001a\n\u0010!\u001a\u00020\u0004*\u00020\u0002\u001a\u001a\u0010\"\u001a\b\u0012\u0004\u0012\u00020\u00070#*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\t\u001a\u0014\u0010$\u001a\u00020\u0007*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\t\u001a\u0017\u0010%\u001a\u00020&*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\tH\u0087\b\u001a?\u0010'\u001a\u0002H(\"\u0004\b\u0000\u0010(*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\t2\u0018\u0010)\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u00070*\u0012\u0004\u0012\u0002H(0\u0019H\u0086\bø\u0001\u0000¢\u0006\u0002\u0010+\u001a\u0012\u0010,\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0004\u001a\u001c\u0010-\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0006\u001a\u00020\u00072\b\b\u0002\u0010\b\u001a\u00020\t\u001a\u0017\u0010.\u001a\u00020/*\u00020\u00022\b\b\u0002\u0010\b\u001a\u00020\tH\u0087\b\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u00060"}, d2 = {"appendBytes", "", "Ljava/io/File;", "array", "", "appendText", "text", "", "charset", "Ljava/nio/charset/Charset;", "bufferedReader", "Ljava/io/BufferedReader;", "bufferSize", "", "bufferedWriter", "Ljava/io/BufferedWriter;", "forEachBlock", "action", "Lkotlin/Function2;", "Lkotlin/ParameterName;", "name", "buffer", "bytesRead", "blockSize", "forEachLine", "Lkotlin/Function1;", "line", "inputStream", "Ljava/io/FileInputStream;", "outputStream", "Ljava/io/FileOutputStream;", "printWriter", "Ljava/io/PrintWriter;", "readBytes", "readLines", "", "readText", "reader", "Ljava/io/InputStreamReader;", "useLines", "T", "block", "Lkotlin/sequences/Sequence;", "(Ljava/io/File;Ljava/nio/charset/Charset;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "writeBytes", "writeText", "writer", "Ljava/io/OutputStreamWriter;", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/io/FilesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class FilesKt__FileReadWriteKt extends FilesKt__FilePathComponentsKt {
|
||||
static /* synthetic */ InputStreamReader reader$default(File file, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new InputStreamReader(new FileInputStream(file), charset);
|
||||
}
|
||||
|
||||
private static final InputStreamReader reader(File file, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new InputStreamReader(new FileInputStream(file), charset);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedReader bufferedReader$default(File file, Charset charset, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
if ((i2 & 2) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Reader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
|
||||
return inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, i);
|
||||
}
|
||||
|
||||
private static final BufferedReader bufferedReader(File file, Charset charset, int i) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Reader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
|
||||
return inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, i);
|
||||
}
|
||||
|
||||
static /* synthetic */ OutputStreamWriter writer$default(File file, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new OutputStreamWriter(new FileOutputStream(file), charset);
|
||||
}
|
||||
|
||||
private static final OutputStreamWriter writer(File file, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new OutputStreamWriter(new FileOutputStream(file), charset);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedWriter bufferedWriter$default(File file, Charset charset, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
if ((i2 & 2) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Writer outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), charset);
|
||||
return outputStreamWriter instanceof BufferedWriter ? (BufferedWriter) outputStreamWriter : new BufferedWriter(outputStreamWriter, i);
|
||||
}
|
||||
|
||||
private static final BufferedWriter bufferedWriter(File file, Charset charset, int i) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Writer outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), charset);
|
||||
return outputStreamWriter instanceof BufferedWriter ? (BufferedWriter) outputStreamWriter : new BufferedWriter(outputStreamWriter, i);
|
||||
}
|
||||
|
||||
static /* synthetic */ PrintWriter printWriter$default(File file, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Writer outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), charset);
|
||||
return new PrintWriter(outputStreamWriter instanceof BufferedWriter ? (BufferedWriter) outputStreamWriter : new BufferedWriter(outputStreamWriter, 8192));
|
||||
}
|
||||
|
||||
private static final PrintWriter printWriter(File file, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Writer outputStreamWriter = new OutputStreamWriter(new FileOutputStream(file), charset);
|
||||
return new PrintWriter(outputStreamWriter instanceof BufferedWriter ? (BufferedWriter) outputStreamWriter : new BufferedWriter(outputStreamWriter, 8192));
|
||||
}
|
||||
|
||||
public static final byte[] readBytes(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
try {
|
||||
FileInputStream fileInputStream2 = fileInputStream;
|
||||
long length = file.length();
|
||||
if (length > 2147483647L) {
|
||||
throw new OutOfMemoryError("File " + file + " is too big (" + length + " bytes) to fit in memory.");
|
||||
}
|
||||
int i = (int) length;
|
||||
byte[] bArr = new byte[i];
|
||||
int i2 = i;
|
||||
int i3 = 0;
|
||||
while (i2 > 0) {
|
||||
int read = fileInputStream2.read(bArr, i3, i2);
|
||||
if (read < 0) {
|
||||
break;
|
||||
}
|
||||
i2 -= read;
|
||||
i3 += read;
|
||||
}
|
||||
if (i2 > 0) {
|
||||
bArr = Arrays.copyOf(bArr, i3);
|
||||
Intrinsics.checkNotNullExpressionValue(bArr, "copyOf(this, newSize)");
|
||||
} else {
|
||||
int read2 = fileInputStream2.read();
|
||||
if (read2 != -1) {
|
||||
ExposingBufferByteArrayOutputStream exposingBufferByteArrayOutputStream = new ExposingBufferByteArrayOutputStream(8193);
|
||||
exposingBufferByteArrayOutputStream.write(read2);
|
||||
ByteStreamsKt.copyTo$default(fileInputStream2, exposingBufferByteArrayOutputStream, 0, 2, null);
|
||||
int size = exposingBufferByteArrayOutputStream.size() + i;
|
||||
if (size < 0) {
|
||||
throw new OutOfMemoryError("File " + file + " is too big to fit in memory.");
|
||||
}
|
||||
byte[] buffer = exposingBufferByteArrayOutputStream.getBuffer();
|
||||
byte[] copyOf = Arrays.copyOf(bArr, size);
|
||||
Intrinsics.checkNotNullExpressionValue(copyOf, "copyOf(this, newSize)");
|
||||
bArr = ArraysKt.copyInto(buffer, copyOf, i, 0, exposingBufferByteArrayOutputStream.size());
|
||||
}
|
||||
}
|
||||
CloseableKt.closeFinally(fileInputStream, null);
|
||||
return bArr;
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} catch (Throwable th2) {
|
||||
CloseableKt.closeFinally(fileInputStream, th);
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final void writeBytes(File file, byte[] array) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(array, "array");
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
||||
try {
|
||||
fileOutputStream.write(array);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
CloseableKt.closeFinally(fileOutputStream, null);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void appendBytes(File file, byte[] array) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(array, "array");
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file, true);
|
||||
try {
|
||||
fileOutputStream.write(array);
|
||||
Unit unit = Unit.INSTANCE;
|
||||
CloseableKt.closeFinally(fileOutputStream, null);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static final String readText(File file, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
InputStreamReader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
|
||||
try {
|
||||
String readText = TextStreamsKt.readText(inputStreamReader);
|
||||
CloseableKt.closeFinally(inputStreamReader, null);
|
||||
return readText;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static /* synthetic */ String readText$default(File file, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
return FilesKt.readText(file, charset);
|
||||
}
|
||||
|
||||
public static final void writeText(File file, String text, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(text, "text");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
byte[] bytes = text.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
|
||||
FilesKt.writeBytes(file, bytes);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void writeText$default(File file, String str, Charset charset, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
FilesKt.writeText(file, str, charset);
|
||||
}
|
||||
|
||||
public static final void appendText(File file, String text, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(text, "text");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
byte[] bytes = text.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
|
||||
FilesKt.appendBytes(file, bytes);
|
||||
}
|
||||
|
||||
public static /* synthetic */ void appendText$default(File file, String str, Charset charset, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
FilesKt.appendText(file, str, charset);
|
||||
}
|
||||
|
||||
public static final void forEachBlock(File file, Function2<? super byte[], ? super Integer, Unit> action) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(action, "action");
|
||||
FilesKt.forEachBlock(file, 4096, action);
|
||||
}
|
||||
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
/* JADX WARN: Type inference failed for: r3v2, types: [byte[], java.lang.Object] */
|
||||
public static final void forEachBlock(File file, int i, Function2<? super byte[], ? super Integer, Unit> action) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(action, "action");
|
||||
?? r3 = new byte[RangesKt.coerceAtLeast(i, 512)];
|
||||
FileInputStream fileInputStream = new FileInputStream(file);
|
||||
try {
|
||||
FileInputStream fileInputStream2 = fileInputStream;
|
||||
while (true) {
|
||||
int read = fileInputStream2.read(r3);
|
||||
if (read > 0) {
|
||||
action.invoke(r3, Integer.valueOf(read));
|
||||
} else {
|
||||
Unit unit = Unit.INSTANCE;
|
||||
CloseableKt.closeFinally(fileInputStream, null);
|
||||
return;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static /* synthetic */ void forEachLine$default(File file, Charset charset, Function1 function1, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
FilesKt.forEachLine(file, charset, function1);
|
||||
}
|
||||
|
||||
public static final void forEachLine(File file, Charset charset, Function1<? super String, Unit> action) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Intrinsics.checkNotNullParameter(action, "action");
|
||||
TextStreamsKt.forEachLine(new BufferedReader(new InputStreamReader(new FileInputStream(file), charset)), action);
|
||||
}
|
||||
|
||||
private static final FileInputStream inputStream(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
return new FileInputStream(file);
|
||||
}
|
||||
|
||||
private static final FileOutputStream outputStream(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
return new FileOutputStream(file);
|
||||
}
|
||||
|
||||
public static /* synthetic */ List readLines$default(File file, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
return FilesKt.readLines(file, charset);
|
||||
}
|
||||
|
||||
public static final List<String> readLines(File file, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
final ArrayList arrayList = new ArrayList();
|
||||
FilesKt.forEachLine(file, charset, new Function1<String, Unit>() { // from class: kotlin.io.FilesKt__FileReadWriteKt$readLines$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(String str) {
|
||||
invoke2(str);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(String it) {
|
||||
Intrinsics.checkNotNullParameter(it, "it");
|
||||
arrayList.add(it);
|
||||
}
|
||||
});
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static /* synthetic */ Object useLines$default(File file, Charset charset, Function1 function1, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Reader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
|
||||
BufferedReader bufferedReader = inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, 8192);
|
||||
try {
|
||||
Object invoke = function1.invoke(TextStreamsKt.lineSequence(bufferedReader));
|
||||
InlineMarker.finallyStart(1);
|
||||
CloseableKt.closeFinally(bufferedReader, null);
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static final <T> T useLines(File file, Charset charset, Function1<? super Sequence<String>, ? extends T> block) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
Reader inputStreamReader = new InputStreamReader(new FileInputStream(file), charset);
|
||||
BufferedReader bufferedReader = inputStreamReader instanceof BufferedReader ? (BufferedReader) inputStreamReader : new BufferedReader(inputStreamReader, 8192);
|
||||
try {
|
||||
T invoke = block.invoke(TextStreamsKt.lineSequence(bufferedReader));
|
||||
InlineMarker.finallyStart(1);
|
||||
CloseableKt.closeFinally(bufferedReader, null);
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
33
02-Easy5/E5/sources/kotlin/io/FilesKt__FileTreeWalkKt.java
Normal file
33
02-Easy5/E5/sources/kotlin/io/FilesKt__FileTreeWalkKt.java
Normal file
@ -0,0 +1,33 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: FileTreeWalk.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\u001a\u0014\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u0004\u001a\n\u0010\u0005\u001a\u00020\u0001*\u00020\u0002\u001a\n\u0010\u0006\u001a\u00020\u0001*\u00020\u0002¨\u0006\u0007"}, d2 = {"walk", "Lkotlin/io/FileTreeWalk;", "Ljava/io/File;", "direction", "Lkotlin/io/FileWalkDirection;", "walkBottomUp", "walkTopDown", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/io/FilesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class FilesKt__FileTreeWalkKt extends FilesKt__FileReadWriteKt {
|
||||
public static /* synthetic */ FileTreeWalk walk$default(File file, FileWalkDirection fileWalkDirection, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
fileWalkDirection = FileWalkDirection.TOP_DOWN;
|
||||
}
|
||||
return FilesKt.walk(file, fileWalkDirection);
|
||||
}
|
||||
|
||||
public static final FileTreeWalk walk(File file, FileWalkDirection direction) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(direction, "direction");
|
||||
return new FileTreeWalk(file, direction);
|
||||
}
|
||||
|
||||
public static final FileTreeWalk walkTopDown(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
return FilesKt.walk(file, FileWalkDirection.TOP_DOWN);
|
||||
}
|
||||
|
||||
public static final FileTreeWalk walkBottomUp(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
return FilesKt.walk(file, FileWalkDirection.BOTTOM_UP);
|
||||
}
|
||||
}
|
413
02-Easy5/E5/sources/kotlin/io/FilesKt__UtilsKt.java
Normal file
413
02-Easy5/E5/sources/kotlin/io/FilesKt__UtilsKt.java
Normal file
@ -0,0 +1,413 @@
|
||||
package kotlin.io;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import kotlin.Deprecated;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.collections.CollectionsKt;
|
||||
import kotlin.jvm.functions.Function2;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.StringsKt;
|
||||
|
||||
/* compiled from: Utils.kt */
|
||||
@Metadata(d1 = {"\u0000<\n\u0000\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\f\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\b\n\u0002\b\u0004\n\u0002\u0010 \n\u0000\n\u0002\u0018\u0002\n\u0002\b\f\u001a*\u0010\t\u001a\u00020\u00022\b\b\u0002\u0010\n\u001a\u00020\u00012\n\b\u0002\u0010\u000b\u001a\u0004\u0018\u00010\u00012\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\u0002H\u0007\u001a*\u0010\r\u001a\u00020\u00022\b\b\u0002\u0010\n\u001a\u00020\u00012\n\b\u0002\u0010\u000b\u001a\u0004\u0018\u00010\u00012\n\b\u0002\u0010\f\u001a\u0004\u0018\u00010\u0002H\u0007\u001a8\u0010\u000e\u001a\u00020\u000f*\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u00022\b\b\u0002\u0010\u0011\u001a\u00020\u000f2\u001a\b\u0002\u0010\u0012\u001a\u0014\u0012\u0004\u0012\u00020\u0002\u0012\u0004\u0012\u00020\u0014\u0012\u0004\u0012\u00020\u00150\u0013\u001a&\u0010\u0016\u001a\u00020\u0002*\u00020\u00022\u0006\u0010\u0010\u001a\u00020\u00022\b\b\u0002\u0010\u0011\u001a\u00020\u000f2\b\b\u0002\u0010\u0017\u001a\u00020\u0018\u001a\n\u0010\u0019\u001a\u00020\u000f*\u00020\u0002\u001a\u0012\u0010\u001a\u001a\u00020\u000f*\u00020\u00022\u0006\u0010\u001b\u001a\u00020\u0002\u001a\u0012\u0010\u001a\u001a\u00020\u000f*\u00020\u00022\u0006\u0010\u001b\u001a\u00020\u0001\u001a\n\u0010\u001c\u001a\u00020\u0002*\u00020\u0002\u001a\u001d\u0010\u001c\u001a\b\u0012\u0004\u0012\u00020\u00020\u001d*\b\u0012\u0004\u0012\u00020\u00020\u001dH\u0002¢\u0006\u0002\b\u001e\u001a\u0011\u0010\u001c\u001a\u00020\u001f*\u00020\u001fH\u0002¢\u0006\u0002\b\u001e\u001a\u0012\u0010 \u001a\u00020\u0002*\u00020\u00022\u0006\u0010!\u001a\u00020\u0002\u001a\u0014\u0010\"\u001a\u0004\u0018\u00010\u0002*\u00020\u00022\u0006\u0010!\u001a\u00020\u0002\u001a\u0012\u0010#\u001a\u00020\u0002*\u00020\u00022\u0006\u0010!\u001a\u00020\u0002\u001a\u0012\u0010$\u001a\u00020\u0002*\u00020\u00022\u0006\u0010%\u001a\u00020\u0002\u001a\u0012\u0010$\u001a\u00020\u0002*\u00020\u00022\u0006\u0010%\u001a\u00020\u0001\u001a\u0012\u0010&\u001a\u00020\u0002*\u00020\u00022\u0006\u0010%\u001a\u00020\u0002\u001a\u0012\u0010&\u001a\u00020\u0002*\u00020\u00022\u0006\u0010%\u001a\u00020\u0001\u001a\u0012\u0010'\u001a\u00020\u000f*\u00020\u00022\u0006\u0010\u001b\u001a\u00020\u0002\u001a\u0012\u0010'\u001a\u00020\u000f*\u00020\u00022\u0006\u0010\u001b\u001a\u00020\u0001\u001a\u0012\u0010(\u001a\u00020\u0001*\u00020\u00022\u0006\u0010!\u001a\u00020\u0002\u001a\u001b\u0010)\u001a\u0004\u0018\u00010\u0001*\u00020\u00022\u0006\u0010!\u001a\u00020\u0002H\u0002¢\u0006\u0002\b*\"\u0015\u0010\u0000\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0003\u0010\u0004\"\u0015\u0010\u0005\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\u0006\u0010\u0004\"\u0015\u0010\u0007\u001a\u00020\u0001*\u00020\u00028F¢\u0006\u0006\u001a\u0004\b\b\u0010\u0004¨\u0006+"}, d2 = {"extension", "", "Ljava/io/File;", "getExtension", "(Ljava/io/File;)Ljava/lang/String;", "invariantSeparatorsPath", "getInvariantSeparatorsPath", "nameWithoutExtension", "getNameWithoutExtension", "createTempDir", "prefix", "suffix", "directory", "createTempFile", "copyRecursively", "", TypedValues.AttributesType.S_TARGET, "overwrite", "onError", "Lkotlin/Function2;", "Ljava/io/IOException;", "Lkotlin/io/OnErrorAction;", "copyTo", "bufferSize", "", "deleteRecursively", "endsWith", "other", "normalize", "", "normalize$FilesKt__UtilsKt", "Lkotlin/io/FilePathComponents;", "relativeTo", "base", "relativeToOrNull", "relativeToOrSelf", "resolve", "relative", "resolveSibling", "startsWith", "toRelativeString", "toRelativeStringOrNull", "toRelativeStringOrNull$FilesKt__UtilsKt", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/io/FilesKt")
|
||||
/* loaded from: classes.dex */
|
||||
class FilesKt__UtilsKt extends FilesKt__FileTreeWalkKt {
|
||||
public static /* synthetic */ File createTempDir$default(String str, String str2, File file, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
str = "tmp";
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
str2 = null;
|
||||
}
|
||||
if ((i & 4) != 0) {
|
||||
file = null;
|
||||
}
|
||||
return FilesKt.createTempDir(str, str2, file);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Avoid creating temporary directories in the default temp location with this function due to too wide permissions on the newly created directory. Use kotlin.io.path.createTempDirectory instead.")
|
||||
public static final File createTempDir(String prefix, String str, File file) {
|
||||
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
||||
File dir = File.createTempFile(prefix, str, file);
|
||||
dir.delete();
|
||||
if (dir.mkdir()) {
|
||||
Intrinsics.checkNotNullExpressionValue(dir, "dir");
|
||||
return dir;
|
||||
}
|
||||
throw new IOException("Unable to create temporary directory " + dir + '.');
|
||||
}
|
||||
|
||||
public static /* synthetic */ File createTempFile$default(String str, String str2, File file, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
str = "tmp";
|
||||
}
|
||||
if ((i & 2) != 0) {
|
||||
str2 = null;
|
||||
}
|
||||
if ((i & 4) != 0) {
|
||||
file = null;
|
||||
}
|
||||
return FilesKt.createTempFile(str, str2, file);
|
||||
}
|
||||
|
||||
@Deprecated(message = "Avoid creating temporary files in the default temp location with this function due to too wide permissions on the newly created file. Use kotlin.io.path.createTempFile instead or resort to java.io.File.createTempFile.")
|
||||
public static final File createTempFile(String prefix, String str, File file) {
|
||||
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
||||
File createTempFile = File.createTempFile(prefix, str, file);
|
||||
Intrinsics.checkNotNullExpressionValue(createTempFile, "createTempFile(prefix, suffix, directory)");
|
||||
return createTempFile;
|
||||
}
|
||||
|
||||
public static final String getExtension(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
String name = file.getName();
|
||||
Intrinsics.checkNotNullExpressionValue(name, "name");
|
||||
return StringsKt.substringAfterLast(name, '.', "");
|
||||
}
|
||||
|
||||
public static final String getInvariantSeparatorsPath(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
if (File.separatorChar != '/') {
|
||||
String path = file.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path, "path");
|
||||
return StringsKt.replace$default(path, File.separatorChar, '/', false, 4, (Object) null);
|
||||
}
|
||||
String path2 = file.getPath();
|
||||
Intrinsics.checkNotNullExpressionValue(path2, "path");
|
||||
return path2;
|
||||
}
|
||||
|
||||
public static final String getNameWithoutExtension(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
String name = file.getName();
|
||||
Intrinsics.checkNotNullExpressionValue(name, "name");
|
||||
return StringsKt.substringBeforeLast$default(name, ".", (String) null, 2, (Object) null);
|
||||
}
|
||||
|
||||
public static final String toRelativeString(File file, File base) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(base, "base");
|
||||
String relativeStringOrNull$FilesKt__UtilsKt = toRelativeStringOrNull$FilesKt__UtilsKt(file, base);
|
||||
if (relativeStringOrNull$FilesKt__UtilsKt != null) {
|
||||
return relativeStringOrNull$FilesKt__UtilsKt;
|
||||
}
|
||||
throw new IllegalArgumentException("this and base files have different roots: " + file + " and " + base + '.');
|
||||
}
|
||||
|
||||
public static final File relativeTo(File file, File base) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(base, "base");
|
||||
return new File(FilesKt.toRelativeString(file, base));
|
||||
}
|
||||
|
||||
public static final File relativeToOrSelf(File file, File base) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(base, "base");
|
||||
String relativeStringOrNull$FilesKt__UtilsKt = toRelativeStringOrNull$FilesKt__UtilsKt(file, base);
|
||||
return relativeStringOrNull$FilesKt__UtilsKt != null ? new File(relativeStringOrNull$FilesKt__UtilsKt) : file;
|
||||
}
|
||||
|
||||
public static final File relativeToOrNull(File file, File base) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(base, "base");
|
||||
String relativeStringOrNull$FilesKt__UtilsKt = toRelativeStringOrNull$FilesKt__UtilsKt(file, base);
|
||||
if (relativeStringOrNull$FilesKt__UtilsKt != null) {
|
||||
return new File(relativeStringOrNull$FilesKt__UtilsKt);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static final String toRelativeStringOrNull$FilesKt__UtilsKt(File file, File file2) {
|
||||
FilePathComponents normalize$FilesKt__UtilsKt = normalize$FilesKt__UtilsKt(FilesKt.toComponents(file));
|
||||
FilePathComponents normalize$FilesKt__UtilsKt2 = normalize$FilesKt__UtilsKt(FilesKt.toComponents(file2));
|
||||
if (!Intrinsics.areEqual(normalize$FilesKt__UtilsKt.getRoot(), normalize$FilesKt__UtilsKt2.getRoot())) {
|
||||
return null;
|
||||
}
|
||||
int size = normalize$FilesKt__UtilsKt2.getSize();
|
||||
int size2 = normalize$FilesKt__UtilsKt.getSize();
|
||||
int min = Math.min(size2, size);
|
||||
int i = 0;
|
||||
while (i < min && Intrinsics.areEqual(normalize$FilesKt__UtilsKt.getSegments().get(i), normalize$FilesKt__UtilsKt2.getSegments().get(i))) {
|
||||
i++;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int i2 = size - 1;
|
||||
if (i <= i2) {
|
||||
while (!Intrinsics.areEqual(normalize$FilesKt__UtilsKt2.getSegments().get(i2).getName(), "..")) {
|
||||
sb.append("..");
|
||||
if (i2 != i) {
|
||||
sb.append(File.separatorChar);
|
||||
}
|
||||
if (i2 != i) {
|
||||
i2--;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (i < size2) {
|
||||
if (i < size) {
|
||||
sb.append(File.separatorChar);
|
||||
}
|
||||
String separator = File.separator;
|
||||
Intrinsics.checkNotNullExpressionValue(separator, "separator");
|
||||
CollectionsKt.joinTo(CollectionsKt.drop(normalize$FilesKt__UtilsKt.getSegments(), i), sb, (r14 & 2) != 0 ? ", " : separator, (r14 & 4) != 0 ? "" : null, (r14 & 8) != 0 ? "" : null, (r14 & 16) != 0 ? -1 : 0, (r14 & 32) != 0 ? "..." : null, (r14 & 64) != 0 ? null : null);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public static /* synthetic */ File copyTo$default(File file, File file2, boolean z, int i, int i2, Object obj) {
|
||||
if ((i2 & 2) != 0) {
|
||||
z = false;
|
||||
}
|
||||
if ((i2 & 4) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
return FilesKt.copyTo(file, file2, z, i);
|
||||
}
|
||||
|
||||
public static final File copyTo(File file, File target, boolean z, int i) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(target, "target");
|
||||
if (!file.exists()) {
|
||||
throw new NoSuchFileException(file, null, "The source file doesn't exist.", 2, null);
|
||||
}
|
||||
if (target.exists()) {
|
||||
if (!z) {
|
||||
throw new FileAlreadyExistsException(file, target, "The destination file already exists.");
|
||||
}
|
||||
if (!target.delete()) {
|
||||
throw new FileAlreadyExistsException(file, target, "Tried to overwrite the destination, but failed to delete it.");
|
||||
}
|
||||
}
|
||||
if (file.isDirectory()) {
|
||||
if (!target.mkdirs()) {
|
||||
throw new FileSystemException(file, target, "Failed to create target directory.");
|
||||
}
|
||||
} else {
|
||||
File parentFile = target.getParentFile();
|
||||
if (parentFile != null) {
|
||||
parentFile.mkdirs();
|
||||
}
|
||||
FileOutputStream fileInputStream = new FileInputStream(file);
|
||||
try {
|
||||
FileInputStream fileInputStream2 = fileInputStream;
|
||||
fileInputStream = new FileOutputStream(target);
|
||||
try {
|
||||
ByteStreamsKt.copyTo(fileInputStream2, fileInputStream, i);
|
||||
CloseableKt.closeFinally(fileInputStream, null);
|
||||
CloseableKt.closeFinally(fileInputStream, null);
|
||||
} finally {
|
||||
}
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
|
||||
public static /* synthetic */ boolean copyRecursively$default(File file, File file2, boolean z, Function2 function2, int i, Object obj) {
|
||||
if ((i & 2) != 0) {
|
||||
z = false;
|
||||
}
|
||||
if ((i & 4) != 0) {
|
||||
function2 = new Function2() { // from class: kotlin.io.FilesKt__UtilsKt$copyRecursively$1
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public final Void invoke(File file3, IOException exception) {
|
||||
Intrinsics.checkNotNullParameter(file3, "<anonymous parameter 0>");
|
||||
Intrinsics.checkNotNullParameter(exception, "exception");
|
||||
throw exception;
|
||||
}
|
||||
};
|
||||
}
|
||||
return FilesKt.copyRecursively(file, file2, z, function2);
|
||||
}
|
||||
|
||||
public static final boolean copyRecursively(File file, File target, boolean z, final Function2<? super File, ? super IOException, ? extends OnErrorAction> onError) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(target, "target");
|
||||
Intrinsics.checkNotNullParameter(onError, "onError");
|
||||
if (!file.exists()) {
|
||||
return onError.invoke(file, new NoSuchFileException(file, null, "The source file doesn't exist.", 2, null)) != OnErrorAction.TERMINATE;
|
||||
}
|
||||
try {
|
||||
Iterator<File> it = FilesKt.walkTopDown(file).onFail(new Function2<File, IOException, Unit>() { // from class: kotlin.io.FilesKt__UtilsKt$copyRecursively$2
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
/* JADX WARN: Multi-variable type inference failed */
|
||||
{
|
||||
super(2);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function2
|
||||
public /* bridge */ /* synthetic */ Unit invoke(File file2, IOException iOException) {
|
||||
invoke2(file2, iOException);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(File f, IOException e) {
|
||||
Intrinsics.checkNotNullParameter(f, "f");
|
||||
Intrinsics.checkNotNullParameter(e, "e");
|
||||
if (onError.invoke(f, e) == OnErrorAction.TERMINATE) {
|
||||
throw new TerminateException(f);
|
||||
}
|
||||
}
|
||||
}).iterator();
|
||||
while (it.hasNext()) {
|
||||
File next = it.next();
|
||||
if (!next.exists()) {
|
||||
if (onError.invoke(next, new NoSuchFileException(next, null, "The source file doesn't exist.", 2, null)) == OnErrorAction.TERMINATE) {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
File file2 = new File(target, FilesKt.toRelativeString(next, file));
|
||||
if (file2.exists() && (!next.isDirectory() || !file2.isDirectory())) {
|
||||
if (z) {
|
||||
if (file2.isDirectory()) {
|
||||
if (!FilesKt.deleteRecursively(file2)) {
|
||||
}
|
||||
} else if (!file2.delete()) {
|
||||
}
|
||||
}
|
||||
if (onError.invoke(file2, new FileAlreadyExistsException(next, file2, "The destination file already exists.")) == OnErrorAction.TERMINATE) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (next.isDirectory()) {
|
||||
file2.mkdirs();
|
||||
} else if (FilesKt.copyTo$default(next, file2, z, 0, 4, null).length() != next.length() && onError.invoke(next, new IOException("Source file wasn't copied completely, length of destination file differs.")) == OnErrorAction.TERMINATE) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} catch (TerminateException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean deleteRecursively(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
while (true) {
|
||||
boolean z = true;
|
||||
for (File file2 : FilesKt.walkBottomUp(file)) {
|
||||
if (file2.delete() || !file2.exists()) {
|
||||
if (z) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
z = false;
|
||||
}
|
||||
return z;
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean startsWith(File file, File other) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
FilePathComponents components = FilesKt.toComponents(file);
|
||||
FilePathComponents components2 = FilesKt.toComponents(other);
|
||||
if (Intrinsics.areEqual(components.getRoot(), components2.getRoot()) && components.getSize() >= components2.getSize()) {
|
||||
return components.getSegments().subList(0, components2.getSize()).equals(components2.getSegments());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static final boolean startsWith(File file, String other) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return FilesKt.startsWith(file, new File(other));
|
||||
}
|
||||
|
||||
public static final boolean endsWith(File file, File other) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
FilePathComponents components = FilesKt.toComponents(file);
|
||||
FilePathComponents components2 = FilesKt.toComponents(other);
|
||||
if (components2.isRooted()) {
|
||||
return Intrinsics.areEqual(file, other);
|
||||
}
|
||||
int size = components.getSize() - components2.getSize();
|
||||
if (size < 0) {
|
||||
return false;
|
||||
}
|
||||
return components.getSegments().subList(size, components.getSize()).equals(components2.getSegments());
|
||||
}
|
||||
|
||||
public static final boolean endsWith(File file, String other) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(other, "other");
|
||||
return FilesKt.endsWith(file, new File(other));
|
||||
}
|
||||
|
||||
public static final File normalize(File file) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
FilePathComponents components = FilesKt.toComponents(file);
|
||||
File root = components.getRoot();
|
||||
List<File> normalize$FilesKt__UtilsKt = normalize$FilesKt__UtilsKt(components.getSegments());
|
||||
String separator = File.separator;
|
||||
Intrinsics.checkNotNullExpressionValue(separator, "separator");
|
||||
return FilesKt.resolve(root, CollectionsKt.joinToString$default(normalize$FilesKt__UtilsKt, separator, null, null, 0, null, null, 62, null));
|
||||
}
|
||||
|
||||
private static final FilePathComponents normalize$FilesKt__UtilsKt(FilePathComponents filePathComponents) {
|
||||
return new FilePathComponents(filePathComponents.getRoot(), normalize$FilesKt__UtilsKt(filePathComponents.getSegments()));
|
||||
}
|
||||
|
||||
private static final List<File> normalize$FilesKt__UtilsKt(List<? extends File> list) {
|
||||
ArrayList arrayList = new ArrayList(list.size());
|
||||
for (File file : list) {
|
||||
String name = file.getName();
|
||||
if (!Intrinsics.areEqual(name, ".")) {
|
||||
if (!Intrinsics.areEqual(name, "..")) {
|
||||
arrayList.add(file);
|
||||
} else if (arrayList.isEmpty() || Intrinsics.areEqual(((File) CollectionsKt.last((List) arrayList)).getName(), "..")) {
|
||||
arrayList.add(file);
|
||||
} else {
|
||||
arrayList.remove(arrayList.size() - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static final File resolve(File file, File relative) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(relative, "relative");
|
||||
if (FilesKt.isRooted(relative)) {
|
||||
return relative;
|
||||
}
|
||||
String file2 = file.toString();
|
||||
Intrinsics.checkNotNullExpressionValue(file2, "this.toString()");
|
||||
String str = file2;
|
||||
if (str.length() == 0 || StringsKt.endsWith$default((CharSequence) str, File.separatorChar, false, 2, (Object) null)) {
|
||||
return new File(file2 + relative);
|
||||
}
|
||||
return new File(file2 + File.separatorChar + relative);
|
||||
}
|
||||
|
||||
public static final File resolve(File file, String relative) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(relative, "relative");
|
||||
return FilesKt.resolve(file, new File(relative));
|
||||
}
|
||||
|
||||
public static final File resolveSibling(File file, File relative) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(relative, "relative");
|
||||
FilePathComponents components = FilesKt.toComponents(file);
|
||||
return FilesKt.resolve(FilesKt.resolve(components.getRoot(), components.getSize() == 0 ? new File("..") : components.subPath(0, components.getSize() - 1)), relative);
|
||||
}
|
||||
|
||||
public static final File resolveSibling(File file, String relative) {
|
||||
Intrinsics.checkNotNullParameter(file, "<this>");
|
||||
Intrinsics.checkNotNullParameter(relative, "relative");
|
||||
return FilesKt.resolveSibling(file, new File(relative));
|
||||
}
|
||||
}
|
327
02-Easy5/E5/sources/kotlin/io/LineReader.java
Normal file
327
02-Easy5/E5/sources/kotlin/io/LineReader.java
Normal file
@ -0,0 +1,327 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.CharBuffer;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.CharsetDecoder;
|
||||
import java.nio.charset.CoderResult;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Console.kt */
|
||||
@Metadata(d1 = {"\u0000\\\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\b\u0002\n\u0002\u0010\b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0012\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0019\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\bÀ\u0002\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002J\b\u0010\u0014\u001a\u00020\u0004H\u0002J\u0010\u0010\u0015\u001a\u00020\u00042\u0006\u0010\u0016\u001a\u00020\u0010H\u0002J\u0018\u0010\u0017\u001a\u00020\u00042\u0006\u0010\u0018\u001a\u00020\u00042\u0006\u0010\u0019\u001a\u00020\u0004H\u0002J\u0018\u0010\u001a\u001a\u0004\u0018\u00010\u001b2\u0006\u0010\u001c\u001a\u00020\u001d2\u0006\u0010\u001e\u001a\u00020\u001fJ\b\u0010 \u001a\u00020!H\u0002J\b\u0010\"\u001a\u00020!H\u0002J\u0010\u0010#\u001a\u00020!2\u0006\u0010\u001e\u001a\u00020\u001fH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u0005\u001a\u00020\u0006X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\fX\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u000eX\u0082.¢\u0006\u0002\n\u0000R\u000e\u0010\u000f\u001a\u00020\u0010X\u0082\u000e¢\u0006\u0002\n\u0000R\u0012\u0010\u0011\u001a\u00060\u0012j\u0002`\u0013X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006$"}, d2 = {"Lkotlin/io/LineReader;", "", "()V", "BUFFER_SIZE", "", "byteBuf", "Ljava/nio/ByteBuffer;", "bytes", "", "charBuf", "Ljava/nio/CharBuffer;", "chars", "", "decoder", "Ljava/nio/charset/CharsetDecoder;", "directEOL", "", "sb", "Ljava/lang/StringBuilder;", "Lkotlin/text/StringBuilder;", "compactBytes", "decode", "endOfInput", "decodeEndOfInput", "nBytes", "nChars", "readLine", "", "inputStream", "Ljava/io/InputStream;", "charset", "Ljava/nio/charset/Charset;", "resetAll", "", "trimStringBuilder", "updateCharset", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LineReader {
|
||||
private static final int BUFFER_SIZE = 32;
|
||||
public static final LineReader INSTANCE = new LineReader();
|
||||
private static final ByteBuffer byteBuf;
|
||||
private static final byte[] bytes;
|
||||
private static final CharBuffer charBuf;
|
||||
private static final char[] chars;
|
||||
private static CharsetDecoder decoder;
|
||||
private static boolean directEOL;
|
||||
private static final StringBuilder sb;
|
||||
|
||||
private LineReader() {
|
||||
}
|
||||
|
||||
static {
|
||||
byte[] bArr = new byte[32];
|
||||
bytes = bArr;
|
||||
char[] cArr = new char[32];
|
||||
chars = cArr;
|
||||
ByteBuffer wrap = ByteBuffer.wrap(bArr);
|
||||
Intrinsics.checkNotNullExpressionValue(wrap, "wrap(bytes)");
|
||||
byteBuf = wrap;
|
||||
CharBuffer wrap2 = CharBuffer.wrap(cArr);
|
||||
Intrinsics.checkNotNullExpressionValue(wrap2, "wrap(chars)");
|
||||
charBuf = wrap2;
|
||||
sb = new StringBuilder();
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:25:0x0076, code lost:
|
||||
|
||||
if (r10 <= 0) goto L41;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:26:0x0078, code lost:
|
||||
|
||||
r0 = kotlin.io.LineReader.chars;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:27:0x007e, code lost:
|
||||
|
||||
if (r0[r10 - 1] != '\n') goto L41;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x0080, code lost:
|
||||
|
||||
r1 = r10 - 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:29:0x0082, code lost:
|
||||
|
||||
if (r1 <= 0) goto L40;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:31:0x008a, code lost:
|
||||
|
||||
if (r0[r10 - 2] != '\r') goto L40;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:32:0x008c, code lost:
|
||||
|
||||
r10 = r10 - 2;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:33:0x008f, code lost:
|
||||
|
||||
r10 = r1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:34:0x0090, code lost:
|
||||
|
||||
r0 = kotlin.io.LineReader.sb;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:35:0x0099, code lost:
|
||||
|
||||
if (r0.length() != 0) goto L46;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:38:0x00a3, code lost:
|
||||
|
||||
return new java.lang.String(kotlin.io.LineReader.chars, 0, r10);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:40:0x00a4, code lost:
|
||||
|
||||
r0.append(kotlin.io.LineReader.chars, 0, r10);
|
||||
r10 = r0.toString();
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, "sb.toString()");
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:41:0x00b6, code lost:
|
||||
|
||||
if (r0.length() <= 32) goto L49;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:42:0x00b8, code lost:
|
||||
|
||||
trimStringBuilder();
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:43:0x00bb, code lost:
|
||||
|
||||
r0.setLength(0);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:45:0x00bf, code lost:
|
||||
|
||||
return r10;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:8:0x0020, code lost:
|
||||
|
||||
if (kotlin.jvm.internal.Intrinsics.areEqual(r0.charset(), r11) == false) goto L9;
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
public final synchronized java.lang.String readLine(java.io.InputStream r10, java.nio.charset.Charset r11) {
|
||||
/*
|
||||
r9 = this;
|
||||
monitor-enter(r9)
|
||||
java.lang.String r0 = "inputStream"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r10, r0) // Catch: java.lang.Throwable -> Lc6
|
||||
java.lang.String r0 = "charset"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullParameter(r11, r0) // Catch: java.lang.Throwable -> Lc6
|
||||
java.nio.charset.CharsetDecoder r0 = kotlin.io.LineReader.decoder // Catch: java.lang.Throwable -> Lc6
|
||||
r1 = 0
|
||||
if (r0 == 0) goto L22
|
||||
if (r0 != 0) goto L18
|
||||
java.lang.String r0 = "decoder"
|
||||
kotlin.jvm.internal.Intrinsics.throwUninitializedPropertyAccessException(r0) // Catch: java.lang.Throwable -> Lc6
|
||||
r0 = r1
|
||||
L18:
|
||||
java.nio.charset.Charset r0 = r0.charset() // Catch: java.lang.Throwable -> Lc6
|
||||
boolean r0 = kotlin.jvm.internal.Intrinsics.areEqual(r0, r11) // Catch: java.lang.Throwable -> Lc6
|
||||
if (r0 != 0) goto L25
|
||||
L22:
|
||||
r9.updateCharset(r11) // Catch: java.lang.Throwable -> Lc6
|
||||
L25:
|
||||
r11 = 0
|
||||
r0 = 0
|
||||
r2 = 0
|
||||
L28:
|
||||
int r3 = r10.read() // Catch: java.lang.Throwable -> Lc6
|
||||
r4 = 32
|
||||
r5 = -1
|
||||
r6 = 10
|
||||
if (r3 != r5) goto L48
|
||||
java.lang.StringBuilder r10 = kotlin.io.LineReader.sb // Catch: java.lang.Throwable -> Lc6
|
||||
java.lang.CharSequence r10 = (java.lang.CharSequence) r10 // Catch: java.lang.Throwable -> Lc6
|
||||
int r10 = r10.length() // Catch: java.lang.Throwable -> Lc6
|
||||
if (r10 != 0) goto L43
|
||||
if (r0 != 0) goto L43
|
||||
if (r2 != 0) goto L43
|
||||
monitor-exit(r9)
|
||||
return r1
|
||||
L43:
|
||||
int r10 = r9.decodeEndOfInput(r0, r2) // Catch: java.lang.Throwable -> Lc6
|
||||
goto L76
|
||||
L48:
|
||||
byte[] r5 = kotlin.io.LineReader.bytes // Catch: java.lang.Throwable -> Lc6
|
||||
int r7 = r0 + 1
|
||||
byte r8 = (byte) r3 // Catch: java.lang.Throwable -> Lc6
|
||||
r5[r0] = r8 // Catch: java.lang.Throwable -> Lc6
|
||||
if (r3 == r6) goto L5a
|
||||
if (r7 == r4) goto L5a
|
||||
boolean r0 = kotlin.io.LineReader.directEOL // Catch: java.lang.Throwable -> Lc6
|
||||
if (r0 != 0) goto L58
|
||||
goto L5a
|
||||
L58:
|
||||
r0 = r7
|
||||
goto L28
|
||||
L5a:
|
||||
java.nio.ByteBuffer r0 = kotlin.io.LineReader.byteBuf // Catch: java.lang.Throwable -> Lc6
|
||||
r0.limit(r7) // Catch: java.lang.Throwable -> Lc6
|
||||
java.nio.CharBuffer r3 = kotlin.io.LineReader.charBuf // Catch: java.lang.Throwable -> Lc6
|
||||
r3.position(r2) // Catch: java.lang.Throwable -> Lc6
|
||||
int r2 = r9.decode(r11) // Catch: java.lang.Throwable -> Lc6
|
||||
if (r2 <= 0) goto Lc0
|
||||
char[] r3 = kotlin.io.LineReader.chars // Catch: java.lang.Throwable -> Lc6
|
||||
int r5 = r2 + (-1)
|
||||
char r3 = r3[r5] // Catch: java.lang.Throwable -> Lc6
|
||||
if (r3 != r6) goto Lc0
|
||||
r0.position(r11) // Catch: java.lang.Throwable -> Lc6
|
||||
r10 = r2
|
||||
L76:
|
||||
if (r10 <= 0) goto L90
|
||||
char[] r0 = kotlin.io.LineReader.chars // Catch: java.lang.Throwable -> Lc6
|
||||
int r1 = r10 + (-1)
|
||||
char r1 = r0[r1] // Catch: java.lang.Throwable -> Lc6
|
||||
if (r1 != r6) goto L90
|
||||
int r1 = r10 + (-1)
|
||||
if (r1 <= 0) goto L8f
|
||||
int r2 = r10 + (-2)
|
||||
char r0 = r0[r2] // Catch: java.lang.Throwable -> Lc6
|
||||
r2 = 13
|
||||
if (r0 != r2) goto L8f
|
||||
int r10 = r10 + (-2)
|
||||
goto L90
|
||||
L8f:
|
||||
r10 = r1
|
||||
L90:
|
||||
java.lang.StringBuilder r0 = kotlin.io.LineReader.sb // Catch: java.lang.Throwable -> Lc6
|
||||
r1 = r0
|
||||
java.lang.CharSequence r1 = (java.lang.CharSequence) r1 // Catch: java.lang.Throwable -> Lc6
|
||||
int r1 = r1.length() // Catch: java.lang.Throwable -> Lc6
|
||||
if (r1 != 0) goto La4
|
||||
java.lang.String r0 = new java.lang.String // Catch: java.lang.Throwable -> Lc6
|
||||
char[] r1 = kotlin.io.LineReader.chars // Catch: java.lang.Throwable -> Lc6
|
||||
r0.<init>(r1, r11, r10) // Catch: java.lang.Throwable -> Lc6
|
||||
monitor-exit(r9)
|
||||
return r0
|
||||
La4:
|
||||
char[] r1 = kotlin.io.LineReader.chars // Catch: java.lang.Throwable -> Lc6
|
||||
r0.append(r1, r11, r10) // Catch: java.lang.Throwable -> Lc6
|
||||
java.lang.String r10 = r0.toString() // Catch: java.lang.Throwable -> Lc6
|
||||
java.lang.String r1 = "sb.toString()"
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r10, r1) // Catch: java.lang.Throwable -> Lc6
|
||||
int r1 = r0.length() // Catch: java.lang.Throwable -> Lc6
|
||||
if (r1 <= r4) goto Lbb
|
||||
r9.trimStringBuilder() // Catch: java.lang.Throwable -> Lc6
|
||||
Lbb:
|
||||
r0.setLength(r11) // Catch: java.lang.Throwable -> Lc6
|
||||
monitor-exit(r9)
|
||||
return r10
|
||||
Lc0:
|
||||
int r0 = r9.compactBytes() // Catch: java.lang.Throwable -> Lc6
|
||||
goto L28
|
||||
Lc6:
|
||||
r10 = move-exception
|
||||
monitor-exit(r9)
|
||||
throw r10
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.LineReader.readLine(java.io.InputStream, java.nio.charset.Charset):java.lang.String");
|
||||
}
|
||||
|
||||
private final int decode(boolean endOfInput) {
|
||||
while (true) {
|
||||
CharsetDecoder charsetDecoder = decoder;
|
||||
if (charsetDecoder == null) {
|
||||
Intrinsics.throwUninitializedPropertyAccessException("decoder");
|
||||
charsetDecoder = null;
|
||||
}
|
||||
ByteBuffer byteBuffer = byteBuf;
|
||||
CharBuffer charBuffer = charBuf;
|
||||
CoderResult decode = charsetDecoder.decode(byteBuffer, charBuffer, endOfInput);
|
||||
Intrinsics.checkNotNullExpressionValue(decode, "decoder.decode(byteBuf, charBuf, endOfInput)");
|
||||
if (decode.isError()) {
|
||||
resetAll();
|
||||
decode.throwException();
|
||||
}
|
||||
int position = charBuffer.position();
|
||||
if (!decode.isOverflow()) {
|
||||
return position;
|
||||
}
|
||||
StringBuilder sb2 = sb;
|
||||
char[] cArr = chars;
|
||||
int i = position - 1;
|
||||
sb2.append(cArr, 0, i);
|
||||
charBuffer.position(0);
|
||||
charBuffer.limit(32);
|
||||
charBuffer.put(cArr[i]);
|
||||
}
|
||||
}
|
||||
|
||||
private final int compactBytes() {
|
||||
ByteBuffer byteBuffer = byteBuf;
|
||||
byteBuffer.compact();
|
||||
int position = byteBuffer.position();
|
||||
byteBuffer.position(0);
|
||||
return position;
|
||||
}
|
||||
|
||||
private final int decodeEndOfInput(int nBytes, int nChars) {
|
||||
ByteBuffer byteBuffer = byteBuf;
|
||||
byteBuffer.limit(nBytes);
|
||||
charBuf.position(nChars);
|
||||
int decode = decode(true);
|
||||
CharsetDecoder charsetDecoder = decoder;
|
||||
if (charsetDecoder == null) {
|
||||
Intrinsics.throwUninitializedPropertyAccessException("decoder");
|
||||
charsetDecoder = null;
|
||||
}
|
||||
charsetDecoder.reset();
|
||||
byteBuffer.position(0);
|
||||
return decode;
|
||||
}
|
||||
|
||||
private final void updateCharset(Charset charset) {
|
||||
CharsetDecoder newDecoder = charset.newDecoder();
|
||||
Intrinsics.checkNotNullExpressionValue(newDecoder, "charset.newDecoder()");
|
||||
decoder = newDecoder;
|
||||
ByteBuffer byteBuffer = byteBuf;
|
||||
byteBuffer.clear();
|
||||
CharBuffer charBuffer = charBuf;
|
||||
charBuffer.clear();
|
||||
byteBuffer.put((byte) 10);
|
||||
byteBuffer.flip();
|
||||
CharsetDecoder charsetDecoder = decoder;
|
||||
if (charsetDecoder == null) {
|
||||
Intrinsics.throwUninitializedPropertyAccessException("decoder");
|
||||
charsetDecoder = null;
|
||||
}
|
||||
boolean z = false;
|
||||
charsetDecoder.decode(byteBuffer, charBuffer, false);
|
||||
if (charBuffer.position() == 1 && charBuffer.get(0) == '\n') {
|
||||
z = true;
|
||||
}
|
||||
directEOL = z;
|
||||
resetAll();
|
||||
}
|
||||
|
||||
private final void resetAll() {
|
||||
CharsetDecoder charsetDecoder = decoder;
|
||||
if (charsetDecoder == null) {
|
||||
Intrinsics.throwUninitializedPropertyAccessException("decoder");
|
||||
charsetDecoder = null;
|
||||
}
|
||||
charsetDecoder.reset();
|
||||
byteBuf.position(0);
|
||||
sb.setLength(0);
|
||||
}
|
||||
|
||||
private final void trimStringBuilder() {
|
||||
StringBuilder sb2 = sb;
|
||||
sb2.setLength(32);
|
||||
sb2.trimToSize();
|
||||
}
|
||||
}
|
51
02-Easy5/E5/sources/kotlin/io/LinesSequence$iterator$1.java
Normal file
51
02-Easy5/E5/sources/kotlin/io/LinesSequence$iterator$1.java
Normal file
@ -0,0 +1,51 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.util.Iterator;
|
||||
import java.util.NoSuchElementException;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.jvm.internal.markers.KMappedMarker;
|
||||
|
||||
/* compiled from: ReadWrite.kt */
|
||||
@Metadata(d1 = {"\u0000\u0017\n\u0000\n\u0002\u0010(\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001J\t\u0010\u0006\u001a\u00020\u0004H\u0096\u0002J\t\u0010\u0007\u001a\u00020\u0002H\u0096\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u000e¢\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0002X\u0082\u000e¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"kotlin/io/LinesSequence$iterator$1", "", "", "done", "", "nextValue", "hasNext", "next", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class LinesSequence$iterator$1 implements Iterator<String>, KMappedMarker {
|
||||
private boolean done;
|
||||
private String nextValue;
|
||||
final /* synthetic */ LinesSequence this$0;
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public void remove() {
|
||||
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
||||
}
|
||||
|
||||
LinesSequence$iterator$1(LinesSequence linesSequence) {
|
||||
this.this$0 = linesSequence;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public boolean hasNext() {
|
||||
BufferedReader bufferedReader;
|
||||
if (this.nextValue == null && !this.done) {
|
||||
bufferedReader = this.this$0.reader;
|
||||
String readLine = bufferedReader.readLine();
|
||||
this.nextValue = readLine;
|
||||
if (readLine == null) {
|
||||
this.done = true;
|
||||
}
|
||||
}
|
||||
return this.nextValue != null;
|
||||
}
|
||||
|
||||
@Override // java.util.Iterator
|
||||
public String next() {
|
||||
if (!hasNext()) {
|
||||
throw new NoSuchElementException();
|
||||
}
|
||||
String str = this.nextValue;
|
||||
this.nextValue = null;
|
||||
Intrinsics.checkNotNull(str);
|
||||
return str;
|
||||
}
|
||||
}
|
24
02-Easy5/E5/sources/kotlin/io/LinesSequence.java
Normal file
24
02-Easy5/E5/sources/kotlin/io/LinesSequence.java
Normal file
@ -0,0 +1,24 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.util.Iterator;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.sequences.Sequence;
|
||||
|
||||
/* compiled from: ReadWrite.kt */
|
||||
@Metadata(d1 = {"\u0000\u001c\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010(\n\u0000\b\u0002\u0018\u00002\b\u0012\u0004\u0012\u00020\u00020\u0001B\r\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\u000f\u0010\u0006\u001a\b\u0012\u0004\u0012\u00020\u00020\u0007H\u0096\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\b"}, d2 = {"Lkotlin/io/LinesSequence;", "Lkotlin/sequences/Sequence;", "", "reader", "Ljava/io/BufferedReader;", "(Ljava/io/BufferedReader;)V", "iterator", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class LinesSequence implements Sequence<String> {
|
||||
private final BufferedReader reader;
|
||||
|
||||
public LinesSequence(BufferedReader reader) {
|
||||
Intrinsics.checkNotNullParameter(reader, "reader");
|
||||
this.reader = reader;
|
||||
}
|
||||
|
||||
@Override // kotlin.sequences.Sequence
|
||||
public Iterator<String> iterator() {
|
||||
return new LinesSequence$iterator$1(this);
|
||||
}
|
||||
}
|
21
02-Easy5/E5/sources/kotlin/io/NoSuchFileException.java
Normal file
21
02-Easy5/E5/sources/kotlin/io/NoSuchFileException.java
Normal file
@ -0,0 +1,21 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Exceptions.kt */
|
||||
@Metadata(d1 = {"\u0000\u001a\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\u0018\u00002\u00020\u0001B%\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\n\b\u0002\u0010\u0004\u001a\u0004\u0018\u00010\u0003\u0012\n\b\u0002\u0010\u0005\u001a\u0004\u0018\u00010\u0006¢\u0006\u0002\u0010\u0007¨\u0006\b"}, d2 = {"Lkotlin/io/NoSuchFileException;", "Lkotlin/io/FileSystemException;", "file", "Ljava/io/File;", "other", "reason", "", "(Ljava/io/File;Ljava/io/File;Ljava/lang/String;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class NoSuchFileException extends FileSystemException {
|
||||
public /* synthetic */ NoSuchFileException(File file, File file2, String str, int i, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(file, (i & 2) != 0 ? null : file2, (i & 4) != 0 ? null : str);
|
||||
}
|
||||
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public NoSuchFileException(File file, File file2, String str) {
|
||||
super(file, file2, str);
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
}
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/io/OnErrorAction.java
Normal file
11
02-Easy5/E5/sources/kotlin/io/OnErrorAction.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.io;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Utils.kt */
|
||||
@Metadata(d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0010\n\u0002\b\u0004\b\u0086\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/OnErrorAction;", "", "(Ljava/lang/String;I)V", "SKIP", "TERMINATE", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public enum OnErrorAction {
|
||||
SKIP,
|
||||
TERMINATE
|
||||
}
|
12
02-Easy5/E5/sources/kotlin/io/ReadAfterEOFException.java
Normal file
12
02-Easy5/E5/sources/kotlin/io/ReadAfterEOFException.java
Normal file
@ -0,0 +1,12 @@
|
||||
package kotlin.io;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: ioH.kt */
|
||||
@Metadata(d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\b\u0002\b\u0000\u0018\u00002\u00060\u0001j\u0002`\u0002B\u000f\u0012\b\u0010\u0003\u001a\u0004\u0018\u00010\u0004¢\u0006\u0002\u0010\u0005¨\u0006\u0006"}, d2 = {"Lkotlin/io/ReadAfterEOFException;", "Ljava/lang/RuntimeException;", "Lkotlin/RuntimeException;", "message", "", "(Ljava/lang/String;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class ReadAfterEOFException extends RuntimeException {
|
||||
public ReadAfterEOFException(String str) {
|
||||
super(str);
|
||||
}
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/io/SerializableKt.java
Normal file
11
02-Easy5/E5/sources/kotlin/io/SerializableKt.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.io;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Serializable.kt */
|
||||
@Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0018\u0002\n\u0000*\f\b\u0000\u0010\u0000\"\u00020\u00012\u00020\u0001¨\u0006\u0002"}, d2 = {"Serializable", "Ljava/io/Serializable;", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class SerializableKt {
|
||||
public static /* synthetic */ void Serializable$annotations() {
|
||||
}
|
||||
}
|
16
02-Easy5/E5/sources/kotlin/io/TerminateException.java
Normal file
16
02-Easy5/E5/sources/kotlin/io/TerminateException.java
Normal file
@ -0,0 +1,16 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.File;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Utils.kt */
|
||||
@Metadata(d1 = {"\u0000\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\b\u0002\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004¨\u0006\u0005"}, d2 = {"Lkotlin/io/TerminateException;", "Lkotlin/io/FileSystemException;", "file", "Ljava/io/File;", "(Ljava/io/File;)V", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class TerminateException extends FileSystemException {
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
public TerminateException(File file) {
|
||||
super(file, null, null, 6, null);
|
||||
Intrinsics.checkNotNullParameter(file, "file");
|
||||
}
|
||||
}
|
174
02-Easy5/E5/sources/kotlin/io/TextStreamsKt.java
Normal file
174
02-Easy5/E5/sources/kotlin/io/TextStreamsKt.java
Normal file
@ -0,0 +1,174 @@
|
||||
package kotlin.io;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.io.Writer;
|
||||
import java.net.URL;
|
||||
import java.nio.charset.Charset;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.Unit;
|
||||
import kotlin.jvm.functions.Function1;
|
||||
import kotlin.jvm.internal.InlineMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.sequences.Sequence;
|
||||
import kotlin.sequences.SequencesKt;
|
||||
import kotlin.text.Charsets;
|
||||
|
||||
/* compiled from: ReadWrite.kt */
|
||||
@Metadata(d1 = {"\u0000X\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\b\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0005\u001a\u0017\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\b\b\u0002\u0010\u0003\u001a\u00020\u0004H\u0087\b\u001a\u0017\u0010\u0000\u001a\u00020\u0005*\u00020\u00062\b\b\u0002\u0010\u0003\u001a\u00020\u0004H\u0087\b\u001a\u001c\u0010\u0007\u001a\u00020\b*\u00020\u00022\u0006\u0010\t\u001a\u00020\u00062\b\b\u0002\u0010\u0003\u001a\u00020\u0004\u001a\u001e\u0010\n\u001a\u00020\u000b*\u00020\u00022\u0012\u0010\f\u001a\u000e\u0012\u0004\u0012\u00020\u000e\u0012\u0004\u0012\u00020\u000b0\r\u001a\u0010\u0010\u000f\u001a\b\u0012\u0004\u0012\u00020\u000e0\u0010*\u00020\u0001\u001a\n\u0010\u0011\u001a\u00020\u0012*\u00020\u0013\u001a\u0010\u0010\u0014\u001a\b\u0012\u0004\u0012\u00020\u000e0\u0015*\u00020\u0002\u001a\n\u0010\u0016\u001a\u00020\u000e*\u00020\u0002\u001a\u0017\u0010\u0016\u001a\u00020\u000e*\u00020\u00132\b\b\u0002\u0010\u0017\u001a\u00020\u0018H\u0087\b\u001a\r\u0010\u0019\u001a\u00020\u001a*\u00020\u000eH\u0087\b\u001a5\u0010\u001b\u001a\u0002H\u001c\"\u0004\b\u0000\u0010\u001c*\u00020\u00022\u0018\u0010\u001d\u001a\u0014\u0012\n\u0012\b\u0012\u0004\u0012\u00020\u000e0\u0010\u0012\u0004\u0012\u0002H\u001c0\rH\u0086\bø\u0001\u0000¢\u0006\u0002\u0010\u001e\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u001f"}, d2 = {"buffered", "Ljava/io/BufferedReader;", "Ljava/io/Reader;", "bufferSize", "", "Ljava/io/BufferedWriter;", "Ljava/io/Writer;", "copyTo", "", "out", "forEachLine", "", "action", "Lkotlin/Function1;", "", "lineSequence", "Lkotlin/sequences/Sequence;", "readBytes", "", "Ljava/net/URL;", "readLines", "", "readText", "charset", "Ljava/nio/charset/Charset;", "reader", "Ljava/io/StringReader;", "useLines", "T", "block", "(Ljava/io/Reader;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class TextStreamsKt {
|
||||
static /* synthetic */ BufferedReader buffered$default(Reader reader, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader, i);
|
||||
}
|
||||
|
||||
private static final BufferedReader buffered(Reader reader, int i) {
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
return reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader, i);
|
||||
}
|
||||
|
||||
static /* synthetic */ BufferedWriter buffered$default(Writer writer, int i, int i2, Object obj) {
|
||||
if ((i2 & 1) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(writer, "<this>");
|
||||
return writer instanceof BufferedWriter ? (BufferedWriter) writer : new BufferedWriter(writer, i);
|
||||
}
|
||||
|
||||
private static final BufferedWriter buffered(Writer writer, int i) {
|
||||
Intrinsics.checkNotNullParameter(writer, "<this>");
|
||||
return writer instanceof BufferedWriter ? (BufferedWriter) writer : new BufferedWriter(writer, i);
|
||||
}
|
||||
|
||||
public static final List<String> readLines(Reader reader) {
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
final ArrayList arrayList = new ArrayList();
|
||||
forEachLine(reader, new Function1<String, Unit>() { // from class: kotlin.io.TextStreamsKt$readLines$1
|
||||
/* JADX WARN: 'super' call moved to the top of the method (can break code semantics) */
|
||||
{
|
||||
super(1);
|
||||
}
|
||||
|
||||
@Override // kotlin.jvm.functions.Function1
|
||||
public /* bridge */ /* synthetic */ Unit invoke(String str) {
|
||||
invoke2(str);
|
||||
return Unit.INSTANCE;
|
||||
}
|
||||
|
||||
/* renamed from: invoke, reason: avoid collision after fix types in other method */
|
||||
public final void invoke2(String it) {
|
||||
Intrinsics.checkNotNullParameter(it, "it");
|
||||
arrayList.add(it);
|
||||
}
|
||||
});
|
||||
return arrayList;
|
||||
}
|
||||
|
||||
public static final <T> T useLines(Reader reader, Function1<? super Sequence<String>, ? extends T> block) {
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
Intrinsics.checkNotNullParameter(block, "block");
|
||||
BufferedReader bufferedReader = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader, 8192);
|
||||
try {
|
||||
T invoke = block.invoke(lineSequence(bufferedReader));
|
||||
InlineMarker.finallyStart(1);
|
||||
CloseableKt.closeFinally(bufferedReader, null);
|
||||
InlineMarker.finallyEnd(1);
|
||||
return invoke;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
private static final StringReader reader(String str) {
|
||||
Intrinsics.checkNotNullParameter(str, "<this>");
|
||||
return new StringReader(str);
|
||||
}
|
||||
|
||||
public static final Sequence<String> lineSequence(BufferedReader bufferedReader) {
|
||||
Intrinsics.checkNotNullParameter(bufferedReader, "<this>");
|
||||
return SequencesKt.constrainOnce(new LinesSequence(bufferedReader));
|
||||
}
|
||||
|
||||
public static final String readText(Reader reader) {
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
copyTo$default(reader, stringWriter, 0, 2, null);
|
||||
String stringWriter2 = stringWriter.toString();
|
||||
Intrinsics.checkNotNullExpressionValue(stringWriter2, "buffer.toString()");
|
||||
return stringWriter2;
|
||||
}
|
||||
|
||||
public static /* synthetic */ long copyTo$default(Reader reader, Writer writer, int i, int i2, Object obj) {
|
||||
if ((i2 & 2) != 0) {
|
||||
i = 8192;
|
||||
}
|
||||
return copyTo(reader, writer, i);
|
||||
}
|
||||
|
||||
public static final long copyTo(Reader reader, Writer out, int i) {
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
Intrinsics.checkNotNullParameter(out, "out");
|
||||
char[] cArr = new char[i];
|
||||
int read = reader.read(cArr);
|
||||
long j = 0;
|
||||
while (read >= 0) {
|
||||
out.write(cArr, 0, read);
|
||||
j += read;
|
||||
read = reader.read(cArr);
|
||||
}
|
||||
return j;
|
||||
}
|
||||
|
||||
private static final String readText(URL url, Charset charset) {
|
||||
Intrinsics.checkNotNullParameter(url, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new String(readBytes(url), charset);
|
||||
}
|
||||
|
||||
static /* synthetic */ String readText$default(URL url, Charset charset, int i, Object obj) {
|
||||
if ((i & 1) != 0) {
|
||||
charset = Charsets.UTF_8;
|
||||
}
|
||||
Intrinsics.checkNotNullParameter(url, "<this>");
|
||||
Intrinsics.checkNotNullParameter(charset, "charset");
|
||||
return new String(readBytes(url), charset);
|
||||
}
|
||||
|
||||
public static final byte[] readBytes(URL url) {
|
||||
Intrinsics.checkNotNullParameter(url, "<this>");
|
||||
InputStream openStream = url.openStream();
|
||||
try {
|
||||
InputStream it = openStream;
|
||||
Intrinsics.checkNotNullExpressionValue(it, "it");
|
||||
byte[] readBytes = ByteStreamsKt.readBytes(it);
|
||||
CloseableKt.closeFinally(openStream, null);
|
||||
return readBytes;
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
|
||||
public static final void forEachLine(Reader reader, Function1<? super String, Unit> action) {
|
||||
Intrinsics.checkNotNullParameter(reader, "<this>");
|
||||
Intrinsics.checkNotNullParameter(action, "action");
|
||||
BufferedReader bufferedReader = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader, 8192);
|
||||
try {
|
||||
Iterator<String> it = lineSequence(bufferedReader).iterator();
|
||||
while (it.hasNext()) {
|
||||
action.invoke(it.next());
|
||||
}
|
||||
Unit unit = Unit.INSTANCE;
|
||||
CloseableKt.closeFinally(bufferedReader, null);
|
||||
} finally {
|
||||
}
|
||||
}
|
||||
}
|
502
02-Easy5/E5/sources/kotlin/io/encoding/Base64.java
Normal file
502
02-Easy5/E5/sources/kotlin/io/encoding/Base64.java
Normal file
@ -0,0 +1,502 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.UByte;
|
||||
import kotlin.collections.AbstractList;
|
||||
import kotlin.jvm.internal.DefaultConstructorMarker;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.Charsets;
|
||||
|
||||
/* compiled from: Base64.kt */
|
||||
@Metadata(d1 = {"\u0000B\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0000\n\u0002\u0010\u0012\n\u0002\b\u0002\n\u0002\u0010\r\n\u0000\n\u0002\u0010\b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\u0012\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\n\b\u0017\u0018\u0000 22\u00020\u0001:\u00012B\u0017\b\u0002\u0012\u0006\u0010\u0002\u001a\u00020\u0003\u0012\u0006\u0010\u0004\u001a\u00020\u0003¢\u0006\u0002\u0010\u0005J\u0015\u0010\t\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\fH\u0000¢\u0006\u0002\b\rJ%\u0010\u000e\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\u000f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0000¢\u0006\u0002\b\u0013J \u0010\u0014\u001a\u00020\u00152\u0006\u0010\u0016\u001a\u00020\u00112\u0006\u0010\u0017\u001a\u00020\u00112\u0006\u0010\u0018\u001a\u00020\u0011H\u0002J%\u0010\u0019\u001a\u00020\u00152\u0006\u0010\u001a\u001a\u00020\u00112\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0000¢\u0006\u0002\b\u001bJ\"\u0010\u001c\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\f2\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J\"\u0010\u001c\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\u000f2\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J0\u0010\u001d\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u001e\u001a\u00020\f2\u0006\u0010\u0017\u001a\u00020\u00112\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0002J4\u0010\u001f\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u001e\u001a\u00020\f2\b\b\u0002\u0010\u0017\u001a\u00020\u00112\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J4\u0010\u001f\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\u000f2\u0006\u0010\u001e\u001a\u00020\f2\b\b\u0002\u0010\u0017\u001a\u00020\u00112\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J \u0010 \u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0002J\"\u0010!\u001a\u00020\n2\u0006\u0010\u000b\u001a\u00020\f2\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J4\u0010\"\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u001e\u001a\u00020\f2\b\b\u0002\u0010\u0017\u001a\u00020\u00112\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J5\u0010#\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u001e\u001a\u00020\f2\u0006\u0010\u0017\u001a\u00020\u00112\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0000¢\u0006\u0002\b$J\u0010\u0010%\u001a\u00020\u00112\u0006\u0010\u001a\u001a\u00020\u0011H\u0002J=\u0010&\u001a\u0002H'\"\f\b\u0000\u0010'*\u00060(j\u0002`)2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u001e\u001a\u0002H'2\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011¢\u0006\u0002\u0010*J\"\u0010+\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\f2\b\b\u0002\u0010\u0010\u001a\u00020\u00112\b\b\u0002\u0010\u0012\u001a\u00020\u0011J%\u0010,\u001a\u00020\f2\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0000¢\u0006\u0002\b-J(\u0010.\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010/\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u00112\u0006\u00100\u001a\u00020\u0011H\u0002J \u00101\u001a\u00020\u00112\u0006\u0010\u000b\u001a\u00020\f2\u0006\u0010\u0010\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0002R\u0014\u0010\u0004\u001a\u00020\u0003X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0006\u0010\u0007R\u0014\u0010\u0002\u001a\u00020\u0003X\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\b\u0010\u0007¨\u00063"}, d2 = {"Lkotlin/io/encoding/Base64;", "", "isUrlSafe", "", "isMimeScheme", "(ZZ)V", "isMimeScheme$kotlin_stdlib", "()Z", "isUrlSafe$kotlin_stdlib", "bytesToStringImpl", "", "source", "", "bytesToStringImpl$kotlin_stdlib", "charsToBytesImpl", "", "startIndex", "", "endIndex", "charsToBytesImpl$kotlin_stdlib", "checkDestinationBounds", "", "destinationSize", "destinationOffset", "capacityNeeded", "checkSourceBounds", "sourceSize", "checkSourceBounds$kotlin_stdlib", "decode", "decodeImpl", "destination", "decodeIntoByteArray", "decodeSize", "encode", "encodeIntoByteArray", "encodeIntoByteArrayImpl", "encodeIntoByteArrayImpl$kotlin_stdlib", "encodeSize", "encodeToAppendable", "A", "Ljava/lang/Appendable;", "Lkotlin/text/Appendable;", "([BLjava/lang/Appendable;II)Ljava/lang/Appendable;", "encodeToByteArray", "encodeToByteArrayImpl", "encodeToByteArrayImpl$kotlin_stdlib", "handlePaddingSymbol", "padIndex", "byteStart", "skipIllegalSymbolsIfMime", "Default", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public class Base64 {
|
||||
private static final int bitsPerByte = 8;
|
||||
private static final int bitsPerSymbol = 6;
|
||||
public static final int bytesPerGroup = 3;
|
||||
private static final int mimeGroupsPerLine = 19;
|
||||
public static final int mimeLineLength = 76;
|
||||
public static final byte padSymbol = 61;
|
||||
public static final int symbolsPerGroup = 4;
|
||||
private final boolean isMimeScheme;
|
||||
private final boolean isUrlSafe;
|
||||
|
||||
/* renamed from: Default, reason: from kotlin metadata */
|
||||
public static final Companion INSTANCE = new Companion(null);
|
||||
private static final byte[] mimeLineSeparatorSymbols = {13, 10};
|
||||
private static final Base64 UrlSafe = new Base64(true, false);
|
||||
private static final Base64 Mime = new Base64(false, true);
|
||||
|
||||
public /* synthetic */ Base64(boolean z, boolean z2, DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this(z, z2);
|
||||
}
|
||||
|
||||
/* renamed from: isMimeScheme$kotlin_stdlib, reason: from getter */
|
||||
public final boolean getIsMimeScheme() {
|
||||
return this.isMimeScheme;
|
||||
}
|
||||
|
||||
/* renamed from: isUrlSafe$kotlin_stdlib, reason: from getter */
|
||||
public final boolean getIsUrlSafe() {
|
||||
return this.isUrlSafe;
|
||||
}
|
||||
|
||||
private Base64(boolean z, boolean z2) {
|
||||
this.isUrlSafe = z;
|
||||
this.isMimeScheme = z2;
|
||||
if (z && z2) {
|
||||
throw new IllegalArgumentException("Failed requirement.".toString());
|
||||
}
|
||||
}
|
||||
|
||||
public static /* synthetic */ byte[] encodeToByteArray$default(Base64 base64, byte[] bArr, int i, int i2, int i3, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: encodeToByteArray");
|
||||
}
|
||||
if ((i3 & 2) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 4) != 0) {
|
||||
i2 = bArr.length;
|
||||
}
|
||||
return base64.encodeToByteArray(bArr, i, i2);
|
||||
}
|
||||
|
||||
public final byte[] encodeToByteArray(byte[] source, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return encodeToByteArrayImpl$kotlin_stdlib(source, startIndex, endIndex);
|
||||
}
|
||||
|
||||
public static /* synthetic */ int encodeIntoByteArray$default(Base64 base64, byte[] bArr, byte[] bArr2, int i, int i2, int i3, int i4, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: encodeIntoByteArray");
|
||||
}
|
||||
int i5 = (i4 & 4) != 0 ? 0 : i;
|
||||
int i6 = (i4 & 8) != 0 ? 0 : i2;
|
||||
if ((i4 & 16) != 0) {
|
||||
i3 = bArr.length;
|
||||
}
|
||||
return base64.encodeIntoByteArray(bArr, bArr2, i5, i6, i3);
|
||||
}
|
||||
|
||||
public final int encodeIntoByteArray(byte[] source, byte[] destination, int destinationOffset, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
return encodeIntoByteArrayImpl$kotlin_stdlib(source, destination, destinationOffset, startIndex, endIndex);
|
||||
}
|
||||
|
||||
public static /* synthetic */ String encode$default(Base64 base64, byte[] bArr, int i, int i2, int i3, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: encode");
|
||||
}
|
||||
if ((i3 & 2) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 4) != 0) {
|
||||
i2 = bArr.length;
|
||||
}
|
||||
return base64.encode(bArr, i, i2);
|
||||
}
|
||||
|
||||
public final String encode(byte[] source, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new String(encodeToByteArrayImpl$kotlin_stdlib(source, startIndex, endIndex), Charsets.ISO_8859_1);
|
||||
}
|
||||
|
||||
public static /* synthetic */ Appendable encodeToAppendable$default(Base64 base64, byte[] bArr, Appendable appendable, int i, int i2, int i3, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: encodeToAppendable");
|
||||
}
|
||||
if ((i3 & 4) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 8) != 0) {
|
||||
i2 = bArr.length;
|
||||
}
|
||||
return base64.encodeToAppendable(bArr, appendable, i, i2);
|
||||
}
|
||||
|
||||
public final <A extends Appendable> A encodeToAppendable(byte[] source, A destination, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
destination.append(new String(encodeToByteArrayImpl$kotlin_stdlib(source, startIndex, endIndex), Charsets.ISO_8859_1));
|
||||
return destination;
|
||||
}
|
||||
|
||||
public static /* synthetic */ byte[] decode$default(Base64 base64, byte[] bArr, int i, int i2, int i3, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: decode");
|
||||
}
|
||||
if ((i3 & 2) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 4) != 0) {
|
||||
i2 = bArr.length;
|
||||
}
|
||||
return base64.decode(bArr, i, i2);
|
||||
}
|
||||
|
||||
public final byte[] decode(byte[] source, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
checkSourceBounds$kotlin_stdlib(source.length, startIndex, endIndex);
|
||||
int decodeSize = decodeSize(source, startIndex, endIndex);
|
||||
byte[] bArr = new byte[decodeSize];
|
||||
if (decodeImpl(source, bArr, 0, startIndex, endIndex) == decodeSize) {
|
||||
return bArr;
|
||||
}
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
|
||||
public static /* synthetic */ int decodeIntoByteArray$default(Base64 base64, byte[] bArr, byte[] bArr2, int i, int i2, int i3, int i4, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: decodeIntoByteArray");
|
||||
}
|
||||
int i5 = (i4 & 4) != 0 ? 0 : i;
|
||||
int i6 = (i4 & 8) != 0 ? 0 : i2;
|
||||
if ((i4 & 16) != 0) {
|
||||
i3 = bArr.length;
|
||||
}
|
||||
return base64.decodeIntoByteArray(bArr, bArr2, i5, i6, i3);
|
||||
}
|
||||
|
||||
public final int decodeIntoByteArray(byte[] source, byte[] destination, int destinationOffset, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
checkSourceBounds$kotlin_stdlib(source.length, startIndex, endIndex);
|
||||
checkDestinationBounds(destination.length, destinationOffset, decodeSize(source, startIndex, endIndex));
|
||||
return decodeImpl(source, destination, destinationOffset, startIndex, endIndex);
|
||||
}
|
||||
|
||||
public static /* synthetic */ byte[] decode$default(Base64 base64, CharSequence charSequence, int i, int i2, int i3, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: decode");
|
||||
}
|
||||
if ((i3 & 2) != 0) {
|
||||
i = 0;
|
||||
}
|
||||
if ((i3 & 4) != 0) {
|
||||
i2 = charSequence.length();
|
||||
}
|
||||
return base64.decode(charSequence, i, i2);
|
||||
}
|
||||
|
||||
public final byte[] decode(CharSequence source, int startIndex, int endIndex) {
|
||||
byte[] charsToBytesImpl$kotlin_stdlib;
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
if (source instanceof String) {
|
||||
checkSourceBounds$kotlin_stdlib(source.length(), startIndex, endIndex);
|
||||
String substring = ((String) source).substring(startIndex, endIndex);
|
||||
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
|
||||
Charset charset = Charsets.ISO_8859_1;
|
||||
Intrinsics.checkNotNull(substring, "null cannot be cast to non-null type java.lang.String");
|
||||
charsToBytesImpl$kotlin_stdlib = substring.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(charsToBytesImpl$kotlin_stdlib, "this as java.lang.String).getBytes(charset)");
|
||||
} else {
|
||||
charsToBytesImpl$kotlin_stdlib = charsToBytesImpl$kotlin_stdlib(source, startIndex, endIndex);
|
||||
}
|
||||
return decode$default(this, charsToBytesImpl$kotlin_stdlib, 0, 0, 6, (Object) null);
|
||||
}
|
||||
|
||||
public static /* synthetic */ int decodeIntoByteArray$default(Base64 base64, CharSequence charSequence, byte[] bArr, int i, int i2, int i3, int i4, Object obj) {
|
||||
if (obj != null) {
|
||||
throw new UnsupportedOperationException("Super calls with default arguments not supported in this target, function: decodeIntoByteArray");
|
||||
}
|
||||
int i5 = (i4 & 4) != 0 ? 0 : i;
|
||||
int i6 = (i4 & 8) != 0 ? 0 : i2;
|
||||
if ((i4 & 16) != 0) {
|
||||
i3 = charSequence.length();
|
||||
}
|
||||
return base64.decodeIntoByteArray(charSequence, bArr, i5, i6, i3);
|
||||
}
|
||||
|
||||
public final int decodeIntoByteArray(CharSequence source, byte[] destination, int destinationOffset, int startIndex, int endIndex) {
|
||||
byte[] charsToBytesImpl$kotlin_stdlib;
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
if (source instanceof String) {
|
||||
checkSourceBounds$kotlin_stdlib(source.length(), startIndex, endIndex);
|
||||
String substring = ((String) source).substring(startIndex, endIndex);
|
||||
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
|
||||
Charset charset = Charsets.ISO_8859_1;
|
||||
Intrinsics.checkNotNull(substring, "null cannot be cast to non-null type java.lang.String");
|
||||
charsToBytesImpl$kotlin_stdlib = substring.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(charsToBytesImpl$kotlin_stdlib, "this as java.lang.String).getBytes(charset)");
|
||||
} else {
|
||||
charsToBytesImpl$kotlin_stdlib = charsToBytesImpl$kotlin_stdlib(source, startIndex, endIndex);
|
||||
}
|
||||
return decodeIntoByteArray$default(this, charsToBytesImpl$kotlin_stdlib, destination, destinationOffset, 0, 0, 24, (Object) null);
|
||||
}
|
||||
|
||||
public final byte[] encodeToByteArrayImpl$kotlin_stdlib(byte[] source, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
checkSourceBounds$kotlin_stdlib(source.length, startIndex, endIndex);
|
||||
byte[] bArr = new byte[encodeSize(endIndex - startIndex)];
|
||||
encodeIntoByteArrayImpl$kotlin_stdlib(source, bArr, 0, startIndex, endIndex);
|
||||
return bArr;
|
||||
}
|
||||
|
||||
public final int encodeIntoByteArrayImpl$kotlin_stdlib(byte[] source, byte[] destination, int destinationOffset, int startIndex, int endIndex) {
|
||||
int i = startIndex;
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
checkSourceBounds$kotlin_stdlib(source.length, i, endIndex);
|
||||
checkDestinationBounds(destination.length, destinationOffset, encodeSize(endIndex - i));
|
||||
byte[] bArr = this.isUrlSafe ? Base64Kt.base64UrlEncodeMap : Base64Kt.base64EncodeMap;
|
||||
int i2 = this.isMimeScheme ? 19 : Integer.MAX_VALUE;
|
||||
int i3 = destinationOffset;
|
||||
while (i + 2 < endIndex) {
|
||||
int min = Math.min((endIndex - i) / 3, i2);
|
||||
for (int i4 = 0; i4 < min; i4++) {
|
||||
int i5 = source[i] & UByte.MAX_VALUE;
|
||||
int i6 = i + 2;
|
||||
int i7 = source[i + 1] & UByte.MAX_VALUE;
|
||||
i += 3;
|
||||
int i8 = (i7 << 8) | (i5 << 16) | (source[i6] & UByte.MAX_VALUE);
|
||||
destination[i3] = bArr[i8 >>> 18];
|
||||
destination[i3 + 1] = bArr[(i8 >>> 12) & 63];
|
||||
int i9 = i3 + 3;
|
||||
destination[i3 + 2] = bArr[(i8 >>> 6) & 63];
|
||||
i3 += 4;
|
||||
destination[i9] = bArr[i8 & 63];
|
||||
}
|
||||
if (min == i2 && i != endIndex) {
|
||||
int i10 = i3 + 1;
|
||||
byte[] bArr2 = mimeLineSeparatorSymbols;
|
||||
destination[i3] = bArr2[0];
|
||||
i3 += 2;
|
||||
destination[i10] = bArr2[1];
|
||||
}
|
||||
}
|
||||
int i11 = endIndex - i;
|
||||
if (i11 == 1) {
|
||||
int i12 = (source[i] & UByte.MAX_VALUE) << 4;
|
||||
destination[i3] = bArr[i12 >>> 6];
|
||||
destination[i3 + 1] = bArr[i12 & 63];
|
||||
int i13 = i3 + 3;
|
||||
destination[i3 + 2] = padSymbol;
|
||||
i3 += 4;
|
||||
destination[i13] = padSymbol;
|
||||
i++;
|
||||
} else if (i11 == 2) {
|
||||
int i14 = i + 1;
|
||||
int i15 = source[i] & UByte.MAX_VALUE;
|
||||
i += 2;
|
||||
int i16 = ((source[i14] & UByte.MAX_VALUE) << 2) | (i15 << 10);
|
||||
destination[i3] = bArr[i16 >>> 12];
|
||||
destination[i3 + 1] = bArr[(i16 >>> 6) & 63];
|
||||
int i17 = i3 + 3;
|
||||
destination[i3 + 2] = bArr[i16 & 63];
|
||||
i3 += 4;
|
||||
destination[i17] = padSymbol;
|
||||
}
|
||||
if (i == endIndex) {
|
||||
return i3 - destinationOffset;
|
||||
}
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
|
||||
private final int encodeSize(int sourceSize) {
|
||||
int i = (sourceSize + 2) / 3;
|
||||
int i2 = (i * 4) + ((this.isMimeScheme ? (i - 1) / 19 : 0) * 2);
|
||||
if (i2 >= 0) {
|
||||
return i2;
|
||||
}
|
||||
throw new IllegalArgumentException("Input is too big");
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:28:0x00cd, code lost:
|
||||
|
||||
if (r7 == (-2)) goto L36;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:29:0x00cf, code lost:
|
||||
|
||||
r3 = skipIllegalSymbolsIfMime(r19, r5, r23);
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:30:0x00d3, code lost:
|
||||
|
||||
if (r3 < r23) goto L34;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:32:0x00d7, code lost:
|
||||
|
||||
return r8 - r21;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:33:0x00d8, code lost:
|
||||
|
||||
r1 = r19[r3] & kotlin.UByte.MAX_VALUE;
|
||||
r4 = new java.lang.StringBuilder("Symbol '");
|
||||
r4.append((char) r1);
|
||||
r4.append("'(");
|
||||
r1 = java.lang.Integer.toString(r1, kotlin.text.CharsKt.checkRadix(8));
|
||||
kotlin.jvm.internal.Intrinsics.checkNotNullExpressionValue(r1, "toString(this, checkRadix(radix))");
|
||||
r4.append(r1);
|
||||
r4.append(") at index ");
|
||||
r4.append(r3 - 1);
|
||||
r4.append(" is prohibited after the pad character");
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:34:0x0110, code lost:
|
||||
|
||||
throw new java.lang.IllegalArgumentException(r4.toString());
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:36:0x0118, code lost:
|
||||
|
||||
throw new java.lang.IllegalArgumentException("The last unit of input does not have enough bits");
|
||||
*/
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private final int decodeImpl(byte[] r19, byte[] r20, int r21, int r22, int r23) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 281
|
||||
To view this dump add '--comments-level debug' option
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.encoding.Base64.decodeImpl(byte[], byte[], int, int, int):int");
|
||||
}
|
||||
|
||||
private final int decodeSize(byte[] source, int startIndex, int endIndex) {
|
||||
int[] iArr;
|
||||
int i = endIndex - startIndex;
|
||||
if (i == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (i == 1) {
|
||||
throw new IllegalArgumentException("Input should have at list 2 symbols for Base64 decoding, startIndex: " + startIndex + ", endIndex: " + endIndex);
|
||||
}
|
||||
if (this.isMimeScheme) {
|
||||
while (true) {
|
||||
if (startIndex >= endIndex) {
|
||||
break;
|
||||
}
|
||||
int i2 = source[startIndex] & UByte.MAX_VALUE;
|
||||
iArr = Base64Kt.base64DecodeMap;
|
||||
int i3 = iArr[i2];
|
||||
if (i3 < 0) {
|
||||
if (i3 == -2) {
|
||||
i -= endIndex - startIndex;
|
||||
break;
|
||||
}
|
||||
i--;
|
||||
}
|
||||
startIndex++;
|
||||
}
|
||||
} else if (source[endIndex - 1] == 61) {
|
||||
i = source[endIndex + (-2)] == 61 ? i - 2 : i - 1;
|
||||
}
|
||||
return (int) ((i * 6) / 8);
|
||||
}
|
||||
|
||||
public final byte[] charsToBytesImpl$kotlin_stdlib(CharSequence source, int startIndex, int endIndex) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
checkSourceBounds$kotlin_stdlib(source.length(), startIndex, endIndex);
|
||||
byte[] bArr = new byte[endIndex - startIndex];
|
||||
int i = 0;
|
||||
while (startIndex < endIndex) {
|
||||
char charAt = source.charAt(startIndex);
|
||||
if (charAt <= 255) {
|
||||
bArr[i] = (byte) charAt;
|
||||
i++;
|
||||
} else {
|
||||
bArr[i] = 63;
|
||||
i++;
|
||||
}
|
||||
startIndex++;
|
||||
}
|
||||
return bArr;
|
||||
}
|
||||
|
||||
public final String bytesToStringImpl$kotlin_stdlib(byte[] source) {
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
StringBuilder sb = new StringBuilder(source.length);
|
||||
for (byte b : source) {
|
||||
sb.append((char) b);
|
||||
}
|
||||
String sb2 = sb.toString();
|
||||
Intrinsics.checkNotNullExpressionValue(sb2, "stringBuilder.toString()");
|
||||
return sb2;
|
||||
}
|
||||
|
||||
private final int handlePaddingSymbol(byte[] source, int padIndex, int endIndex, int byteStart) {
|
||||
if (byteStart == -8) {
|
||||
throw new IllegalArgumentException("Redundant pad character at index " + padIndex);
|
||||
}
|
||||
if (byteStart != -6) {
|
||||
if (byteStart == -4) {
|
||||
padIndex = skipIllegalSymbolsIfMime(source, padIndex + 1, endIndex);
|
||||
if (padIndex == endIndex || source[padIndex] != 61) {
|
||||
throw new IllegalArgumentException("Missing one pad character at index " + padIndex);
|
||||
}
|
||||
} else if (byteStart != -2) {
|
||||
throw new IllegalStateException("Unreachable".toString());
|
||||
}
|
||||
}
|
||||
return padIndex + 1;
|
||||
}
|
||||
|
||||
private final int skipIllegalSymbolsIfMime(byte[] source, int startIndex, int endIndex) {
|
||||
int[] iArr;
|
||||
if (!this.isMimeScheme) {
|
||||
return startIndex;
|
||||
}
|
||||
while (startIndex < endIndex) {
|
||||
int i = source[startIndex] & UByte.MAX_VALUE;
|
||||
iArr = Base64Kt.base64DecodeMap;
|
||||
if (iArr[i] != -1) {
|
||||
return startIndex;
|
||||
}
|
||||
startIndex++;
|
||||
}
|
||||
return startIndex;
|
||||
}
|
||||
|
||||
public final void checkSourceBounds$kotlin_stdlib(int sourceSize, int startIndex, int endIndex) {
|
||||
AbstractList.INSTANCE.checkBoundsIndexes$kotlin_stdlib(startIndex, endIndex, sourceSize);
|
||||
}
|
||||
|
||||
private final void checkDestinationBounds(int destinationSize, int destinationOffset, int capacityNeeded) {
|
||||
if (destinationOffset < 0 || destinationOffset > destinationSize) {
|
||||
throw new IndexOutOfBoundsException("destination offset: " + destinationOffset + ", destination size: " + destinationSize);
|
||||
}
|
||||
int i = destinationOffset + capacityNeeded;
|
||||
if (i < 0 || i > destinationSize) {
|
||||
throw new IndexOutOfBoundsException("The destination array does not have enough capacity, destination offset: " + destinationOffset + ", destination size: " + destinationSize + ", capacity needed: " + capacityNeeded);
|
||||
}
|
||||
}
|
||||
|
||||
/* compiled from: Base64.kt */
|
||||
@Metadata(d1 = {"\u0000$\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u0012\n\u0002\b\u0003\n\u0002\u0010\u0005\n\u0002\b\u0002\b\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\b\u0002¢\u0006\u0002\u0010\u0002R\u0011\u0010\u0003\u001a\u00020\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0004\u0010\u0005R\u0011\u0010\u0006\u001a\u00020\u0001¢\u0006\b\n\u0000\u001a\u0004\b\u0007\u0010\u0005R\u000e\u0010\b\u001a\u00020\tX\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\tX\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\u000b\u001a\u00020\tX\u0080T¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\tX\u0082T¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\tX\u0080T¢\u0006\u0002\n\u0000R\u0014\u0010\u000e\u001a\u00020\u000fX\u0080\u0004¢\u0006\b\n\u0000\u001a\u0004\b\u0010\u0010\u0011R\u000e\u0010\u0012\u001a\u00020\u0013X\u0080T¢\u0006\u0002\n\u0000R\u000e\u0010\u0014\u001a\u00020\tX\u0080T¢\u0006\u0002\n\u0000¨\u0006\u0015"}, d2 = {"Lkotlin/io/encoding/Base64$Default;", "Lkotlin/io/encoding/Base64;", "()V", "Mime", "getMime", "()Lkotlin/io/encoding/Base64;", "UrlSafe", "getUrlSafe", "bitsPerByte", "", "bitsPerSymbol", "bytesPerGroup", "mimeGroupsPerLine", "mimeLineLength", "mimeLineSeparatorSymbols", "", "getMimeLineSeparatorSymbols$kotlin_stdlib", "()[B", "padSymbol", "", "symbolsPerGroup", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* renamed from: kotlin.io.encoding.Base64$Default, reason: from kotlin metadata */
|
||||
public static final class Companion extends Base64 {
|
||||
public /* synthetic */ Companion(DefaultConstructorMarker defaultConstructorMarker) {
|
||||
this();
|
||||
}
|
||||
|
||||
/* JADX WARN: Illegal instructions before constructor call */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct add '--show-bad-code' argument
|
||||
*/
|
||||
private Companion() {
|
||||
/*
|
||||
r2 = this;
|
||||
r0 = 0
|
||||
r1 = 0
|
||||
r2.<init>(r0, r0, r1)
|
||||
return
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: kotlin.io.encoding.Base64.Companion.<init>():void");
|
||||
}
|
||||
|
||||
public final byte[] getMimeLineSeparatorSymbols$kotlin_stdlib() {
|
||||
return Base64.mimeLineSeparatorSymbols;
|
||||
}
|
||||
|
||||
public final Base64 getUrlSafe() {
|
||||
return Base64.UrlSafe;
|
||||
}
|
||||
|
||||
public final Base64 getMime() {
|
||||
return Base64.Mime;
|
||||
}
|
||||
}
|
||||
}
|
46
02-Easy5/E5/sources/kotlin/io/encoding/Base64JVMKt.java
Normal file
46
02-Easy5/E5/sources/kotlin/io/encoding/Base64JVMKt.java
Normal file
@ -0,0 +1,46 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import java.nio.charset.Charset;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
import kotlin.text.Charsets;
|
||||
|
||||
/* compiled from: Base64JVM.kt */
|
||||
@Metadata(d1 = {"\u0000 \n\u0000\n\u0002\u0010\u0012\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\r\n\u0000\n\u0002\u0010\b\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0000\u001a%\u0010\u0000\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0081\b\u001a5\u0010\b\u001a\u00020\u0006*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\t\u001a\u00020\u00012\u0006\u0010\n\u001a\u00020\u00062\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0081\b\u001a%\u0010\u000b\u001a\u00020\u0001*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0081\b\u001a%\u0010\f\u001a\u00020\r*\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u00012\u0006\u0010\u0005\u001a\u00020\u00062\u0006\u0010\u0007\u001a\u00020\u0006H\u0081\b¨\u0006\u000e"}, d2 = {"platformCharsToBytes", "", "Lkotlin/io/encoding/Base64;", "source", "", "startIndex", "", "endIndex", "platformEncodeIntoByteArray", "destination", "destinationOffset", "platformEncodeToByteArray", "platformEncodeToString", "", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class Base64JVMKt {
|
||||
private static final byte[] platformCharsToBytes(Base64 base64, CharSequence source, int i, int i2) {
|
||||
Intrinsics.checkNotNullParameter(base64, "<this>");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
if (source instanceof String) {
|
||||
base64.checkSourceBounds$kotlin_stdlib(source.length(), i, i2);
|
||||
String substring = ((String) source).substring(i, i2);
|
||||
Intrinsics.checkNotNullExpressionValue(substring, "this as java.lang.String…ing(startIndex, endIndex)");
|
||||
Charset charset = Charsets.ISO_8859_1;
|
||||
Intrinsics.checkNotNull(substring, "null cannot be cast to non-null type java.lang.String");
|
||||
byte[] bytes = substring.getBytes(charset);
|
||||
Intrinsics.checkNotNullExpressionValue(bytes, "this as java.lang.String).getBytes(charset)");
|
||||
return bytes;
|
||||
}
|
||||
return base64.charsToBytesImpl$kotlin_stdlib(source, i, i2);
|
||||
}
|
||||
|
||||
private static final String platformEncodeToString(Base64 base64, byte[] source, int i, int i2) {
|
||||
Intrinsics.checkNotNullParameter(base64, "<this>");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return new String(base64.encodeToByteArrayImpl$kotlin_stdlib(source, i, i2), Charsets.ISO_8859_1);
|
||||
}
|
||||
|
||||
private static final int platformEncodeIntoByteArray(Base64 base64, byte[] source, byte[] destination, int i, int i2, int i3) {
|
||||
Intrinsics.checkNotNullParameter(base64, "<this>");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
return base64.encodeIntoByteArrayImpl$kotlin_stdlib(source, destination, i, i2, i3);
|
||||
}
|
||||
|
||||
private static final byte[] platformEncodeToByteArray(Base64 base64, byte[] source, int i, int i2) {
|
||||
Intrinsics.checkNotNullParameter(base64, "<this>");
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
return base64.encodeToByteArrayImpl$kotlin_stdlib(source, i, i2);
|
||||
}
|
||||
}
|
67
02-Easy5/E5/sources/kotlin/io/encoding/Base64Kt.java
Normal file
67
02-Easy5/E5/sources/kotlin/io/encoding/Base64Kt.java
Normal file
@ -0,0 +1,67 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArraysKt;
|
||||
|
||||
/* compiled from: Base64.kt */
|
||||
@Metadata(d1 = {"\u0000\u001e\n\u0000\n\u0002\u0010\u0015\n\u0002\b\u0003\n\u0002\u0010\u0012\n\u0002\b\u0006\n\u0002\u0010\u000b\n\u0000\n\u0002\u0010\b\n\u0000\u001a\u0010\u0010\u000b\u001a\u00020\f2\u0006\u0010\r\u001a\u00020\u000eH\u0001\"\u0016\u0010\u0000\u001a\u00020\u00018\u0002X\u0083\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0002\u0010\u0003\"\u0016\u0010\u0004\u001a\u00020\u00058\u0002X\u0083\u0004¢\u0006\b\n\u0000\u0012\u0004\b\u0006\u0010\u0003\"\u0016\u0010\u0007\u001a\u00020\u00018\u0002X\u0083\u0004¢\u0006\b\n\u0000\u0012\u0004\b\b\u0010\u0003\"\u0016\u0010\t\u001a\u00020\u00058\u0002X\u0083\u0004¢\u0006\b\n\u0000\u0012\u0004\b\n\u0010\u0003¨\u0006\u000f"}, d2 = {"base64DecodeMap", "", "getBase64DecodeMap$annotations", "()V", "base64EncodeMap", "", "getBase64EncodeMap$annotations", "base64UrlDecodeMap", "getBase64UrlDecodeMap$annotations", "base64UrlEncodeMap", "getBase64UrlEncodeMap$annotations", "isInMimeAlphabet", "", "symbol", "", "kotlin-stdlib"}, k = 2, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
public final class Base64Kt {
|
||||
private static final int[] base64DecodeMap;
|
||||
private static final byte[] base64EncodeMap;
|
||||
private static final int[] base64UrlDecodeMap;
|
||||
private static final byte[] base64UrlEncodeMap;
|
||||
|
||||
private static /* synthetic */ void getBase64DecodeMap$annotations() {
|
||||
}
|
||||
|
||||
private static /* synthetic */ void getBase64EncodeMap$annotations() {
|
||||
}
|
||||
|
||||
private static /* synthetic */ void getBase64UrlDecodeMap$annotations() {
|
||||
}
|
||||
|
||||
private static /* synthetic */ void getBase64UrlEncodeMap$annotations() {
|
||||
}
|
||||
|
||||
static {
|
||||
byte[] bArr = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 43, 47};
|
||||
base64EncodeMap = bArr;
|
||||
int[] iArr = new int[256];
|
||||
int i = 0;
|
||||
ArraysKt.fill$default(iArr, -1, 0, 0, 6, (Object) null);
|
||||
iArr[61] = -2;
|
||||
int length = bArr.length;
|
||||
int i2 = 0;
|
||||
int i3 = 0;
|
||||
while (i2 < length) {
|
||||
iArr[bArr[i2]] = i3;
|
||||
i2++;
|
||||
i3++;
|
||||
}
|
||||
base64DecodeMap = iArr;
|
||||
byte[] bArr2 = {65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 45, 95};
|
||||
base64UrlEncodeMap = bArr2;
|
||||
int[] iArr2 = new int[256];
|
||||
ArraysKt.fill$default(iArr2, -1, 0, 0, 6, (Object) null);
|
||||
iArr2[61] = -2;
|
||||
int length2 = bArr2.length;
|
||||
int i4 = 0;
|
||||
while (i < length2) {
|
||||
iArr2[bArr2[i]] = i4;
|
||||
i++;
|
||||
i4++;
|
||||
}
|
||||
base64UrlDecodeMap = iArr2;
|
||||
}
|
||||
|
||||
public static final boolean isInMimeAlphabet(int i) {
|
||||
if (i >= 0) {
|
||||
int[] iArr = base64DecodeMap;
|
||||
if (i < iArr.length && iArr[i] != -1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
186
02-Easy5/E5/sources/kotlin/io/encoding/DecodeInputStream.java
Normal file
186
02-Easy5/E5/sources/kotlin/io/encoding/DecodeInputStream.java
Normal file
@ -0,0 +1,186 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.UByte;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Base64IOStream.kt */
|
||||
@Metadata(d1 = {"\u00002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0002\b\u0005\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0010\u0002\n\u0002\b\u000f\b\u0003\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0001\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\u0013\u001a\u00020\u0014H\u0016J \u0010\u0015\u001a\u00020\u00142\u0006\u0010\u0016\u001a\u00020\u00072\u0006\u0010\u0017\u001a\u00020\t2\u0006\u0010\u0018\u001a\u00020\tH\u0002J(\u0010\u0019\u001a\u00020\t2\u0006\u0010\u0016\u001a\u00020\u00072\u0006\u0010\u0017\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\t2\u0006\u0010\u001b\u001a\u00020\tH\u0002J\u0010\u0010\u001c\u001a\u00020\t2\u0006\u0010\u001b\u001a\u00020\tH\u0002J\b\u0010\u001d\u001a\u00020\tH\u0016J \u0010\u001d\u001a\u00020\t2\u0006\u0010\u001e\u001a\u00020\u00072\u0006\u0010\u001f\u001a\u00020\t2\u0006\u0010\u0018\u001a\u00020\tH\u0016J\b\u0010 \u001a\u00020\tH\u0002J\b\u0010!\u001a\u00020\u0014H\u0002J\b\u0010\"\u001a\u00020\u0014H\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u0014\u0010\n\u001a\u00020\t8BX\u0082\u0004¢\u0006\u0006\u001a\u0004\b\u000b\u0010\fR\u000e\u0010\r\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u000e\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u000fX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0011\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0012\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006#"}, d2 = {"Lkotlin/io/encoding/DecodeInputStream;", "Ljava/io/InputStream;", "input", "base64", "Lkotlin/io/encoding/Base64;", "(Ljava/io/InputStream;Lkotlin/io/encoding/Base64;)V", "byteBuffer", "", "byteBufferEndIndex", "", "byteBufferLength", "getByteBufferLength", "()I", "byteBufferStartIndex", "isClosed", "", "isEOF", "singleByteBuffer", "symbolBuffer", "close", "", "copyByteBufferInto", "dst", "dstOffset", "length", "decodeSymbolBufferInto", "dstEndIndex", "symbolBufferLength", "handlePaddingSymbol", "read", "destination", TypedValues.CycleType.S_WAVE_OFFSET, "readNextSymbol", "resetByteBufferIfEmpty", "shiftByteBufferToStartIfNeeded", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class DecodeInputStream extends InputStream {
|
||||
private final Base64 base64;
|
||||
private final byte[] byteBuffer;
|
||||
private int byteBufferEndIndex;
|
||||
private int byteBufferStartIndex;
|
||||
private final InputStream input;
|
||||
private boolean isClosed;
|
||||
private boolean isEOF;
|
||||
private final byte[] singleByteBuffer;
|
||||
private final byte[] symbolBuffer;
|
||||
|
||||
private final int getByteBufferLength() {
|
||||
return this.byteBufferEndIndex - this.byteBufferStartIndex;
|
||||
}
|
||||
|
||||
private final void resetByteBufferIfEmpty() {
|
||||
if (this.byteBufferStartIndex == this.byteBufferEndIndex) {
|
||||
this.byteBufferStartIndex = 0;
|
||||
this.byteBufferEndIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
public DecodeInputStream(InputStream input, Base64 base64) {
|
||||
Intrinsics.checkNotNullParameter(input, "input");
|
||||
Intrinsics.checkNotNullParameter(base64, "base64");
|
||||
this.input = input;
|
||||
this.base64 = base64;
|
||||
this.singleByteBuffer = new byte[1];
|
||||
this.symbolBuffer = new byte[1024];
|
||||
this.byteBuffer = new byte[1024];
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public int read() {
|
||||
int i = this.byteBufferStartIndex;
|
||||
if (i < this.byteBufferEndIndex) {
|
||||
int i2 = this.byteBuffer[i] & UByte.MAX_VALUE;
|
||||
this.byteBufferStartIndex = i + 1;
|
||||
resetByteBufferIfEmpty();
|
||||
return i2;
|
||||
}
|
||||
int read = read(this.singleByteBuffer, 0, 1);
|
||||
if (read == -1) {
|
||||
return -1;
|
||||
}
|
||||
if (read == 1) {
|
||||
return this.singleByteBuffer[0] & UByte.MAX_VALUE;
|
||||
}
|
||||
throw new IllegalStateException("Unreachable".toString());
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream
|
||||
public int read(byte[] destination, int offset, int length) {
|
||||
int i;
|
||||
boolean z;
|
||||
boolean z2;
|
||||
Intrinsics.checkNotNullParameter(destination, "destination");
|
||||
if (offset < 0 || length < 0 || (i = offset + length) > destination.length) {
|
||||
throw new IndexOutOfBoundsException("offset: " + offset + ", length: " + length + ", buffer size: " + destination.length);
|
||||
}
|
||||
if (this.isClosed) {
|
||||
throw new IOException("The input stream is closed.");
|
||||
}
|
||||
if (this.isEOF) {
|
||||
return -1;
|
||||
}
|
||||
if (length == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (getByteBufferLength() >= length) {
|
||||
copyByteBufferInto(destination, offset, length);
|
||||
return length;
|
||||
}
|
||||
int byteBufferLength = (((length - getByteBufferLength()) + 2) / 3) * 4;
|
||||
int i2 = offset;
|
||||
while (true) {
|
||||
z = this.isEOF;
|
||||
if (z || byteBufferLength <= 0) {
|
||||
break;
|
||||
}
|
||||
int min = Math.min(this.symbolBuffer.length, byteBufferLength);
|
||||
int i3 = 0;
|
||||
while (true) {
|
||||
z2 = this.isEOF;
|
||||
if (z2 || i3 >= min) {
|
||||
break;
|
||||
}
|
||||
int readNextSymbol = readNextSymbol();
|
||||
if (readNextSymbol == -1) {
|
||||
this.isEOF = true;
|
||||
} else if (readNextSymbol == 61) {
|
||||
i3 = handlePaddingSymbol(i3);
|
||||
this.isEOF = true;
|
||||
} else {
|
||||
this.symbolBuffer[i3] = (byte) readNextSymbol;
|
||||
i3++;
|
||||
}
|
||||
}
|
||||
if (!z2 && i3 != min) {
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
byteBufferLength -= i3;
|
||||
i2 += decodeSymbolBufferInto(destination, i2, i, i3);
|
||||
}
|
||||
if (i2 == offset && z) {
|
||||
return -1;
|
||||
}
|
||||
return i2 - offset;
|
||||
}
|
||||
|
||||
@Override // java.io.InputStream, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
if (this.isClosed) {
|
||||
return;
|
||||
}
|
||||
this.isClosed = true;
|
||||
this.input.close();
|
||||
}
|
||||
|
||||
private final int decodeSymbolBufferInto(byte[] dst, int dstOffset, int dstEndIndex, int symbolBufferLength) {
|
||||
int i = this.byteBufferEndIndex;
|
||||
this.byteBufferEndIndex = i + this.base64.decodeIntoByteArray(this.symbolBuffer, this.byteBuffer, i, 0, symbolBufferLength);
|
||||
int min = Math.min(getByteBufferLength(), dstEndIndex - dstOffset);
|
||||
copyByteBufferInto(dst, dstOffset, min);
|
||||
shiftByteBufferToStartIfNeeded();
|
||||
return min;
|
||||
}
|
||||
|
||||
private final void copyByteBufferInto(byte[] dst, int dstOffset, int length) {
|
||||
byte[] bArr = this.byteBuffer;
|
||||
int i = this.byteBufferStartIndex;
|
||||
ArraysKt.copyInto(bArr, dst, dstOffset, i, i + length);
|
||||
this.byteBufferStartIndex += length;
|
||||
resetByteBufferIfEmpty();
|
||||
}
|
||||
|
||||
private final void shiftByteBufferToStartIfNeeded() {
|
||||
byte[] bArr = this.byteBuffer;
|
||||
int length = bArr.length;
|
||||
int i = this.byteBufferEndIndex;
|
||||
if ((this.symbolBuffer.length / 4) * 3 > length - i) {
|
||||
ArraysKt.copyInto(bArr, bArr, 0, this.byteBufferStartIndex, i);
|
||||
this.byteBufferEndIndex -= this.byteBufferStartIndex;
|
||||
this.byteBufferStartIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
private final int handlePaddingSymbol(int symbolBufferLength) {
|
||||
this.symbolBuffer[symbolBufferLength] = Base64.padSymbol;
|
||||
if ((symbolBufferLength & 3) != 2) {
|
||||
return symbolBufferLength + 1;
|
||||
}
|
||||
int readNextSymbol = readNextSymbol();
|
||||
if (readNextSymbol >= 0) {
|
||||
this.symbolBuffer[symbolBufferLength + 1] = (byte) readNextSymbol;
|
||||
}
|
||||
return symbolBufferLength + 2;
|
||||
}
|
||||
|
||||
private final int readNextSymbol() {
|
||||
int read;
|
||||
if (!this.base64.getIsMimeScheme()) {
|
||||
return this.input.read();
|
||||
}
|
||||
do {
|
||||
read = this.input.read();
|
||||
if (read == -1) {
|
||||
break;
|
||||
}
|
||||
} while (!Base64Kt.isInMimeAlphabet(read));
|
||||
return read;
|
||||
}
|
||||
}
|
133
02-Easy5/E5/sources/kotlin/io/encoding/EncodeOutputStream.java
Normal file
133
02-Easy5/E5/sources/kotlin/io/encoding/EncodeOutputStream.java
Normal file
@ -0,0 +1,133 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import androidx.constraintlayout.core.motion.utils.TypedValues;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.collections.ArraysKt;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Base64IOStream.kt */
|
||||
@Metadata(d1 = {"\u00000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0012\n\u0000\n\u0002\u0010\b\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0003\n\u0002\u0010\u0002\n\u0002\b\r\b\u0003\u0018\u00002\u00020\u0001B\u0015\u0012\u0006\u0010\u0002\u001a\u00020\u0001\u0012\u0006\u0010\u0003\u001a\u00020\u0004¢\u0006\u0002\u0010\u0005J\b\u0010\u000e\u001a\u00020\u000fH\u0002J\b\u0010\u0010\u001a\u00020\u000fH\u0016J \u0010\u0011\u001a\u00020\t2\u0006\u0010\u0012\u001a\u00020\u00072\u0006\u0010\u0013\u001a\u00020\t2\u0006\u0010\u0014\u001a\u00020\tH\u0002J\b\u0010\u0015\u001a\u00020\u000fH\u0002J \u0010\u0016\u001a\u00020\t2\u0006\u0010\u0012\u001a\u00020\u00072\u0006\u0010\u0013\u001a\u00020\t2\u0006\u0010\u0014\u001a\u00020\tH\u0002J\b\u0010\u0017\u001a\u00020\u000fH\u0016J \u0010\u0018\u001a\u00020\u000f2\u0006\u0010\u0012\u001a\u00020\u00072\u0006\u0010\u0019\u001a\u00020\t2\u0006\u0010\u001a\u001a\u00020\tH\u0016J\u0010\u0010\u0018\u001a\u00020\u000f2\u0006\u0010\u001b\u001a\u00020\tH\u0016R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0006\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\b\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\u000bX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\f\u001a\u00020\tX\u0082\u000e¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0001X\u0082\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\r\u001a\u00020\u0007X\u0082\u0004¢\u0006\u0002\n\u0000¨\u0006\u001c"}, d2 = {"Lkotlin/io/encoding/EncodeOutputStream;", "Ljava/io/OutputStream;", "output", "base64", "Lkotlin/io/encoding/Base64;", "(Ljava/io/OutputStream;Lkotlin/io/encoding/Base64;)V", "byteBuffer", "", "byteBufferLength", "", "isClosed", "", "lineLength", "symbolBuffer", "checkOpen", "", "close", "copyIntoByteBuffer", "source", "startIndex", "endIndex", "encodeByteBufferIntoOutput", "encodeIntoOutput", "flush", "write", TypedValues.CycleType.S_WAVE_OFFSET, "length", "b", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
/* loaded from: classes.dex */
|
||||
final class EncodeOutputStream extends OutputStream {
|
||||
private final Base64 base64;
|
||||
private final byte[] byteBuffer;
|
||||
private int byteBufferLength;
|
||||
private boolean isClosed;
|
||||
private int lineLength;
|
||||
private final OutputStream output;
|
||||
private final byte[] symbolBuffer;
|
||||
|
||||
public EncodeOutputStream(OutputStream output, Base64 base64) {
|
||||
Intrinsics.checkNotNullParameter(output, "output");
|
||||
Intrinsics.checkNotNullParameter(base64, "base64");
|
||||
this.output = output;
|
||||
this.base64 = base64;
|
||||
this.lineLength = base64.getIsMimeScheme() ? 76 : -1;
|
||||
this.symbolBuffer = new byte[1024];
|
||||
this.byteBuffer = new byte[3];
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream
|
||||
public void write(int b) {
|
||||
checkOpen();
|
||||
byte[] bArr = this.byteBuffer;
|
||||
int i = this.byteBufferLength;
|
||||
int i2 = i + 1;
|
||||
this.byteBufferLength = i2;
|
||||
bArr[i] = (byte) b;
|
||||
if (i2 == 3) {
|
||||
encodeByteBufferIntoOutput();
|
||||
}
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream
|
||||
public void write(byte[] source, int offset, int length) {
|
||||
int i;
|
||||
Intrinsics.checkNotNullParameter(source, "source");
|
||||
checkOpen();
|
||||
if (offset < 0 || length < 0 || (i = offset + length) > source.length) {
|
||||
throw new IndexOutOfBoundsException("offset: " + offset + ", length: " + length + ", source size: " + source.length);
|
||||
}
|
||||
if (length == 0) {
|
||||
return;
|
||||
}
|
||||
int i2 = this.byteBufferLength;
|
||||
if (i2 >= 3) {
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
if (i2 != 0) {
|
||||
offset += copyIntoByteBuffer(source, offset, i);
|
||||
if (this.byteBufferLength != 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
while (offset + 3 <= i) {
|
||||
int min = Math.min((this.base64.getIsMimeScheme() ? this.lineLength : this.symbolBuffer.length) / 4, (i - offset) / 3);
|
||||
int i3 = (min * 3) + offset;
|
||||
if (encodeIntoOutput(source, offset, i3) != min * 4) {
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
offset = i3;
|
||||
}
|
||||
ArraysKt.copyInto(source, this.byteBuffer, 0, offset, i);
|
||||
this.byteBufferLength = i - offset;
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream, java.io.Flushable
|
||||
public void flush() {
|
||||
checkOpen();
|
||||
this.output.flush();
|
||||
}
|
||||
|
||||
@Override // java.io.OutputStream, java.io.Closeable, java.lang.AutoCloseable
|
||||
public void close() {
|
||||
if (this.isClosed) {
|
||||
return;
|
||||
}
|
||||
this.isClosed = true;
|
||||
if (this.byteBufferLength != 0) {
|
||||
encodeByteBufferIntoOutput();
|
||||
}
|
||||
this.output.close();
|
||||
}
|
||||
|
||||
private final int copyIntoByteBuffer(byte[] source, int startIndex, int endIndex) {
|
||||
int min = Math.min(3 - this.byteBufferLength, endIndex - startIndex);
|
||||
ArraysKt.copyInto(source, this.byteBuffer, this.byteBufferLength, startIndex, startIndex + min);
|
||||
int i = this.byteBufferLength + min;
|
||||
this.byteBufferLength = i;
|
||||
if (i == 3) {
|
||||
encodeByteBufferIntoOutput();
|
||||
}
|
||||
return min;
|
||||
}
|
||||
|
||||
private final void encodeByteBufferIntoOutput() {
|
||||
if (encodeIntoOutput(this.byteBuffer, 0, this.byteBufferLength) != 4) {
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
this.byteBufferLength = 0;
|
||||
}
|
||||
|
||||
private final int encodeIntoOutput(byte[] source, int startIndex, int endIndex) {
|
||||
int encodeIntoByteArray = this.base64.encodeIntoByteArray(source, this.symbolBuffer, 0, startIndex, endIndex);
|
||||
if (this.lineLength == 0) {
|
||||
this.output.write(Base64.INSTANCE.getMimeLineSeparatorSymbols$kotlin_stdlib());
|
||||
this.lineLength = 76;
|
||||
if (encodeIntoByteArray > 76) {
|
||||
throw new IllegalStateException("Check failed.".toString());
|
||||
}
|
||||
}
|
||||
this.output.write(this.symbolBuffer, 0, encodeIntoByteArray);
|
||||
this.lineLength -= encodeIntoByteArray;
|
||||
return encodeIntoByteArray;
|
||||
}
|
||||
|
||||
private final void checkOpen() {
|
||||
if (this.isClosed) {
|
||||
throw new IOException("The output stream is closed.");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
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: ExperimentalEncodingApi.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/encoding/ExperimentalEncodingApi;", "", "kotlin-stdlib"}, k = 1, mv = {1, 8, 0}, xi = 48)
|
||||
@Documented
|
||||
/* loaded from: classes.dex */
|
||||
public @interface ExperimentalEncodingApi {
|
||||
}
|
11
02-Easy5/E5/sources/kotlin/io/encoding/StreamEncodingKt.java
Normal file
11
02-Easy5/E5/sources/kotlin/io/encoding/StreamEncodingKt.java
Normal file
@ -0,0 +1,11 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import kotlin.Metadata;
|
||||
|
||||
/* compiled from: Base64IOStream.kt */
|
||||
@Metadata(d1 = {"kotlin/io/encoding/StreamEncodingKt__Base64IOStreamKt"}, k = 4, mv = {1, 8, 0}, xi = 49)
|
||||
/* loaded from: classes.dex */
|
||||
public final class StreamEncodingKt extends StreamEncodingKt__Base64IOStreamKt {
|
||||
private StreamEncodingKt() {
|
||||
}
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package kotlin.io.encoding;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import kotlin.Metadata;
|
||||
import kotlin.jvm.internal.Intrinsics;
|
||||
|
||||
/* compiled from: Base64IOStream.kt */
|
||||
@Metadata(d1 = {"\u0000\u0014\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\u001a\u0014\u0010\u0000\u001a\u00020\u0001*\u00020\u00012\u0006\u0010\u0002\u001a\u00020\u0003H\u0007\u001a\u0014\u0010\u0004\u001a\u00020\u0005*\u00020\u00052\u0006\u0010\u0002\u001a\u00020\u0003H\u0007¨\u0006\u0006"}, d2 = {"decodingWith", "Ljava/io/InputStream;", "base64", "Lkotlin/io/encoding/Base64;", "encodingWith", "Ljava/io/OutputStream;", "kotlin-stdlib"}, k = 5, mv = {1, 8, 0}, xi = 49, xs = "kotlin/io/encoding/StreamEncodingKt")
|
||||
/* loaded from: classes.dex */
|
||||
class StreamEncodingKt__Base64IOStreamKt {
|
||||
public static final InputStream decodingWith(InputStream inputStream, Base64 base64) {
|
||||
Intrinsics.checkNotNullParameter(inputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(base64, "base64");
|
||||
return new DecodeInputStream(inputStream, base64);
|
||||
}
|
||||
|
||||
public static final OutputStream encodingWith(OutputStream outputStream, Base64 base64) {
|
||||
Intrinsics.checkNotNullParameter(outputStream, "<this>");
|
||||
Intrinsics.checkNotNullParameter(base64, "base64");
|
||||
return new EncodeOutputStream(outputStream, base64);
|
||||
}
|
||||
}
|
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