package com.mstar.android.samba;

import java.net.MalformedURLException;
import k1.V;
import k1.W;

/* JADX INFO: loaded from: classes.dex */
public class SambaFile {
    W file;

    public SambaFile() {
    }

    public boolean canRead() {
        try {
            return this.file.b();
        } catch (V e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean canWrite() {
        try {
            return this.file.c();
        } catch (V e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public String getFileName() {
        String strS = this.file.s();
        int iLastIndexOf = strS.lastIndexOf(47);
        return iLastIndexOf > 0 ? strS.substring(0, iLastIndexOf) : strS;
    }

    public long getLength() throws SambaException {
        try {
            return this.file.I();
        } catch (V e2) {
            throw new SambaException(e2);
        }
    }

    public String getPath() {
        return this.file.v();
    }

    public boolean isDirectory() throws SambaException {
        try {
            return this.file.C();
        } catch (V e2) {
            throw new SambaException(e2);
        }
    }

    public boolean isExists() {
        try {
            return this.file.p();
        } catch (V e2) {
            e2.printStackTrace();
            return false;
        }
    }

    public boolean isFile() throws SambaException {
        try {
            return this.file.D();
        } catch (V e2) {
            throw new SambaException(e2);
        }
    }

    public SambaFile(String str) throws SambaException, MalformedURLException {
        if (str == null) {
            throw new SambaException(2);
        }
        W w2 = new W(str);
        this.file = w2;
        try {
            int iY = w2.y();
            if (iY == 1 && iY == 4 && iY == 8) {
            } else {
                throw new SambaException(3);
            }
        } catch (V e2) {
            throw new SambaException(e2);
        }
    }
}
