package o;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.FileSystemException;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.NoSuchFileException;
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.FileTime;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.jS, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final class C1574jS extends C2704vJ {
    public static Long l(FileTime fileTime) {
        long millis = fileTime.toMillis();
        Long lValueOf = Long.valueOf(millis);
        if (millis != 0) {
            return lValueOf;
        }
        return null;
    }

    @Override // o.C2704vJ, o.AbstractC1628jy
    public final void b(SV sv, SV sv2) throws IOException {
        try {
            Files.move(Paths.get(sv.l.n(), new String[0]), Paths.get(sv2.l.n(), new String[0]), StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING);
        } catch (UnsupportedOperationException unused) {
            throw new IOException("atomic move not supported");
        } catch (NoSuchFileException e) {
            throw new FileNotFoundException(e.getMessage());
        }
    }

    @Override // o.C2704vJ, o.AbstractC1628jy
    public final C3135zr h(SV sv) throws IOException {
        SV svD;
        Path path = Paths.get(sv.l.n(), new String[0]);
        try {
            BasicFileAttributes attributes = Files.readAttributes(path, (Class<BasicFileAttributes>) BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS);
            Path symbolicLink = attributes.isSymbolicLink() ? Files.readSymbolicLink(path) : null;
            boolean zIsRegularFile = attributes.isRegularFile();
            boolean zIsDirectory = attributes.isDirectory();
            if (symbolicLink != null) {
                String str = SV.m;
                String string = symbolicLink.toString();
                C0135Ff c0135Ff = AbstractC1153f.a;
                C0732af c0732af = new C0732af();
                c0732af.V(string);
                svD = AbstractC1153f.d(c0732af, false);
            } else {
                svD = null;
            }
            Long lValueOf = Long.valueOf(attributes.size());
            FileTime fileTimeCreationTime = attributes.creationTime();
            Long l = fileTimeCreationTime != null ? l(fileTimeCreationTime) : null;
            FileTime fileTimeLastModifiedTime = attributes.lastModifiedTime();
            Long l2 = fileTimeLastModifiedTime != null ? l(fileTimeLastModifiedTime) : null;
            FileTime fileTimeLastAccessTime = attributes.lastAccessTime();
            return new C3135zr(zIsRegularFile, zIsDirectory, svD, lValueOf, l, l2, fileTimeLastAccessTime != null ? l(fileTimeLastAccessTime) : null);
        } catch (NoSuchFileException | FileSystemException unused) {
            return null;
        }
    }

    @Override // o.C2704vJ
    public final String toString() {
        return "NioSystemFileSystem";
    }
}
