package net.northking.cctp.upperComputer.driver.adb;

/**
 * 设备文件（夹）记录
 */
public class RemoteFileRecord {

    /**
     * 文件路径
     */
    String path;

    /**
     * 权限标记
     */
    int mode;

    /**
     * 文件大小
     */
    int size;

    /**
     * 最后修改时间（精度：秒）
     */
    int lastModified;

    public RemoteFileRecord() {
    }

    public RemoteFileRecord(String path, int mode, int size, int lastModified) {
        this.path = path;
        this.mode = mode;
        this.size = size;
        this.lastModified = lastModified;
    }

    /**
     * 是否是文件夹
     *
     * @return 是否是文件夹
     */
    public boolean isDirectory() {
        return (mode & (1 << 14)) == (1 << 14);
    }

    @Override
    public String toString() {
        return "RemoteFileRecord{" +
                "path='" + path + '\'' +
                ", mode=" + mode +
                ", size=" + size +
                ", lastModified=" + lastModified +
                '}';
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public int getMode() {
        return mode;
    }

    public void setMode(int mode) {
        this.mode = mode;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public int getLastModified() {
        return lastModified;
    }

    public void setLastModified(int lastModified) {
        this.lastModified = lastModified;
    }
}
