Rabbit-R1/android (non root)/java/sources/kotlin/io/path/PathsKt__PathUtilsKt.java

798 lines
52 KiB
Java
Raw Permalink Normal View History

2024-05-21 16:08:36 -05:00
package kotlin.io.path;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.exifinterface.media.ExifInterface;
import java.io.IOException;
import java.net.URI;
import java.nio.file.CopyOption;
import java.nio.file.DirectoryStream;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.FileStore;
import java.nio.file.FileVisitOption;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.nio.file.attribute.FileAttribute;
import java.nio.file.attribute.FileAttributeView;
import java.nio.file.attribute.FileTime;
import java.nio.file.attribute.PosixFilePermission;
import java.nio.file.attribute.UserPrincipal;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import kotlin.Deprecated;
import kotlin.DeprecationLevel;
import kotlin.KotlinNothingValueException;
import kotlin.Metadata;
import kotlin.ReplaceWith;
import kotlin.Unit;
import kotlin.collections.CollectionsKt;
import kotlin.collections.SetsKt;
import kotlin.internal.PlatformImplementationsKt;
import kotlin.io.CloseableKt;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.InlineMarker;
import kotlin.jvm.internal.Intrinsics;
import kotlin.sequences.Sequence;
import kotlin.text.StringsKt;
/* JADX INFO: Access modifiers changed from: package-private */
/* compiled from: PathUtils.kt */
@Metadata(d1 = {"\u0000Ì\u0001\n\u0000\n\u0002\u0010\u000e\n\u0002\u0018\u0002\n\u0002\b\u0017\n\u0002\u0010\u0011\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0007\n\u0002\u0010\u0001\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u000b\n\u0002\b\r\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\u0000\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\"\n\u0002\u0018\u0002\n\u0002\b\n\n\u0002\u0010 \n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010$\n\u0002\b\f\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0004\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\u001a\u0011\u0010\u0016\u001a\u00020\u00022\u0006\u0010\u0017\u001a\u00020\u0001H\u0087\b\u001a*\u0010\u0016\u001a\u00020\u00022\u0006\u0010\u0018\u001a\u00020\u00012\u0012\u0010\u0019\u001a\n\u0012\u0006\b\u0001\u0012\u00020\u00010\u001a\"\u00020\u0001H\u0087\\u0006\u0002\u0010\u001b\u001a?\u0010\u001c\u001a\u00020\u00022\b\u0010\u001d\u001a\u0004\u0018\u00010\u00022\n\b\u0002\u0010\u001e\u001a\u0004\u0018\u00010\u00012\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0007¢\u0006\u0002\u0010!\u001a6\u0010\u001c\u001a\u00020\u00022\n\b\u0002\u0010\u001e\u001a\u0004\u0018\u00010\u00012\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0087\\u0006\u0002\u0010\"\u001aK\u0010#\u001a\u00020\u00022\b\u0010\u001d\u001a\u0004\u0018\u00010\u00022\n\b\u0002\u0010\u001e\u001a\u0004\u0018\u00010\u00012\n\b\u0002\u0010$\u001a\u0004\u0018\u00010\u00012\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0007¢\u0006\u0002\u0010%\u001aB\u0010#\u001a\u00020\u00022\n\b\u0002\u0010\u001e\u001a\u0004\u0018\u00010\u00012\n\b\u0002\u0010$\u001a\u0004\u0018\u00010\u00012\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0087\\u0006\u0002\u0010&\u001a\u001c\u0010'\u001a\u00020(2\u0006\u0010\u0017\u001a\u00020\u00022\n\u0010)\u001a\u0006\u0012\u0002\b\u00030*H\u0001\u001a4\u0010+\u001a\b\u0012\u0004\u0012\u00020\u00020,2\u0017\u0010-\u001a\u0013\u0012\u0004\u0012\u00020/\u0012\u0004\u0012\u0002000.¢\u0006\u0002\b1H\u0007\u0082\u0002\n\n\b\b\u0001\u0012\u0002\u0010\u0001 \u0001\u001a\r\u00102\u001a\u00020\u0002*\u00020\u0002H\u0087\b\u001a\r\u00103\u001a\u00020\u0001*\u00020\u0002H\u0087\b\u001a.\u00104\u001a\u00020\u0002*\u00020\u00022\u0006\u00105\u001a\u00020\u00022\u0012\u00106\u001a\n\u0012\u0006\b\u0001\u0012\u0002070\u001a\"\u000207H\u0087\\u0006\u0002\u00108\u001a\u001f\u00104\u001a\u00020\u0002*\u00020\u00022\u0006\u00105\u001a\u00020\u00022\b\b\u0002\u00109\u001a\u00020:H\u0087\b\u001a.\u0010;\u001a\u00020\u0002*\u00020\u00022\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0087\\u0006\u0002\u0010<\u001a.\u0010=\u001a\u00020\u0002*\u00020\u00022\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0087\\u0006\u0002\u0010<\u001a.\u0010>\u001a\u00020\u0002*\u00020\u00022\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0087\\u0006\u0002\u0010<\u001a\u0015\u0010?\u001a\u00020\u0002*\u00020\u00022\u0006\u00105\u001a\u00020\u0002H\u0087\b\u001a-\u0010@\u001a\u00020\u0002*\u00020\u00022\u001a\u0010\u001f\u001a\u000e\u0012\n\b\u0001\u0012\u0006\u0012\u0002\b\u00030 0\u001a\"\u0006\u0012\u0002\b\u00030 H\u0007¢\u0006\u0002\u0010<\u001a6\u0010A\u001a\u00020\u0002*\u00020\u00022\u0006\u00105\u001a\u00020\u00022\u001a\u0010\u001f\u001a\u
/* loaded from: classes3.dex */
public class PathsKt__PathUtilsKt extends PathsKt__PathRecursiveFunctionsKt {
public static /* synthetic */ void getExtension$annotations(Path path) {
}
@Deprecated(level = DeprecationLevel.ERROR, message = "Use invariantSeparatorsPathString property instead.", replaceWith = @ReplaceWith(expression = "invariantSeparatorsPathString", imports = {}))
public static /* synthetic */ void getInvariantSeparatorsPath$annotations(Path path) {
}
public static /* synthetic */ void getInvariantSeparatorsPathString$annotations(Path path) {
}
public static /* synthetic */ void getName$annotations(Path path) {
}
public static /* synthetic */ void getNameWithoutExtension$annotations(Path path) {
}
public static /* synthetic */ void getPathString$annotations(Path path) {
}
public static final String getName(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
Path fileName = path.getFileName();
String obj = fileName != null ? fileName.toString() : null;
return obj == null ? "" : obj;
}
public static final String getNameWithoutExtension(Path path) {
String obj;
String substringBeforeLast$default;
Intrinsics.checkNotNullParameter(path, "<this>");
Path fileName = path.getFileName();
return (fileName == null || (obj = fileName.toString()) == null || (substringBeforeLast$default = StringsKt.substringBeforeLast$default(obj, ".", (String) null, 2, (Object) null)) == null) ? "" : substringBeforeLast$default;
}
public static final String getExtension(Path path) {
String obj;
String substringAfterLast;
Intrinsics.checkNotNullParameter(path, "<this>");
Path fileName = path.getFileName();
return (fileName == null || (obj = fileName.toString()) == null || (substringAfterLast = StringsKt.substringAfterLast(obj, '.', "")) == null) ? "" : substringAfterLast;
}
private static final String getPathString(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return path.toString();
}
public static final String getInvariantSeparatorsPathString(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
String separator = path.getFileSystem().getSeparator();
if (Intrinsics.areEqual(separator, "/")) {
return path.toString();
}
String obj = path.toString();
Intrinsics.checkNotNull(separator);
return StringsKt.replace$default(obj, separator, "/", false, 4, (Object) null);
}
private static final String getInvariantSeparatorsPath(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return PathsKt.getInvariantSeparatorsPathString(path);
}
private static final Path absolute(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
Path absolutePath = path.toAbsolutePath();
Intrinsics.checkNotNullExpressionValue(absolutePath, "toAbsolutePath(...)");
return absolutePath;
}
private static final String absolutePathString(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return path.toAbsolutePath().toString();
}
public static final Path relativeTo(Path path, Path base) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(base, "base");
try {
return PathRelativizer.INSTANCE.tryRelativeTo(path, base);
} catch (IllegalArgumentException e) {
throw new IllegalArgumentException(e.getMessage() + "\nthis path: " + path + "\nbase path: " + base, e);
}
}
public static final Path relativeToOrSelf(Path path, Path base) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(base, "base");
Path relativeToOrNull = PathsKt.relativeToOrNull(path, base);
return relativeToOrNull == null ? path : relativeToOrNull;
}
public static final Path relativeToOrNull(Path path, Path base) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(base, "base");
try {
return PathRelativizer.INSTANCE.tryRelativeTo(path, base);
} catch (IllegalArgumentException unused) {
return null;
}
}
static /* synthetic */ Path copyTo$default(Path path, Path target, boolean z, int i, Object obj) throws IOException {
if ((i & 2) != 0) {
z = false;
}
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
CopyOption[] copyOptionArr = z ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[0];
Path copy = Files.copy(path, target, (CopyOption[]) Arrays.copyOf(copyOptionArr, copyOptionArr.length));
Intrinsics.checkNotNullExpressionValue(copy, "copy(...)");
return copy;
}
private static final Path copyTo(Path path, Path target, boolean z) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
CopyOption[] copyOptionArr = z ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[0];
Path copy = Files.copy(path, target, (CopyOption[]) Arrays.copyOf(copyOptionArr, copyOptionArr.length));
Intrinsics.checkNotNullExpressionValue(copy, "copy(...)");
return copy;
}
private static final Path copyTo(Path path, Path target, CopyOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
Intrinsics.checkNotNullParameter(options, "options");
Path copy = Files.copy(path, target, (CopyOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(copy, "copy(...)");
return copy;
}
private static final boolean exists(Path path, LinkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
return Files.exists(path, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final boolean notExists(Path path, LinkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
return Files.notExists(path, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final boolean isRegularFile(Path path, LinkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
return Files.isRegularFile(path, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final boolean isDirectory(Path path, LinkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
return Files.isDirectory(path, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final boolean isSymbolicLink(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.isSymbolicLink(path);
}
private static final boolean isExecutable(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.isExecutable(path);
}
private static final boolean isHidden(Path path) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.isHidden(path);
}
private static final boolean isReadable(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.isReadable(path);
}
private static final boolean isWritable(Path path) {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.isWritable(path);
}
private static final boolean isSameFileAs(Path path, Path other) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(other, "other");
return Files.isSameFile(path, other);
}
public static /* synthetic */ List listDirectoryEntries$default(Path path, String str, int i, Object obj) throws IOException {
if ((i & 1) != 0) {
str = "*";
}
return PathsKt.listDirectoryEntries(path, str);
}
public static final List<Path> listDirectoryEntries(Path path, String glob) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(glob, "glob");
DirectoryStream<Path> newDirectoryStream = Files.newDirectoryStream(path, glob);
try {
DirectoryStream<Path> directoryStream = newDirectoryStream;
Intrinsics.checkNotNull(directoryStream);
List<Path> list = CollectionsKt.toList(directoryStream);
CloseableKt.closeFinally(newDirectoryStream, null);
return list;
} finally {
}
}
static /* synthetic */ Object useDirectoryEntries$default(Path path, String glob, Function1 block, int i, Object obj) throws IOException {
if ((i & 1) != 0) {
glob = "*";
}
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(glob, "glob");
Intrinsics.checkNotNullParameter(block, "block");
DirectoryStream<Path> newDirectoryStream = Files.newDirectoryStream(path, glob);
try {
DirectoryStream<Path> directoryStream = newDirectoryStream;
Intrinsics.checkNotNull(directoryStream);
Object invoke = block.invoke(CollectionsKt.asSequence(directoryStream));
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, null);
} else if (newDirectoryStream != null) {
newDirectoryStream.close();
}
InlineMarker.finallyEnd(1);
return invoke;
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, th);
} else if (newDirectoryStream != null) {
try {
newDirectoryStream.close();
} catch (Throwable unused) {
}
}
InlineMarker.finallyEnd(1);
throw th2;
}
}
}
private static final <T> T useDirectoryEntries(Path path, String glob, Function1<? super Sequence<? extends Path>, ? extends T> block) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(glob, "glob");
Intrinsics.checkNotNullParameter(block, "block");
DirectoryStream<Path> newDirectoryStream = Files.newDirectoryStream(path, glob);
try {
DirectoryStream<Path> directoryStream = newDirectoryStream;
Intrinsics.checkNotNull(directoryStream);
T invoke = block.invoke(CollectionsKt.asSequence(directoryStream));
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, null);
} else if (newDirectoryStream != null) {
newDirectoryStream.close();
}
InlineMarker.finallyEnd(1);
return invoke;
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, th);
} else if (newDirectoryStream != null) {
try {
newDirectoryStream.close();
} catch (Throwable unused) {
}
}
InlineMarker.finallyEnd(1);
throw th2;
}
}
}
static /* synthetic */ void forEachDirectoryEntry$default(Path path, String glob, Function1 action, int i, Object obj) throws IOException {
if ((i & 1) != 0) {
glob = "*";
}
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(glob, "glob");
Intrinsics.checkNotNullParameter(action, "action");
DirectoryStream<Path> newDirectoryStream = Files.newDirectoryStream(path, glob);
try {
DirectoryStream<Path> directoryStream = newDirectoryStream;
Intrinsics.checkNotNull(directoryStream);
Iterator<Path> it = directoryStream.iterator();
while (it.hasNext()) {
action.invoke(it.next());
}
Unit unit = Unit.INSTANCE;
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, null);
} else if (newDirectoryStream != null) {
newDirectoryStream.close();
}
InlineMarker.finallyEnd(1);
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, th);
} else if (newDirectoryStream != null) {
try {
newDirectoryStream.close();
} catch (Throwable unused) {
}
}
InlineMarker.finallyEnd(1);
throw th2;
}
}
}
private static final void forEachDirectoryEntry(Path path, String glob, Function1<? super Path, Unit> action) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(glob, "glob");
Intrinsics.checkNotNullParameter(action, "action");
DirectoryStream<Path> newDirectoryStream = Files.newDirectoryStream(path, glob);
try {
DirectoryStream<Path> directoryStream = newDirectoryStream;
Intrinsics.checkNotNull(directoryStream);
Iterator<Path> it = directoryStream.iterator();
while (it.hasNext()) {
action.invoke(it.next());
}
Unit unit = Unit.INSTANCE;
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, null);
} else if (newDirectoryStream != null) {
newDirectoryStream.close();
}
InlineMarker.finallyEnd(1);
} catch (Throwable th) {
try {
throw th;
} catch (Throwable th2) {
InlineMarker.finallyStart(1);
if (PlatformImplementationsKt.apiVersionIsAtLeast(1, 1, 0)) {
CloseableKt.closeFinally(newDirectoryStream, th);
} else if (newDirectoryStream != null) {
try {
newDirectoryStream.close();
} catch (Throwable unused) {
}
}
InlineMarker.finallyEnd(1);
throw th2;
}
}
}
private static final long fileSize(Path path) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.size(path);
}
private static final void deleteExisting(Path path) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Files.delete(path);
}
private static final boolean deleteIfExists(Path path) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
return Files.deleteIfExists(path);
}
private static final Path createDirectory(Path path, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createDirectory = Files.createDirectory(path, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createDirectory, "createDirectory(...)");
return createDirectory;
}
private static final Path createDirectories(Path path, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createDirectories = Files.createDirectories(path, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createDirectories, "createDirectories(...)");
return createDirectories;
}
public static final Path createParentDirectories(Path path, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path parent = path.getParent();
if (parent != null && !Files.isDirectory(parent, (LinkOption[]) Arrays.copyOf(new LinkOption[0], 0))) {
try {
FileAttribute[] fileAttributeArr = (FileAttribute[]) Arrays.copyOf(attributes, attributes.length);
Intrinsics.checkNotNullExpressionValue(Files.createDirectories(parent, (FileAttribute[]) Arrays.copyOf(fileAttributeArr, fileAttributeArr.length)), "createDirectories(...)");
} catch (FileAlreadyExistsException e) {
if (!Files.isDirectory(parent, (LinkOption[]) Arrays.copyOf(new LinkOption[0], 0))) {
throw e;
}
}
}
return path;
}
private static final Path moveTo(Path path, Path target, CopyOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
Intrinsics.checkNotNullParameter(options, "options");
Path move = Files.move(path, target, (CopyOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(move, "move(...)");
return move;
}
static /* synthetic */ Path moveTo$default(Path path, Path target, boolean z, int i, Object obj) throws IOException {
if ((i & 2) != 0) {
z = false;
}
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
CopyOption[] copyOptionArr = z ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[0];
Path move = Files.move(path, target, (CopyOption[]) Arrays.copyOf(copyOptionArr, copyOptionArr.length));
Intrinsics.checkNotNullExpressionValue(move, "move(...)");
return move;
}
private static final Path moveTo(Path path, Path target, boolean z) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
CopyOption[] copyOptionArr = z ? new CopyOption[]{StandardCopyOption.REPLACE_EXISTING} : new CopyOption[0];
Path move = Files.move(path, target, (CopyOption[]) Arrays.copyOf(copyOptionArr, copyOptionArr.length));
Intrinsics.checkNotNullExpressionValue(move, "move(...)");
return move;
}
private static final FileStore fileStore(Path path) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
FileStore fileStore = Files.getFileStore(path);
Intrinsics.checkNotNullExpressionValue(fileStore, "getFileStore(...)");
return fileStore;
}
private static final Object getAttribute(Path path, String attribute, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attribute, "attribute");
Intrinsics.checkNotNullParameter(options, "options");
return Files.getAttribute(path, attribute, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final Path setAttribute(Path path, String attribute, Object obj, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attribute, "attribute");
Intrinsics.checkNotNullParameter(options, "options");
Path attribute2 = Files.setAttribute(path, attribute, obj, (LinkOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(attribute2, "setAttribute(...)");
return attribute2;
}
private static final /* synthetic */ <V extends FileAttributeView> V fileAttributesViewOrNull(Path path, LinkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
Intrinsics.reifiedOperationMarker(4, ExifInterface.GPS_MEASUREMENT_INTERRUPTED);
return (V) Files.getFileAttributeView(path, FileAttributeView.class, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final /* synthetic */ <V extends FileAttributeView> V fileAttributesView(Path path, LinkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
Intrinsics.reifiedOperationMarker(4, ExifInterface.GPS_MEASUREMENT_INTERRUPTED);
V v = (V) Files.getFileAttributeView(path, FileAttributeView.class, (LinkOption[]) Arrays.copyOf(options, options.length));
if (v != null) {
return v;
}
Intrinsics.reifiedOperationMarker(4, ExifInterface.GPS_MEASUREMENT_INTERRUPTED);
PathsKt.fileAttributeViewNotAvailable(path, FileAttributeView.class);
throw new KotlinNothingValueException();
}
public static final Void fileAttributeViewNotAvailable(Path path, Class<?> attributeViewClass) {
Intrinsics.checkNotNullParameter(path, "path");
Intrinsics.checkNotNullParameter(attributeViewClass, "attributeViewClass");
throw new UnsupportedOperationException("The desired attribute view type " + attributeViewClass + " is not available for the file " + path + '.');
}
private static final /* synthetic */ <A extends BasicFileAttributes> A readAttributes(Path path, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
Intrinsics.reifiedOperationMarker(4, ExifInterface.GPS_MEASUREMENT_IN_PROGRESS);
A a = (A) Files.readAttributes(path, BasicFileAttributes.class, (LinkOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(a, "readAttributes(...)");
return a;
}
private static final Map<String, Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attributes, "attributes");
Intrinsics.checkNotNullParameter(options, "options");
Map<String, Object> readAttributes = Files.readAttributes(path, attributes, (LinkOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(readAttributes, "readAttributes(...)");
return readAttributes;
}
private static final FileTime getLastModifiedTime(Path path, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
FileTime lastModifiedTime = Files.getLastModifiedTime(path, (LinkOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(lastModifiedTime, "getLastModifiedTime(...)");
return lastModifiedTime;
}
private static final Path setLastModifiedTime(Path path, FileTime value) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(value, "value");
Path lastModifiedTime = Files.setLastModifiedTime(path, value);
Intrinsics.checkNotNullExpressionValue(lastModifiedTime, "setLastModifiedTime(...)");
return lastModifiedTime;
}
private static final UserPrincipal getOwner(Path path, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
return Files.getOwner(path, (LinkOption[]) Arrays.copyOf(options, options.length));
}
private static final Path setOwner(Path path, UserPrincipal value) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(value, "value");
Path owner = Files.setOwner(path, value);
Intrinsics.checkNotNullExpressionValue(owner, "setOwner(...)");
return owner;
}
private static final Set<PosixFilePermission> getPosixFilePermissions(Path path, LinkOption... options) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
Set<PosixFilePermission> posixFilePermissions = Files.getPosixFilePermissions(path, (LinkOption[]) Arrays.copyOf(options, options.length));
Intrinsics.checkNotNullExpressionValue(posixFilePermissions, "getPosixFilePermissions(...)");
return posixFilePermissions;
}
private static final Path setPosixFilePermissions(Path path, Set<? extends PosixFilePermission> value) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(value, "value");
Path posixFilePermissions = Files.setPosixFilePermissions(path, value);
Intrinsics.checkNotNullExpressionValue(posixFilePermissions, "setPosixFilePermissions(...)");
return posixFilePermissions;
}
private static final Path createLinkPointingTo(Path path, Path target) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
Path createLink = Files.createLink(path, target);
Intrinsics.checkNotNullExpressionValue(createLink, "createLink(...)");
return createLink;
}
private static final Path createSymbolicLinkPointingTo(Path path, Path target, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(target, "target");
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createSymbolicLink = Files.createSymbolicLink(path, target, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createSymbolicLink, "createSymbolicLink(...)");
return createSymbolicLink;
}
private static final Path readSymbolicLink(Path path) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Path readSymbolicLink = Files.readSymbolicLink(path);
Intrinsics.checkNotNullExpressionValue(readSymbolicLink, "readSymbolicLink(...)");
return readSymbolicLink;
}
private static final Path createFile(Path path, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createFile = Files.createFile(path, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createFile, "createFile(...)");
return createFile;
}
static /* synthetic */ Path createTempFile$default(String str, String str2, FileAttribute[] attributes, int i, Object obj) throws IOException {
if ((i & 1) != 0) {
str = null;
}
if ((i & 2) != 0) {
str2 = null;
}
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createTempFile = Files.createTempFile(str, str2, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempFile, "createTempFile(...)");
return createTempFile;
}
private static final Path createTempFile(String str, String str2, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createTempFile = Files.createTempFile(str, str2, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempFile, "createTempFile(...)");
return createTempFile;
}
public static /* synthetic */ Path createTempFile$default(Path path, String str, String str2, FileAttribute[] fileAttributeArr, int i, Object obj) throws IOException {
if ((i & 2) != 0) {
str = null;
}
if ((i & 4) != 0) {
str2 = null;
}
return PathsKt.createTempFile(path, str, str2, fileAttributeArr);
}
public static final Path createTempFile(Path path, String str, String str2, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(attributes, "attributes");
if (path != null) {
Path createTempFile = Files.createTempFile(path, str, str2, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempFile, "createTempFile(...)");
return createTempFile;
}
Path createTempFile2 = Files.createTempFile(str, str2, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempFile2, "createTempFile(...)");
return createTempFile2;
}
static /* synthetic */ Path createTempDirectory$default(String str, FileAttribute[] attributes, int i, Object obj) throws IOException {
if ((i & 1) != 0) {
str = null;
}
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createTempDirectory = Files.createTempDirectory(str, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempDirectory, "createTempDirectory(...)");
return createTempDirectory;
}
private static final Path createTempDirectory(String str, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(attributes, "attributes");
Path createTempDirectory = Files.createTempDirectory(str, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempDirectory, "createTempDirectory(...)");
return createTempDirectory;
}
public static /* synthetic */ Path createTempDirectory$default(Path path, String str, FileAttribute[] fileAttributeArr, int i, Object obj) throws IOException {
if ((i & 2) != 0) {
str = null;
}
return PathsKt.createTempDirectory(path, str, fileAttributeArr);
}
public static final Path createTempDirectory(Path path, String str, FileAttribute<?>... attributes) throws IOException {
Intrinsics.checkNotNullParameter(attributes, "attributes");
if (path != null) {
Path createTempDirectory = Files.createTempDirectory(path, str, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempDirectory, "createTempDirectory(...)");
return createTempDirectory;
}
Path createTempDirectory2 = Files.createTempDirectory(str, (FileAttribute[]) Arrays.copyOf(attributes, attributes.length));
Intrinsics.checkNotNullExpressionValue(createTempDirectory2, "createTempDirectory(...)");
return createTempDirectory2;
}
private static final Path div(Path path, Path other) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(other, "other");
Path resolve = path.resolve(other);
Intrinsics.checkNotNullExpressionValue(resolve, "resolve(...)");
return resolve;
}
private static final Path div(Path path, String other) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(other, "other");
Path resolve = path.resolve(other);
Intrinsics.checkNotNullExpressionValue(resolve, "resolve(...)");
return resolve;
}
private static final Path Path(String path) {
Intrinsics.checkNotNullParameter(path, "path");
Path path2 = Paths.get(path, new String[0]);
Intrinsics.checkNotNullExpressionValue(path2, "get(...)");
return path2;
}
private static final Path Path(String base, String... subpaths) {
Intrinsics.checkNotNullParameter(base, "base");
Intrinsics.checkNotNullParameter(subpaths, "subpaths");
Path path = Paths.get(base, (String[]) Arrays.copyOf(subpaths, subpaths.length));
Intrinsics.checkNotNullExpressionValue(path, "get(...)");
return path;
}
private static final Path toPath(URI uri) {
Intrinsics.checkNotNullParameter(uri, "<this>");
Path path = Paths.get(uri);
Intrinsics.checkNotNullExpressionValue(path, "get(...)");
return path;
}
public static final Sequence<Path> walk(Path path, PathWalkOption... options) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(options, "options");
return new PathTreeWalk(path, options);
}
public static /* synthetic */ void visitFileTree$default(Path path, FileVisitor fileVisitor, int i, boolean z, int i2, Object obj) {
if ((i2 & 2) != 0) {
i = Integer.MAX_VALUE;
}
if ((i2 & 4) != 0) {
z = false;
}
PathsKt.visitFileTree(path, (FileVisitor<Path>) fileVisitor, i, z);
}
public static final void visitFileTree(Path path, FileVisitor<Path> visitor, int i, boolean z) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(visitor, "visitor");
Files.walkFileTree(path, z ? SetsKt.setOf(FileVisitOption.FOLLOW_LINKS) : SetsKt.emptySet(), i, visitor);
}
public static /* synthetic */ void visitFileTree$default(Path path, int i, boolean z, Function1 function1, int i2, Object obj) {
if ((i2 & 1) != 0) {
i = Integer.MAX_VALUE;
}
if ((i2 & 2) != 0) {
z = false;
}
PathsKt.visitFileTree(path, i, z, (Function1<? super FileVisitorBuilder, Unit>) function1);
}
public static final void visitFileTree(Path path, int i, boolean z, Function1<? super FileVisitorBuilder, Unit> builderAction) {
Intrinsics.checkNotNullParameter(path, "<this>");
Intrinsics.checkNotNullParameter(builderAction, "builderAction");
PathsKt.visitFileTree(path, PathsKt.fileVisitor(builderAction), i, z);
}
public static final FileVisitor<Path> fileVisitor(Function1<? super FileVisitorBuilder, Unit> builderAction) {
Intrinsics.checkNotNullParameter(builderAction, "builderAction");
FileVisitorBuilderImpl fileVisitorBuilderImpl = new FileVisitorBuilderImpl();
builderAction.invoke(fileVisitorBuilderImpl);
return fileVisitorBuilderImpl.build();
}
}