OpenConcerto

Dépôt officiel du code source de l'ERP OpenConcerto
sonarqube

svn://code.openconcerto.org/openconcerto

Rev

Rev 156 | Rev 182 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 156 Rev 180
Line 27... Line 27...
27
    private String storagePath;
27
    private String storagePath;
28
    private String storageFileName;
28
    private String storageFileName;
29
    private String sourceTable;
29
    private String sourceTable;
30
    private int sourceId;
30
    private int sourceId;
31
    private int parentId;
31
    private int parentId;
32
 
-
 
-
 
32
    private boolean encrypted;
33
    public static final String MIMETYPE_FOLDER = "inode/directory";
33
    public static final String MIMETYPE_FOLDER = "inode/directory";
34
 
34
 
35
    public Attachment(SQLRowValues rowAttachment) {
35
    public Attachment(SQLRowValues rowAttachment) {
36
        this.id = rowAttachment.getID();
36
        this.id = rowAttachment.getID();
37
        this.name = rowAttachment.getString("NAME");
37
        this.name = rowAttachment.getString("NAME");
Line 41... Line 41...
41
        this.storagePath = rowAttachment.getString("STORAGE_PATH").replace('\\', File.separatorChar);
41
        this.storagePath = rowAttachment.getString("STORAGE_PATH").replace('\\', File.separatorChar);
42
        this.storageFileName = rowAttachment.getString("STORAGE_FILENAME");
42
        this.storageFileName = rowAttachment.getString("STORAGE_FILENAME");
43
        this.sourceTable = rowAttachment.getString("SOURCE_TABLE");
43
        this.sourceTable = rowAttachment.getString("SOURCE_TABLE");
44
        this.sourceId = rowAttachment.getInt("SOURCE_ID");
44
        this.sourceId = rowAttachment.getInt("SOURCE_ID");
45
        this.parentId = rowAttachment.getInt("ID_PARENT");
45
        this.parentId = rowAttachment.getInt("ID_PARENT");
-
 
46
        this.encrypted = rowAttachment.getBoolean("ENCRYPTED");
46
    }
47
    }
47
 
48
 
48
    public int getId() {
49
    public int getId() {
49
        return id;
50
        return this.id;
50
    }
51
    }
51
 
52
 
52
    public String getName() {
53
    public String getName() {
53
        return name;
54
        return this.name;
54
    }
55
    }
55
 
56
 
56
    public void setName(String newName) {
57
    public void setName(String newName) {
57
        this.name = newName;
58
        this.name = newName;
58
    }
59
    }
59
 
60
 
60
    public String getMimeType() {
61
    public String getMimeType() {
61
        return mimeType;
62
        return this.mimeType;
62
    }
63
    }
63
 
64
 
64
    public String getFileName() {
65
    public String getFileName() {
65
        return fileName;
66
        return this.fileName;
66
    }
67
    }
67
 
68
 
68
    public int getFileSize() {
69
    public int getFileSize() {
69
        return fileSize;
70
        return this.fileSize;
70
    }
71
    }
71
 
72
 
72
    public String getStorageFileName() {
73
    public String getStorageFileName() {
73
        return storageFileName;
74
        return this.storageFileName;
74
    }
75
    }
75
 
76
 
76
    public String getStoragePath() {
77
    public String getStoragePath() {
77
        return storagePath;
78
        return this.storagePath;
78
    }
79
    }
79
 
80
 
80
    public String getSourceTable() {
81
    public String getSourceTable() {
81
        return sourceTable;
82
        return this.sourceTable;
82
    }
83
    }
83
 
84
 
84
    public int getSourceId() {
85
    public int getSourceId() {
85
        return sourceId;
86
        return this.sourceId;
86
    }
87
    }
87
 
88
 
88
    public int getParentId() {
89
    public int getParentId() {
89
        return parentId;
90
        return this.parentId;
90
    }
91
    }
91
 
92
 
92
    public boolean isFolder() {
93
    public boolean isFolder() {
93
        return this.mimeType.equals(MIMETYPE_FOLDER);
94
        return this.mimeType.equals(MIMETYPE_FOLDER);
94
    }
95
    }
95
 
96
 
-
 
97
    public boolean isEncrypted() {
-
 
98
        return this.encrypted;
-
 
99
    }
-
 
100
 
96
    @Override
101
    @Override
97
    public String toString() {
102
    public String toString() {
98
        return super.toString() + " attachment id:" + this.getId() + " name:" + this.getName();
103
        return super.toString() + " attachment id:" + this.getId() + " name:" + this.getName();
99
    }
104
    }
100
 
105