18/11/19: maintenance de la plate-forme - Interruptions du service gricad-gitlab et perturbations possibles tout au long de la journée.

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 compile.on.save=true
do.depend=false do.depend=false
do.jar=true do.jar=true
......
...@@ -2,10 +2,6 @@ ...@@ -2,10 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1"> <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/> <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"> <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group> <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>
</open-files> </open-files>
</project-private> </project-private>
...@@ -76,7 +76,7 @@ manifest.custom.permissions= ...@@ -76,7 +76,7 @@ manifest.custom.permissions=
manifest.file=manifest.mf manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false mkdist.disabled=false
platform.active=JDK_1.6 platform.active=JDK_1.6oracle
project.license=gpl30 project.license=gpl30
run.classpath=\ run.classpath=\
${javac.classpath}:\ ${javac.classpath}:\
......
...@@ -38,9 +38,9 @@ public class Cleaner { ...@@ -38,9 +38,9 @@ public class Cleaner {
clean(listOfFile[j].getPath()); clean(listOfFile[j].getPath());
} else if (listOfFile[j].getName().endsWith(".pdf") || listOfFile[j].getName().endsWith(".xml") || listOfFile[j].getName().endsWith(".xtx")) { } else if (listOfFile[j].getName().endsWith(".pdf") || listOfFile[j].getName().endsWith(".xml") || listOfFile[j].getName().endsWith(".xtx")) {
String originalname = listOfFile[j].getName(); 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++) { 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(); listOfFile[i].delete();
} }
} }
...@@ -52,7 +52,7 @@ public class Cleaner { ...@@ -52,7 +52,7 @@ public class Cleaner {
File[] listOfFile = folder.getParentFile().listFiles(); File[] listOfFile = folder.getParentFile().listFiles();
String originalnamewoextension = folder.getName().substring(0, folder.getName().lastIndexOf(".")); String originalnamewoextension = folder.getName().substring(0, folder.getName().lastIndexOf("."));
for (int i = 0; i < listOfFile.length; i++) { 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(); 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