1
81041
2019-06-20 ab3c4acf83f54f8449ca8664c4a2bb79bd30f297
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package com.fgkj.dto;
 
import java.io.File;
 
public class MyFile {
    private File file;
    private String fileName;        //文件名称
    private String filePath;        //文件路径
    private String fileType;        //文件类型
    private ImageSize ims;          //图片
    
    public void initFile(){
        this.fileName = file.getName();
        this.filePath = file.getAbsolutePath();
        this.fileType = getFileTypeFromFile(this.file);
    }
    
    public String getFileTypeFromFile(File source){
        String[] str = source.getAbsolutePath().split("\\.");
        return str[str.length-1];
    }
    
    public File getFile() {
        return file;
    }
    public void setFile(File file) {
        this.file = file;
        initFile();
    }
    public String getFileName() {
        return fileName;
    }
    public void setFileName(String fileName) {
        this.fileName = fileName;
    }
    public String getFilePath() {
        return filePath;
    }
    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }
    public String getFileType() {
        return fileType;
    }
    public void setFileType(String fileType) {
        this.fileType = fileType;
    }
    
    
    public ImageSize getIms() {
        return ims;
    }
 
    public void setIms(ImageSize ims) {
        this.ims = ims;
    }
 
    @Override
    public String toString() {
        return "MyFile [file=" + file + ", fileName=" + fileName + ", filePath=" + filePath + ", fileType=" + fileType
                + ", ims=" + ims + "]";
    }
 
    
 
}