Commit f41663f0 authored by Tien's avatar Tien

Fixed clean function when there are multiple file with the same name only…

Fixed clean function when there are multiple file with the same name only diffrent in the extensions
parent d000b9e9
No preview for this file type
application.args=-c /home/tien/Test_demo/xml/2978-3-319-20608-0_Book_PrintPDF.pdf -d -noclean
application.args=-c /home/tien/Corpus/testxml/Untitled
compile.on.save=true
do.depend=false
do.jar=true
......
......@@ -2,10 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/tien/NetBeansProjects/ScigenChecker_Local/src/fr/imag/forge/scidetect/Checker/Utils/DistancesSet.java</file>
<file>file:/home/tien/NetBeansProjects/ScigenChecker_Local/src/fr/imag/forge/scidetect/Logger/Log.java</file>
<file>file:/home/tien/NetBeansProjects/ScigenChecker_Local/src/fr/imag/forge/scidetect/scigenchecker_local/ScigenChecker_Local.java</file>
</group>
<group/>
</open-files>
</project-private>
......@@ -76,7 +76,7 @@ manifest.custom.permissions=
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=JDK_1.6
platform.active=JDK_1.6oracle
project.license=gpl30
run.classpath=\
${javac.classpath}:\
......
......@@ -38,9 +38,9 @@ public class Cleaner {
clean(listOfFile[j].getPath());
} else if (listOfFile[j].getName().endsWith(".pdf") || listOfFile[j].getName().endsWith(".xml") || listOfFile[j].getName().endsWith(".xtx")) {
String originalname = listOfFile[j].getName();
String originalnamewoextension = listOfFile[j].getName().substring(0, listOfFile[j].getName().lastIndexOf("."));
String originalnamewoextension = originalname.substring(0, originalname.lastIndexOf("."));
for (int i = 0; i < listOfFile.length; i++) {
if (listOfFile[i].getName().contains(originalnamewoextension) && !listOfFile[i].getName().contains(originalname)&&!listOfFile[i].getName().contains(".pdf.xtx")) {
if (listOfFile[i].getName().endsWith(".txt")&&listOfFile[i].getName().contains(originalnamewoextension) && !listOfFile[i].getName().contains(originalname)&&!listOfFile[i].getName().contains(".pdf.xtx")) {
listOfFile[i].delete();
}
}
......@@ -52,7 +52,7 @@ public class Cleaner {
File[] listOfFile = folder.getParentFile().listFiles();
String originalnamewoextension = folder.getName().substring(0, folder.getName().lastIndexOf("."));
for (int i = 0; i < listOfFile.length; i++) {
if (listOfFile[i].getName().contains(originalnamewoextension) && !listOfFile[i].getName().contains(originalname)&&!listOfFile[i].getName().contains(".pdf.xtx")) {
if (listOfFile[i].getName().endsWith(".txt")&&listOfFile[i].getName().contains(originalnamewoextension) && !listOfFile[i].getName().contains(originalname)&&!listOfFile[i].getName().contains(".pdf.xtx")) {
listOfFile[i].delete();
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment