FileInfo.java 2.22 KB
package com.glsx.commonres.file;

/**
 * Author by zh, Date on 2022/3/2.
 * PS: write a bug or more,please indicate.
 * 文件信息封装
 */
public class FileInfo {

    public String name;
    public String path;
    public String size;
    public String sduration;
    public boolean selected;
    public int fileType = 0;
    public boolean isDirectory;
    public long modifytime;
    public long lsize = 0;
    public int width;
    public int height;
    public int duration;
    public boolean downloading = false;
    public int downloadProgress = 0;
    public int sub = 0;
    public String url = null;
    public String thunbnailUrl = null;
    public int headerId;
    public String address;
    public boolean isRemoteFile = false;//是否为远程文件(非手机文件),用于区分打开文件的时候
    public String remoteBeginTime;//用于显示远程文件的创建时间 格式:yy-MM-dd HH:mm:ss
    public String remoteEndTime;//用于显示远程回看文件的创建时间 格式:yy-MM-dd HH:mm:ss
    public String downLoadUrl;//用于给远程模式下文件下载的
    public int cameraId;
    public FileInfo() {

    }

    public FileInfo(String name, boolean isDirectory) {
        this.name = name;
        this.isDirectory = isDirectory;
        this.selected = false;
    }

    public String getUrl() {
        if (url != null)
            return url;
        else
            return getFullPath();
    }

    public String getThunbnailUrl() {
        if (thunbnailUrl != null)
            return thunbnailUrl;
        else
            return getFullPath();
    }

    public int getHeaderId() {
        return headerId;
    }

    public void setHeaderId(int headerId) {
        this.headerId = headerId;
    }

    public String getFullPath() {
        return path + name;
    }

    /**
     * eg:"test.txt"  return "text"
     */
    public String getMainName() {
        return null;
        // return NetUtil.getMainName(name);
    }

    public long getModifytime() {
        return modifytime;
    }

    @Override
    public String toString() {
        return "path:" + path + ", name:" + name + ", lsize:" + lsize + ",isDirectory:" + isDirectory
                + ",modifytime=" + modifytime + ",sub:" + sub;
    }
}