Parent: [0acb23] (diff)

Download this file

CSVEntry.java    238 lines (186 with data), 6.1 kB

  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
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/**
* Copyright (c) 2013/2014 Verein zur Foerderung der IT-Sicherheit in Oesterreich (SBA).
* The work has been developed in the TIMBUS Project and the above-mentioned are Members of the TIMBUS Consortium.
* TIMBUS is supported by the European Union under the 7th Framework Programme for research and technological
* development and demonstration activities (FP7/2007-2013) under grant agreement no. 269940.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including without
* limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTIBITLY, or FITNESS FOR A PARTICULAR
* PURPOSE. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise,
* unless required by applicable law or agreed to in writing, shall any Contributor be liable for damages, including
* any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this
* License or out of the use or inability to use the Work.
* See the License for the specific language governing permissions and limitation under the License.
*/
package net.timbusproject.extractors.modules.tavernaextractor;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class CSVEntry {
private String ID;
private String PARENT_ID;
private String URI;
private String FILE_PATH;
private String NAME;
private String METHOD;
private String STATUS;
private String SIZE;
private String TYPE;
private String EXT;
private String LAST_MODIFIED;
private String EXTENSION_MISMATCH;
private String MD5_HASH;
private String FORMAT_COUNT;
private String PUID;
private String MIME_TYPE;
private String FORMAT_NAME;
private String FORMAT_VERSION;
public CSVEntry() {
}
public String getID() {
return ID;
}
public void setID(String iD) {
ID = iD;
}
public String getPARENT_ID() {
return PARENT_ID;
}
public void setPARENT_ID(String pARENT_ID) {
PARENT_ID = pARENT_ID;
}
public String getURI() {
return URI;
}
public void setURI(String uRI) {
URI = uRI;
}
public String getFILE_PATH() {
return FILE_PATH;
}
public void setFILE_PATH(String fILE_PATH) {
FILE_PATH = fILE_PATH;
}
public String getNAME() {
return NAME;
}
public void setNAME(String nAME) {
NAME = nAME;
// customize name
// int beginIndex = nAME.indexOf("[");
// int endIndex = nAME.indexOf("]");
//
// if (beginIndex > 0 && endIndex > beginIndex) {
// NAME = nAME.substring(beginIndex + 1, endIndex);
// } else {
// NAME = nAME;
// }
}
public String getMETHOD() {
return METHOD;
}
public void setMETHOD(String mETHOD) {
METHOD = mETHOD;
}
public String getSTATUS() {
return STATUS;
}
public void setSTATUS(String sTATUS) {
STATUS = sTATUS;
}
public String getSIZE() {
return SIZE;
}
public void setSIZE(String sIZE) {
SIZE = sIZE;
}
public String getTYPE() {
return TYPE;
}
public void setTYPE(String tYPE) {
TYPE = tYPE;
}
public String getEXT() {
return EXT;
}
public void setEXT(String eXT) {
EXT = eXT;
}
public String getLAST_MODIFIED() {
return LAST_MODIFIED;
}
public void setLAST_MODIFIED(String lAST_MODIFIED) {
LAST_MODIFIED = lAST_MODIFIED;
}
public String getEXTENSION_MISMATCH() {
return EXTENSION_MISMATCH;
}
public void setEXTENSION_MISMATCH(String eXTENSION_MISMATCH) {
EXTENSION_MISMATCH = eXTENSION_MISMATCH;
}
public String getMD5_HASH() {
return MD5_HASH;
}
public void setMD5_HASH(String mD5_HASH) {
MD5_HASH = mD5_HASH;
}
public String getFORMAT_COUNT() {
return FORMAT_COUNT;
}
public void setFORMAT_COUNT(String fORMAT_COUNT) {
FORMAT_COUNT = fORMAT_COUNT;
}
public String getPUID() {
return PUID.replace("\"", "");
}
public void setPUID(String pUID) {
PUID = pUID;
}
public String getMIME_TYPE() {
return MIME_TYPE;
}
public void setMIME_TYPE(String mIME_TYPE) {
MIME_TYPE = mIME_TYPE;
}
public String getFORMAT_NAME() {
return FORMAT_NAME.replace("\"", "");
}
public void setFORMAT_NAME(String fORMAT_NAME) {
FORMAT_NAME = fORMAT_NAME;
}
public String getFORMAT_VERSION() {
return FORMAT_VERSION.replace("\"", "");
}
public void setFORMAT_VERSION(String fORMAT_VERSION) {
FORMAT_VERSION = fORMAT_VERSION;
}
public String getNameForExtensionUsage(){
String _name = "EMPTY";
//only retrieve the port name part
// [processorName][portName]-randomNumber.file -> portName
Matcher m = Pattern.compile("\\[[^\\]]*\\]").matcher(NAME);
int group = 0;
while(m.find()) {
if(group == 1) {
_name = m.group().replaceAll("\\[", "").replaceAll("\\]","");
return _name;
}
group++;
}
return _name;
}
@Override
public String toString() {
return "CSV [NAME=" + NAME + ",PUID=" + PUID + ",FORMAT_NAME=" + FORMAT_NAME + "]";
}
@Override
public boolean equals(Object other) {
CSVEntry otherEntry = (CSVEntry) other;
if (this.getNAME().equals(otherEntry.getNAME()) && this.getPUID().equals(otherEntry.getPUID())) {
return true;
}
return false;
}
}