package com.datarecovery.master.utils.filedetect;


import android.net.Uri;

import com.datarecovery.master.utils.FileUtil;
import com.datarecovery.master.utils.xfile.XFile;

public class DetectFile {

    private XFile xFile;
    @FileType
    private int fileType;
    private String name;

    private long size;
    private String sizeDescribe;
    private Uri uri;
    private String path;
    private long lastModified;

    public DetectFile(XFile xFile, @FileType int fileType) {
        this.xFile = xFile;
        this.fileType = fileType;
        try {
            this.name = xFile.getName();
        } catch (Exception ignore) {
        }
        try {
            this.size = xFile.length();
        } catch (Exception ignore) {
        }
        try {
            this.uri = xFile.getUri();
        } catch (Exception ignore) {
        }
        try {
            this.path = xFile.getPath();
        } catch (Exception ignore) {
        }
        try {
            this.lastModified = xFile.lastModified();
        } catch (Exception ignore) {
        }
        this.sizeDescribe = FileUtil.formatShortBytes(this.size);
    }

    @FileType
    public int getFileType() {
        return fileType;
    }

    public void setFileType(@FileType int fileType) {
        this.fileType = fileType;
    }


    public XFile getxFile() {
        return xFile;
    }

    public String getName() {
        return name;
    }

    public long getSize() {
        return size;
    }

    public String getSizeDescribe() {
        return sizeDescribe;
    }

    public Uri getUri() {
        return uri;
    }

    public String getPath() {
        return path;
    }

    public long getLastModified() {
        return lastModified;
    }
}
