Switch to unified view

a/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/CSVEntry.java b/src/main/java/net/timbusproject/extractors/modules/tavernaextractor/CSVEntry.java
...
...
15
 * License or out of the use or inability to use the Work.
15
 * License or out of the use or inability to use the Work.
16
 * See the License for the specific language governing permissions and limitation under the License.
16
 * See the License for the specific language governing permissions and limitation under the License.
17
 */
17
 */
18
18
19
package net.timbusproject.extractors.modules.tavernaextractor;
19
package net.timbusproject.extractors.modules.tavernaextractor;
20
21
import java.util.regex.Matcher;
22
import java.util.regex.Pattern;
20
23
21
public class CSVEntry {
24
public class CSVEntry {
22
25
23
    private String ID;
26
    private String ID;
24
    private String PARENT_ID;
27
    private String PARENT_ID;
...
...
78
        return NAME;
81
        return NAME;
79
    }
82
    }
80
83
81
    public void setNAME(String nAME) {
84
    public void setNAME(String nAME) {
82
85
86
        NAME = nAME;
87
83
        // customize name
88
        // customize name
84
        int beginIndex = nAME.indexOf("[");
89
//        int beginIndex = nAME.indexOf("[");
85
        int endIndex = nAME.indexOf("]");
90
//        int endIndex = nAME.indexOf("]");
86
91
//
87
        if (beginIndex > 0 && endIndex > beginIndex) {
92
//        if (beginIndex > 0 && endIndex > beginIndex) {
88
            NAME = nAME.substring(beginIndex + 1, endIndex);
93
//            NAME = nAME.substring(beginIndex + 1, endIndex);
89
        } else {
94
//        } else {
90
            NAME = nAME;
95
//            NAME = nAME;
91
        }
96
//        }
92
    }
97
    }
93
98
94
    public String getMETHOD() {
99
    public String getMETHOD() {
95
        return METHOD;
100
        return METHOD;
96
    }
101
    }
...
...
191
        return FORMAT_VERSION.replace("\"", "");
196
        return FORMAT_VERSION.replace("\"", "");
192
    }
197
    }
193
198
194
    public void setFORMAT_VERSION(String fORMAT_VERSION) {
199
    public void setFORMAT_VERSION(String fORMAT_VERSION) {
195
        FORMAT_VERSION = fORMAT_VERSION;
200
        FORMAT_VERSION = fORMAT_VERSION;
201
    }
202
203
    public String getNameForExtensionUsage(){
204
205
        String _name = "EMPTY";
206
207
        //only retrieve the port name part
208
        // [processorName][portName]-randomNumber.file -> portName
209
210
        Matcher m = Pattern.compile("\\[[^\\]]*\\]").matcher(NAME);
211
        int group = 0;
212
        while(m.find()) {
213
            if(group == 1) {
214
                _name = m.group().replaceAll("\\[", "").replaceAll("\\]","");
215
                return _name;
216
            }
217
            group++;
218
        }
219
        return _name;
196
    }
220
    }
197
221
198
    @Override
222
    @Override
199
    public String toString() {
223
    public String toString() {
200
        return "CSV [NAME=" + NAME + ",PUID=" + PUID + ",FORMAT_NAME=" + FORMAT_NAME + "]";
224
        return "CSV [NAME=" + NAME + ",PUID=" + PUID + ",FORMAT_NAME=" + FORMAT_NAME + "]";