Révision 1370
| tmp/org.txm.chartsengine.jfreechart.core/src/org/txm/chartsengine/jfreechart/core/JFCChartsEngine.java (revision 1370) | ||
|---|---|---|
| 759 | 759 |
|
| 760 | 760 |
// FIXME: recursive addition of subdirectories of root font paths |
| 761 | 761 |
// static protected void traverseDir(File folder, DefaultFontMapper mapper) {
|
| 762 |
// File[] files = folder.listFiles(); |
|
| 762 |
// File[] files = folder.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 763 | 763 |
// for (int i = 0; i < files.length; i++) {
|
| 764 | 764 |
// if (files[i].isDirectory()) {
|
| 765 | 765 |
// mapper.insertDirectory(files[i].getPath()); |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/commands/workspace/LoadBinaryCorporaDirectory.java (revision 1370) | ||
|---|---|---|
| 50 | 50 |
import org.txm.rcp.utils.JobHandler; |
| 51 | 51 |
import org.txm.searchengine.core.SearchEngine; |
| 52 | 52 |
import org.txm.searchengine.core.SearchEnginesManager; |
| 53 |
import org.txm.utils.io.IOUtils; |
|
| 53 | 54 |
|
| 54 | 55 |
/** |
| 55 | 56 |
* Create projects from one binary corpus directory |
| ... | ... | |
| 176 | 177 |
job.releaseSemaphore(); |
| 177 | 178 |
|
| 178 | 179 |
monitor.subTask(TXMUIMessages.loadingTheCorpusInThePlatform); |
| 179 |
for (File corpusDirectory : corporaDirectory.listFiles()) {
|
|
| 180 |
for (File corpusDirectory : corporaDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 180 | 181 |
|
| 181 |
if (corpusDirectory.isHidden()) continue; |
|
| 182 |
|
|
| 183 | 182 |
Project project = Toolbox.workspace.getProject(corpusDirectory.getName().toUpperCase()); |
| 184 | 183 |
if (project != null) {
|
| 185 | 184 |
System.out.println("A corpus named "+corpusDirectory.getName().toUpperCase()+" is already loaded. Aborting the loading of "+corpusDirectory);
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 1370) | ||
|---|---|---|
| 103 | 103 |
import org.txm.utils.BundleUtils; |
| 104 | 104 |
import org.txm.utils.DeleteDir; |
| 105 | 105 |
import org.txm.utils.io.FileCopy; |
| 106 |
import org.txm.utils.io.IOUtils; |
|
| 106 | 107 |
import org.txm.utils.logger.Log; |
| 107 | 108 |
import org.txm.utils.zip.Zip; |
| 108 | 109 |
|
| ... | ... | |
| 743 | 744 |
|
| 744 | 745 |
corporaDir = new File(txmhomedir, "corpora"); //$NON-NLS-1$ |
| 745 | 746 |
|
| 746 |
File[] corporaDirFiles = corporaDir.listFiles(); |
|
| 747 |
File[] corporaDirFiles = corporaDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 747 | 748 |
if (corporaDir.exists() && corporaDirFiles != null && corporaDirFiles.length > 0) { // if the txmhomedir is not empty, try to restore its content
|
| 748 | 749 |
Display.getDefault().syncExec(new Runnable() {
|
| 749 | 750 |
@Override |
| ... | ... | |
| 769 | 770 |
DeleteDir.deleteDirectory(oldbackup); // ]8) |
| 770 | 771 |
} |
| 771 | 772 |
|
| 772 |
File[] corpDirs = corporaDir.listFiles(); |
|
| 773 |
File[] corpDirs = corporaDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 773 | 774 |
ArrayList<String> moved = new ArrayList<String>(); |
| 774 | 775 |
ArrayList<String> failed = new ArrayList<String>(); |
| 775 | 776 |
|
| ... | ... | |
| 827 | 828 |
// //File corporaDir = new File(txmhomedir.getAbsolutePath(), "corpora"); //$NON-NLS-1$ |
| 828 | 829 |
// |
| 829 | 830 |
// |
| 830 |
// File[] sampleCorpusFiles = sampleCorporaDirectory.listFiles(); //$NON-NLS-1$ |
|
| 831 |
// File[] sampleCorpusFiles = sampleCorporaDirectory.listFiles(IOUtils.FILTER_HIDDEN); //$NON-NLS-1$
|
|
| 831 | 832 |
// |
| 832 | 833 |
// if (sampleCorpusFiles != null) for (File zipFile : sampleCorpusFiles) {
|
| 833 | 834 |
// try {
|
| ... | ... | |
| 876 | 877 |
// } |
| 877 | 878 |
} |
| 878 | 879 |
|
| 879 |
// for (File projectDir : corporaDir.listFiles()) { // load sample corpus and previous corpus as well
|
|
| 880 |
// for (File projectDir : corporaDir.listFiles(IOUtils.FILTER_HIDDEN)) { // load sample corpus and previous corpus as well
|
|
| 880 | 881 |
// if (projectDir.isDirectory()) {
|
| 881 | 882 |
// Project project; |
| 882 | 883 |
// try {
|
| ... | ... | |
| 893 | 894 |
// System.out.print(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_53, backup)); |
| 894 | 895 |
// monitor.setTaskName(NLS.bind(TXMUIMessages.ApplicationWorkbenchAdvisor_53, backup)); |
| 895 | 896 |
// |
| 896 |
// File[] corpusDirs = backup.listFiles(); |
|
| 897 |
// File[] corpusDirs = backup.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 897 | 898 |
// |
| 898 | 899 |
// if (corpusDirs != null) {
|
| 899 | 900 |
// |
| ... | ... | |
| 905 | 906 |
// } |
| 906 | 907 |
// } |
| 907 | 908 |
// } |
| 908 |
// corpusDirs = backup.listFiles(); |
|
| 909 |
// corpusDirs = backup.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 909 | 910 |
// |
| 910 | 911 |
// ArrayList<String> notMoved = new ArrayList<String>(); |
| 911 | 912 |
// ArrayList<File> broken = new ArrayList<File>(); |
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/handlers/scripts/ExecuteGroovyScript.java (revision 1370) | ||
|---|---|---|
| 331 | 331 |
* System.out.println("SCRIPTROOTDIR "+script.getParent());
|
| 332 | 332 |
* System.out.println("SCRIPT "+script); GroovyScriptEngine gse; try {
|
| 333 | 333 |
* gse = new GroovyScriptEngine(roots); for(File f : |
| 334 |
* script.getParentFile().listFiles()) |
|
| 334 |
* script.getParentFile().listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 335 | 335 |
* gse.loadScriptByName(f.getName()); Binding binding = new Binding(); |
| 336 | 336 |
* |
| 337 | 337 |
* System.out.println("start execution"); gse.run(script.getName(),
|
| tmp/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java (revision 1370) | ||
|---|---|---|
| 19 | 19 |
import org.txm.objects.Project; |
| 20 | 20 |
import org.txm.rcp.messages.TXMUIMessages; |
| 21 | 21 |
import org.txm.treetagger.core.preferences.TreeTaggerPreferences; |
| 22 |
import org.txm.utils.io.IOUtils; |
|
| 22 | 23 |
|
| 23 | 24 |
public class LangSection extends ImportEditorSection {
|
| 24 | 25 |
|
| ... | ... | |
| 82 | 83 |
int langToSelectIndex = -1; |
| 83 | 84 |
int added = 0; |
| 84 | 85 |
String modelsDir = TreeTaggerPreferences.getInstance().getString(TreeTaggerPreferences.MODELS_PATH); |
| 85 |
File files[] = new File(modelsDir).listFiles(); |
|
| 86 |
File files[] = new File(modelsDir).listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 86 | 87 |
if (files != null && files.length > 0) {
|
| 87 | 88 |
for (File model : files) {
|
| 88 | 89 |
if (!model.getName().endsWith(".par")) continue;
|
| tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/tigersearch/TSImporter.groovy (revision 1370) | ||
|---|---|---|
| 4 | 4 |
import org.txm.importer.xtz.ImportModule; |
| 5 | 5 |
import org.txm.metadatas.Metadatas |
| 6 | 6 |
import org.txm.utils.io.FileCopy |
| 7 |
import org.txm.utils.io.IOUtils |
|
| 7 | 8 |
import org.txm.importer.xtz.* |
| 8 | 9 |
import org.txm.scripts.importer.xtz.* |
| 9 | 10 |
import org.txm.importer.ApplyXsl2; |
| ... | ... | |
| 109 | 110 |
return; |
| 110 | 111 |
} |
| 111 | 112 |
|
| 112 |
File[] files = tokenizedDir.listFiles(); |
|
| 113 |
File[] files = tokenizedDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 113 | 114 |
if (files == null || files.length == 0) {
|
| 114 | 115 |
println "Error while applying TS XSL file to $xmltxmSrcDir is empty" |
| 115 | 116 |
isSuccessful = false; |
| ... | ... | |
| 120 | 121 |
if (!doInjectMetadataStep()) return; |
| 121 | 122 |
|
| 122 | 123 |
File txmdDir = new File(module.getBinaryDirectory(),"txm"); |
| 123 |
isSuccessFul = txmdDir.listFiles().size() > 0 |
|
| 124 |
isSuccessFul = txmdDir.listFiles(IOUtils.FILTER_HIDDEN).size() > 0
|
|
| 124 | 125 |
} |
| 125 | 126 |
} |
| tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/srcmf/srcmfLoader.groovy (revision 1370) | ||
|---|---|---|
| 101 | 101 |
txmDir.deleteDir(); |
| 102 | 102 |
txmDir.mkdirs(); |
| 103 | 103 |
// copy txm files |
| 104 |
List<File> srcfiles = txmSrcDir.listFiles(); |
|
| 104 |
List<File> srcfiles = txmSrcDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 105 | 105 |
for (File f : srcfiles) {// check XML format, and copy file into binDir
|
| 106 | 106 |
if (f.getName().equals("import.xml") || f.getName().matches("metadata\\.....?") || f.getName().endsWith(".properties"))
|
| 107 | 107 |
continue; |
| ... | ... | |
| 111 | 111 |
println "Won't process file "+f; |
| 112 | 112 |
} |
| 113 | 113 |
} |
| 114 |
if (txmDir.listFiles() == null) {
|
|
| 114 |
if (txmDir.listFiles(IOUtils.FILTER_HIDDEN) == null) {
|
|
| 115 | 115 |
println "No txm file to process" |
| 116 | 116 |
return; |
| 117 | 117 |
} |
| 118 | 118 |
|
| 119 |
List<File> filelist = txmDir.listFiles(); |
|
| 119 |
List<File> filelist = txmDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 120 | 120 |
Collections.sort(filelist); |
| 121 | 121 |
|
| 122 | 122 |
if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
|
| ... | ... | |
| 173 | 173 |
File tigerDir = new File(binDir, "tiger"); |
| 174 | 174 |
tigerDir.mkdir(); |
| 175 | 175 |
File master = new File(tigerSrcDir, "master.xml"); |
| 176 |
File txmSrcFile = txmSrcDir.listFiles()[0]; // only one text file |
|
| 176 |
File txmSrcFile = txmSrcDir.listFiles(IOUtils.FILTER_HIDDEN)[0]; // only one text file
|
|
| 177 | 177 |
|
| 178 | 178 |
// Run SRCMF cmd line corpus import script |
| 179 | 179 |
if (MONITOR != null && MONITOR.isCanceled()) { return MONITOR.done(); }
|
| tmp/org.txm.tigersearch.rcp/groovy/org/txm/scripts/importer/srcmf/SrcmfImporter.groovy (revision 1370) | ||
|---|---|---|
| 20 | 20 |
|
| 21 | 21 |
import java.util.logging.*; |
| 22 | 22 |
|
| 23 |
import org.txm.utils.io.IOUtils |
|
| 23 | 24 |
|
| 25 |
|
|
| 24 | 26 |
// Command line entry point |
| 25 | 27 |
def cli = new CliBuilder( |
| 26 | 28 |
usage:'SrcmfImport.groovy [options] tiger_master.xml xml_txm.xml header_file.xml' |
| ... | ... | |
| 51 | 53 |
File tigerDir = new File(binDir, "tiger") |
| 52 | 54 |
tigerDir.mkdir() |
| 53 | 55 |
File masterpos = new File(tigerDir, "master_pos.xml") |
| 54 |
File xmltxm = txmSrcDir.listFiles()[0] |
|
| 56 |
File xmltxm = txmSrcDir.listFiles(IOUtils.FILTER_HIDDEN)[0]
|
|
| 55 | 57 |
File logFile = new File(binDir, "tiger.log") |
| 56 | 58 |
def sdi = new SubcorpusDataInject( |
| 57 | 59 |
xmltxm, |
| tmp/org.txm.tigersearch.rcp/src/org/txm/test/DrawTSSVG.java (revision 1370) | ||
|---|---|---|
| 62 | 62 |
// System.out.println( next.toHTML() + "<br>"); |
| 63 | 63 |
|
| 64 | 64 |
// System.out.println( "make some room :)" |
| 65 |
// for(File f : new File("/home/mdecorde/Bureau/tigerexports/").listFiles())
|
|
| 65 |
// for(File f : new File("/home/mdecorde/Bureau/tigerexports/").listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 66 | 66 |
// f.delete() |
| 67 | 67 |
// |
| 68 | 68 |
|
| tmp/org.txm.analec.rcp/src/org/txm/annotation/urs/commands/ImportGlozzCorpus.java (revision 1370) | ||
|---|---|---|
| 182 | 182 |
} |
| 183 | 183 |
Corpus analecCorpus = URSCorpora.getCorpus(corpus); |
| 184 | 184 |
analecCorpus.clearAll(); // remove all : annotations, structure |
| 185 |
File[] ecFiles = ecDir.listFiles(); |
|
| 185 |
File[] ecFiles = ecDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 186 | 186 |
Arrays.sort(ecFiles); |
| 187 | 187 |
for (File ecFile : ecFiles) {
|
| 188 | 188 |
FichiersJava.concatener(ecFile, analecCorpus); |
| tmp/org.txm.oriflamms.rcp/groovy/org/txm/macro/oriflamms/prepare/TEI2ProjectMacro.groovy (revision 1370) | ||
|---|---|---|
| 185 | 185 |
return; |
| 186 | 186 |
} |
| 187 | 187 |
|
| 188 |
if (imagesDirectory.exists() && imagesDirectory.listFiles().size() > 0) {
|
|
| 188 |
if (imagesDirectory.exists() && imagesDirectory.listFiles(IOUtils.FILTER_HIDDEN).size() > 0) {
|
|
| 189 | 189 |
println "Copying images files from $imagesDirectory to $imgDirectory..." |
| 190 | 190 |
FileCopy.copyFiles(imagesDirectory, imgDirectory); |
| 191 |
def files = imgDirectory.listFiles() |
|
| 191 |
def files = imgDirectory.listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 192 | 192 |
if (files != null) println ""+files.size()+" images copied." |
| 193 | 193 |
} |
| 194 | 194 |
|
| tmp/org.txm.oriflamms.rcp/groovy/org/txm/macro/oriflamms/prepare/Project2XTZMacro.groovy (revision 1370) | ||
|---|---|---|
| 7 | 7 |
import org.txm.objects.BaseParameters; |
| 8 | 8 |
import org.txm.rcp.swt.widget.parameters.* |
| 9 | 9 |
import org.txm.* |
| 10 |
import org.txm.importer.ApplyXsl2 |
|
| 10 | 11 |
import org.txm.utils.* |
| 11 | 12 |
import org.txm.utils.io.* |
| 12 | 13 |
import org.txm.scripts.importer.* |
| ... | ... | |
| 87 | 88 |
File wFile = null |
| 88 | 89 |
File cFile = null |
| 89 | 90 |
|
| 90 |
def xmlFiles = textDirectory.listFiles() |
|
| 91 |
def xmlFiles = textDirectory.listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 91 | 92 |
if (xmlFiles == null) return; |
| 92 | 93 |
|
| 93 | 94 |
for (File xmlFile : xmlFiles) {
|
| ... | ... | |
| 125 | 126 |
println "Error: fail to split $cFile" |
| 126 | 127 |
return false |
| 127 | 128 |
} |
| 128 |
if (!ApplyXsl2.processImportSources(cFrontXSLFile, cDirectory.listFiles(), [:])) {
|
|
| 129 |
if (!ApplyXsl2.processImportSources(cFrontXSLFile, cDirectory.listFiles(IOUtils.FILTER_HIDDEN), [:])) {
|
|
| 129 | 130 |
println "Error: fail to apply front XSL with $cDirectory files" |
| 130 | 131 |
return false |
| 131 | 132 |
} |
| 132 | 133 |
// INJECT ontologies |
| 133 | 134 |
|
| 134 | 135 |
println "Injecting ontologies..." |
| 135 |
for (File f : cDirectory.listFiles()) {
|
|
| 136 |
for (File f : cDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 136 | 137 |
if (f.getName().startsWith(cDirectory.getName())) {
|
| 137 | 138 |
OntologiesProjection cp = new OntologiesProjection(f, projectDirectory); |
| 138 | 139 |
File outputFile = new File(cDirectory, "temp.xml") |
| tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/TEI2Project.java (revision 1370) | ||
|---|---|---|
| 203 | 203 |
return false; |
| 204 | 204 |
} |
| 205 | 205 |
|
| 206 |
if (imagesDirectory.exists() && imagesDirectory.listFiles().length > 0) {
|
|
| 206 |
if (imagesDirectory.exists() && imagesDirectory.listFiles(IOUtils.FILTER_HIDDEN).length > 0) {
|
|
| 207 | 207 |
System.out.println("Copying images files from "+imagesDirectory+" to "+imgDirectory+"...");
|
| 208 | 208 |
FileCopy.copyFiles(imagesDirectory, imgDirectory); |
| 209 |
File[] files = imgDirectory.listFiles(); |
|
| 209 |
File[] files = imgDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 210 | 210 |
if (files != null) System.out.println(""+files.length+" images copied.");
|
| 211 | 211 |
} |
| 212 | 212 |
|
| tmp/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/Project2XTZ.java (revision 1370) | ||
|---|---|---|
| 15 | 15 |
import org.txm.utils.BundleUtils; |
| 16 | 16 |
import org.txm.utils.DeleteDir; |
| 17 | 17 |
import org.txm.utils.io.FileCopy; |
| 18 |
import org.txm.utils.io.IOUtils; |
|
| 18 | 19 |
import org.txm.utils.xml.UpdateXSLParameters; |
| 19 | 20 |
import org.xml.sax.SAXException; |
| 20 | 21 |
|
| ... | ... | |
| 90 | 91 |
} |
| 91 | 92 |
|
| 92 | 93 |
File wDirectory = null; |
| 93 |
File cDirectory = null;
|
|
| 94 |
File wFile = null;
|
|
| 95 |
File cFile = null;
|
|
| 94 |
File cDirectory = null; |
|
| 95 |
File wFile = null; |
|
| 96 |
File cFile = null; |
|
| 96 | 97 |
|
| 97 |
File[] xmlFiles = textDirectory.listFiles();
|
|
| 98 |
if (xmlFiles == null) return false;
|
|
| 98 |
File[] xmlFiles = textDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 99 |
if (xmlFiles == null) return false; |
|
| 99 | 100 |
|
| 100 | 101 |
for (File xmlFile : xmlFiles) {
|
| 101 | 102 |
if (xmlFile.getName().endsWith("-w.xml")) {
|
| 102 | 103 |
String name = xmlFile.getName().substring(0, xmlFile.getName().indexOf(".xml"));
|
| 103 |
wDirectory = new File(txmDirectory, name);
|
|
| 104 |
wDirectory = new File(txmDirectory, name); |
|
| 104 | 105 |
wFile = xmlFile; |
| 105 | 106 |
} else if (xmlFile.getName().endsWith("-c.xml")) {
|
| 106 | 107 |
String name = xmlFile.getName().substring(0, xmlFile.getName().indexOf(".xml"));
|
| 107 |
cDirectory = new File(txmDirectory, name);
|
|
| 108 |
cDirectory = new File(txmDirectory, name); |
|
| 108 | 109 |
cFile = xmlFile; |
| 109 | 110 |
} |
| 110 | 111 |
} |
| ... | ... | |
| 139 | 140 |
} |
| 140 | 141 |
// INJECT ontologies |
| 141 | 142 |
System.out.println("Injecting ontologies...");
|
| 142 |
for (File f : cDirectory.listFiles()) {
|
|
| 143 |
for (File f : cDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 143 | 144 |
if (f.getName().startsWith(cDirectory.getName())) {
|
| 144 | 145 |
OntologiesProjection cp = new OntologiesProjection(f, projectDirectory); |
| 145 | 146 |
File outputFile = new File(cDirectory, "temp.xml"); |
| ... | ... | |
| 218 | 219 |
HashMap<String, String> parameters = new HashMap<String, String>(); |
| 219 | 220 |
parameters.put("image-directory", projectImgDirectory.getAbsolutePath());
|
| 220 | 221 |
parameters.put("word-element", "w");
|
| 221 |
System.out.println("update "+newWEditionXSLFile3+" with "+parameters);
|
|
| 222 |
UpdateXSLParameters p = new UpdateXSLParameters(newWEditionXSLFile3);
|
|
| 222 |
System.out.println("update "+newWEditionXSLFile3+" with "+parameters);
|
|
| 223 |
UpdateXSLParameters p = new UpdateXSLParameters(newWEditionXSLFile3); |
|
| 223 | 224 |
if (!p.process(parameters)) {
|
| 224 | 225 |
System.out.println("Fail to patch "+newWEditionXSLFile3);
|
| 225 | 226 |
return false; |
| ... | ... | |
| 227 | 228 |
parameters = new HashMap<String, String>(); |
| 228 | 229 |
parameters.put("image-directory", projectImgDirectory.getAbsolutePath());
|
| 229 | 230 |
parameters.put("word-element", "c");
|
| 230 |
System.out.println("update "+newCEditionXSLFile3+" with "+parameters);
|
|
| 231 |
UpdateXSLParameters p2 = new UpdateXSLParameters(newCEditionXSLFile3);
|
|
| 231 |
System.out.println("update "+newCEditionXSLFile3+" with "+parameters);
|
|
| 232 |
UpdateXSLParameters p2 = new UpdateXSLParameters(newCEditionXSLFile3); |
|
| 232 | 233 |
if (!p2.process(parameters)) {
|
| 233 | 234 |
System.out.println("Fail to patch "+newCEditionXSLFile3);
|
| 234 | 235 |
return false; |
| ... | ... | |
| 270 | 271 |
wParams.getCorpusElement().setAttribute("font", "Junicode");
|
| 271 | 272 |
wParams.getEditionsElement(wParams.getCorpusElement()).setAttribute("default", "default,facsimile");
|
| 272 | 273 |
wParams.getCorpusElement().setAttribute("name", AsciiUtils.buildId(wDirectory.getName()).toUpperCase());
|
| 273 |
|
|
| 274 | 274 |
|
| 275 |
|
|
| 275 | 276 |
BaseOldParameters.createEmptyParams(cImportXMLFile, AsciiUtils.buildId(cDirectory.getName()).toUpperCase()); |
| 276 | 277 |
BaseOldParameters cParams = new BaseOldParameters(cImportXMLFile); |
| 277 | 278 |
cParams.load(); |
| ... | ... | |
| 284 | 285 |
cParams.getCorpusElement().setAttribute("font", "Junicode");
|
| 285 | 286 |
cParams.getEditionsElement(cParams.getCorpusElement()).setAttribute("default", "default,facsimile");
|
| 286 | 287 |
cParams.getCorpusElement().setAttribute("name", AsciiUtils.buildId(cDirectory.getName()).toUpperCase());
|
| 287 |
|
|
| 288 |
|
|
| 288 | 289 |
return cParams.save() && wParams.save(); |
| 289 | 290 |
} |
| 290 | 291 |
} |
| tmp/org.txm.utils/src/org/txm/utils/LangDetector.java (revision 1370) | ||
|---|---|---|
| 58 | 58 |
{
|
| 59 | 59 |
//println "process $dir" |
| 60 | 60 |
if(dir.isDirectory()) {
|
| 61 |
for (File file : dir.listFiles()) |
|
| 61 |
for (File file : dir.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 62 | 62 |
if (file.isFile()) |
| 63 | 63 |
processFile(file); |
| 64 | 64 |
} else {
|
| ... | ... | |
| 104 | 104 |
|
| 105 | 105 |
public static void configFromModels(File dir) |
| 106 | 106 |
{
|
| 107 |
File[] files = dir.listFiles(); |
|
| 107 |
File[] files = dir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 108 | 108 |
Arrays.sort(files); |
| 109 | 109 |
for(File f : files) |
| 110 | 110 |
if(f.getName().contains(".lm") && !f.getName().contains("-"))
|
| tmp/org.txm.utils/src/org/txm/utils/CharsetDetector.java (revision 1370) | ||
|---|---|---|
| 6 | 6 |
|
| 7 | 7 |
import org.mozilla.universalchardet.CharsetListener; |
| 8 | 8 |
import org.mozilla.universalchardet.UniversalDetector; |
| 9 |
import org.txm.utils.io.IOUtils; |
|
| 9 | 10 |
|
| 10 | 11 |
public class CharsetDetector {
|
| 11 | 12 |
public static int MINIMALSIZE=2000; |
| ... | ... | |
| 27 | 28 |
|
| 28 | 29 |
private void processDirectory(File dir) |
| 29 | 30 |
{
|
| 30 |
for (File file : dir.listFiles()) {
|
|
| 31 |
for (File file : dir.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 31 | 32 |
if (file.isFile()) {
|
| 32 | 33 |
try {
|
| 33 | 34 |
processFile(file); |
| tmp/org.txm.utils/src/org/txm/utils/io/IOUtils.java (revision 1370) | ||
|---|---|---|
| 44 | 44 |
/** |
| 45 | 45 |
* select only files not hidden |
| 46 | 46 |
*/ |
| 47 |
public static final FileFilter filter = new FileFilter() {
|
|
| 47 |
public static final FileFilter FILTER_HIDDEN = new FileFilter() {
|
|
| 48 | 48 |
@Override |
| 49 | 49 |
public boolean accept(File file) {
|
| 50 | 50 |
return !file.isHidden(); |
| 51 | 51 |
} |
| 52 | 52 |
}; |
| 53 |
|
|
| 53 | 54 |
/** |
| 54 | 55 |
* |
| 55 | 56 |
* @return a list containing the files not hidden |
| 56 | 57 |
*/ |
| 57 | 58 |
public List<File> listFiles(File dir) {
|
| 58 |
File[] files = dir.listFiles(filter);
|
|
| 59 |
File[] files = dir.listFiles(FILTER_HIDDEN);
|
|
| 59 | 60 |
if (files == null) return new ArrayList<File>(); |
| 60 | 61 |
|
| 61 | 62 |
return Arrays.asList(files); |
| tmp/org.txm.utils/src/org/txm/utils/zip/Zip.java (revision 1370) | ||
|---|---|---|
| 31 | 31 |
import java.io.BufferedOutputStream; |
| 32 | 32 |
import java.io.File; |
| 33 | 33 |
import java.io.FileInputStream; |
| 34 |
import java.io.FileNotFoundException; |
|
| 35 | 34 |
import java.io.FileOutputStream; |
| 36 | 35 |
import java.io.IOException; |
| 37 | 36 |
import java.io.InputStream; |
| ... | ... | |
| 41 | 40 |
import java.util.Collections; |
| 42 | 41 |
import java.util.Enumeration; |
| 43 | 42 |
import java.util.HashSet; |
| 44 |
import java.util.List; |
|
| 45 | 43 |
import java.util.zip.Deflater; |
| 46 | 44 |
import java.util.zip.ZipEntry; |
| 47 | 45 |
import java.util.zip.ZipFile; |
| 48 | 46 |
import java.util.zip.ZipInputStream; |
| 49 | 47 |
import java.util.zip.ZipOutputStream; |
| 50 | 48 |
|
| 51 |
import org.apache.commons.lang.StringUtils; |
|
| 52 | 49 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 53 | 50 |
import org.txm.utils.logger.Log; |
| 54 | 51 |
|
| ... | ... | |
| 224 | 221 |
} |
| 225 | 222 |
} else {
|
| 226 | 223 |
// Ecriture du fichier dans le zip |
| 227 |
final InputStream in = new BufferedInputStream( |
|
| 228 |
new FileInputStream(file)); |
|
| 224 |
final InputStream in = new BufferedInputStream(new FileInputStream(file)); |
|
| 229 | 225 |
|
| 230 | 226 |
try {
|
| 231 | 227 |
if (monitor != null) monitor.beginTask("Compressing "+file+" file ("+file.length()+" bytes).", (int)file.length());
|
| ... | ... | |
| 243 | 239 |
} |
| 244 | 240 |
|
| 245 | 241 |
/** |
| 246 |
* Decompress.
|
|
| 242 |
* Decompress a ZIP file in the ZIP file parent directory
|
|
| 247 | 243 |
* |
| 248 |
* @param file the file
|
|
| 244 |
* @param zipfile the ZIP file
|
|
| 249 | 245 |
* @throws IOException Signals that an I/O exception has occurred. |
| 250 | 246 |
*/ |
| 251 |
public static void decompress(final File file) |
|
| 247 |
public static void decompress(final File zipfile)
|
|
| 252 | 248 |
throws IOException {
|
| 253 |
decompress(file, file.getCanonicalFile().getParentFile(), false, null);
|
|
| 249 |
decompress(zipfile, zipfile.getCanonicalFile().getParentFile(), false, null);
|
|
| 254 | 250 |
} |
| 255 | 251 |
|
| 256 | 252 |
/** |
| 257 | 253 |
* Decompress. |
| 258 | 254 |
* |
| 259 |
* @param file the file
|
|
| 255 |
* @param zipFile the file
|
|
| 260 | 256 |
* @param deleteZipAfter the delete zip after |
| 261 | 257 |
* @throws IOException Signals that an I/O exception has occurred. |
| 262 | 258 |
*/ |
| 263 |
public static void decompress(final File file, final boolean deleteZipAfter)
|
|
| 259 |
public static void decompress(final File zipFile, final boolean deleteZipAfter)
|
|
| 264 | 260 |
throws IOException {
|
| 265 |
decompress(file, file.getCanonicalFile().getParentFile(), deleteZipAfter, null);
|
|
| 261 |
decompress(zipFile, zipFile.getCanonicalFile().getParentFile(), deleteZipAfter, null);
|
|
| 266 | 262 |
} |
| 267 | 263 |
|
| 268 | 264 |
// Décompresse un fichier zip à l'adresse indiquée par le dossier |
| 269 | 265 |
/** |
| 270 | 266 |
* Decompress. |
| 271 | 267 |
* |
| 272 |
* @param file the file
|
|
| 268 |
* @param zipFile the file
|
|
| 273 | 269 |
* @param folder the folder |
| 274 | 270 |
* @param deleteZipAfter the delete zip after |
| 275 | 271 |
* @throws IOException Signals that an I/O exception has occurred. |
| 276 | 272 |
*/ |
| 277 |
public static void decompress(final File file, final File folder,
|
|
| 273 |
public static void decompress(final File zipFile, final File folder,
|
|
| 278 | 274 |
final boolean deleteZipAfter) throws IOException {
|
| 279 |
decompress(file, folder, deleteZipAfter, null);
|
|
| 275 |
decompress(zipFile, folder, deleteZipAfter, null);
|
|
| 280 | 276 |
} |
| 281 | 277 |
|
| 282 | 278 |
// Décompresse un fichier zip à l'adresse indiquée par le dossier |
| 283 | 279 |
/** |
| 284 | 280 |
* Decompress. |
| 285 | 281 |
* |
| 286 |
* @param file the file
|
|
| 282 |
* @param zipFile the file
|
|
| 287 | 283 |
* @param folder the folder |
| 288 | 284 |
* @param deleteZipAfter the delete zip after |
| 289 | 285 |
* @param monitor change progress state |
| 290 | 286 |
* |
| 291 | 287 |
* @throws IOException Signals that an I/O exception has occurred. |
| 292 | 288 |
*/ |
| 293 |
public static void decompress(final File file, final File folder, final boolean deleteZipAfter, IProgressMonitor monitor)
|
|
| 289 |
public static void decompress(final File zipFile, final File folder, final boolean deleteZipAfter, IProgressMonitor monitor)
|
|
| 294 | 290 |
throws IOException {
|
| 295 | 291 |
ZipInputStream zis = new ZipInputStream(new BufferedInputStream( |
| 296 |
new FileInputStream(file.getCanonicalFile())));
|
|
| 292 |
new FileInputStream(zipFile.getCanonicalFile())));
|
|
| 297 | 293 |
ZipEntry ze; |
| 298 | 294 |
int nEntries = 0; |
| 299 | 295 |
//System.out.println("count entries...");
|
| ... | ... | |
| 307 | 303 |
//System.out.println("count entries result: "+nEntries);
|
| 308 | 304 |
|
| 309 | 305 |
zis = new ZipInputStream(new BufferedInputStream( |
| 310 |
new FileInputStream(file.getCanonicalFile())));
|
|
| 306 |
new FileInputStream(zipFile.getCanonicalFile())));
|
|
| 311 | 307 |
//System.out.println("zis: "+zis);
|
| 312 |
if (monitor != null) { monitor.beginTask("Unzipping "+file, nEntries);}
|
|
| 308 |
if (monitor != null) { monitor.beginTask("Unzipping "+zipFile, nEntries);}
|
|
| 313 | 309 |
|
| 314 | 310 |
try {
|
| 315 | 311 |
// Parcours tous les fichiers |
| ... | ... | |
| 351 | 347 |
} |
| 352 | 348 |
|
| 353 | 349 |
if (deleteZipAfter) |
| 354 |
file.delete();
|
|
| 350 |
zipFile.delete();
|
|
| 355 | 351 |
} |
| 356 | 352 |
|
| 357 | 353 |
/** |
| ... | ... | |
| 368 | 364 |
/** |
| 369 | 365 |
* Decompress. |
| 370 | 366 |
* |
| 371 |
* @param fileName the file name
|
|
| 367 |
* @param zipFileName the file name
|
|
| 372 | 368 |
* @param deleteZipAfter the delete zip after |
| 373 | 369 |
* @throws IOException Signals that an I/O exception has occurred. |
| 374 | 370 |
*/ |
| 375 |
public static void decompress(final String fileName,
|
|
| 371 |
public static void decompress(final String zipFileName,
|
|
| 376 | 372 |
final boolean deleteZipAfter) |
| 377 | 373 |
throws IOException {
|
| 378 |
decompress(new File(fileName), deleteZipAfter);
|
|
| 374 |
decompress(new File(zipFileName), deleteZipAfter);
|
|
| 379 | 375 |
} |
| 380 | 376 |
|
| 381 | 377 |
|
| 382 | 378 |
/** |
| 383 | 379 |
* Decompress. |
| 384 | 380 |
* |
| 385 |
* @param fileName the file name
|
|
| 381 |
* @param zipFileName the file name
|
|
| 386 | 382 |
* @param folderName the folder name |
| 387 | 383 |
* @throws IOException Signals that an I/O exception has occurred. |
| 388 | 384 |
*/ |
| 389 |
public static void decompress(final String fileName, final String folderName)
|
|
| 385 |
public static void decompress(final String zipFileName, final String folderName)
|
|
| 390 | 386 |
throws IOException {
|
| 391 |
decompress(new File(fileName), new File(folderName), false);
|
|
| 387 |
decompress(new File(zipFileName), new File(folderName), false);
|
|
| 392 | 388 |
} |
| 393 | 389 |
|
| 394 | 390 |
/** |
| 395 | 391 |
* Decompress. |
| 396 | 392 |
* |
| 397 |
* @param fileName the file name
|
|
| 393 |
* @param zipFileName the file name
|
|
| 398 | 394 |
* @param folderName the folder name |
| 399 | 395 |
* @param deleteZipAfter the delete zip after |
| 400 | 396 |
* @throws IOException Signals that an I/O exception has occurred. |
| 401 | 397 |
*/ |
| 402 |
public static void decompress(final String fileName, final String folderName,
|
|
| 398 |
public static void decompress(final String zipFileName, final String folderName,
|
|
| 403 | 399 |
final boolean deleteZipAfter) |
| 404 | 400 |
throws IOException {
|
| 405 |
decompress(new File(fileName), new File(folderName), deleteZipAfter, null);
|
|
| 401 |
decompress(new File(zipFileName), new File(folderName), deleteZipAfter, null);
|
|
| 406 | 402 |
} |
| 407 | 403 |
|
| 408 | 404 |
/** |
| 409 | 405 |
* Decompress. |
| 410 | 406 |
* |
| 411 |
* @param fileName the file name
|
|
| 407 |
* @param zipFileName the file name
|
|
| 412 | 408 |
* @param folderName the folder name |
| 413 | 409 |
* @param deleteZipAfter the delete zip after |
| 414 | 410 |
* @throws IOException Signals that an I/O exception has occurred. |
| 415 | 411 |
*/ |
| 416 |
public static void decompress(final String fileName, final String folderName,
|
|
| 412 |
public static void decompress(final String zipFileName, final String folderName,
|
|
| 417 | 413 |
final boolean deleteZipAfter, IProgressMonitor monitor) |
| 418 | 414 |
throws IOException {
|
| 419 |
decompress(new File(fileName), new File(folderName), deleteZipAfter, monitor);
|
|
| 415 |
decompress(new File(zipFileName), new File(folderName), deleteZipAfter, monitor);
|
|
| 420 | 416 |
} |
| 421 | 417 |
|
| 422 | 418 |
/** |
| ... | ... | |
| 448 | 444 |
try {
|
| 449 | 445 |
long oldFileTime = outputFile.lastModified(); |
| 450 | 446 |
|
| 451 |
ZipInputStream zis = new ZipInputStream(new BufferedInputStream( |
|
| 452 |
new FileInputStream(zipFile.getCanonicalFile()))); |
|
| 447 |
ZipInputStream zis = new ZipInputStream(new BufferedInputStream(new FileInputStream(zipFile.getCanonicalFile()))); |
|
| 453 | 448 |
ZipEntry ze; |
| 454 |
|
|
| 455 | 449 |
|
| 456 | 450 |
// Parcourt tous les fichiers |
| 457 | 451 |
while (null != (ze = zis.getNextEntry())) {
|
| tmp/org.txm.core.tests/src/org/txm/core/tests/junit/PluginMessages.java (revision 1370) | ||
|---|---|---|
| 55 | 55 |
} |
| 56 | 56 |
|
| 57 | 57 |
// test content |
| 58 |
File[] files = messagesPackageDirectory.listFiles(); |
|
| 58 |
File[] files = messagesPackageDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 59 | 59 |
if (files == null) {
|
| 60 | 60 |
error("No messages class file.");
|
| 61 | 61 |
return; |
| tmp/org.txm.core.tests/src/org/txm/core/tests/junit/PluginExtPoints.java (revision 1370) | ||
|---|---|---|
| 36 | 36 |
private void testDeclaredExtPoints(File projectDirectory) throws IOException {
|
| 37 | 37 |
File schemaDirectory = new File(projectDirectory, "schema"); |
| 38 | 38 |
if (schemaDirectory.exists()) {
|
| 39 |
for (File schemaXML : schemaDirectory.listFiles()) {
|
|
| 39 |
for (File schemaXML : schemaDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 40 | 40 |
if (schemaXML.isDirectory()) continue; |
| 41 | 41 |
ArrayList<String> ids = IOUtils.findWithGroup(schemaXML, "<meta.schema plugin=\"[^\"]+\" id=\"([^\"]+)\" name=\"[^\"]+\"/>", true); |
| 42 | 42 |
ArrayList<String> classes = IOUtils.findWithGroup(schemaXML, "<meta.attribute kind=\"java\" basedOn=\"([^:]+):\"/>", true); |
| ... | ... | |
| 88 | 88 |
|
| 89 | 89 |
File schemaDirectory = new File(projectDirectory, "schema"); |
| 90 | 90 |
if (schemaDirectory.exists()) {
|
| 91 |
for (File schemaXML : schemaDirectory.listFiles()) {
|
|
| 91 |
for (File schemaXML : schemaDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 92 | 92 |
if (!schemaXML.isFile()) continue; |
| 93 | 93 |
if (!schemaXML.getName().endsWith(".exsd")) continue;
|
| 94 | 94 |
ArrayList<String> ids = IOUtils.findWithGroup(schemaXML, "<meta.schema plugin=\"[^\"]+\" id=\"([^\"]+)\" name=\"[^\"]+\"/>", true); |
| tmp/org.txm.core.tests/src/org/txm/core/tests/junit/PluginPreferences.java (revision 1370) | ||
|---|---|---|
| 4 | 4 |
|
| 5 | 5 |
import java.io.File; |
| 6 | 6 |
|
| 7 |
import org.txm.utils.io.IOUtils; |
|
| 8 |
|
|
| 7 | 9 |
public class PluginPreferences extends TXMPluginTest {
|
| 8 | 10 |
|
| 9 | 11 |
public void RCPPluginTest(File projectDirectory, String name, String packagePath) {
|
| ... | ... | |
| 20 | 22 |
} |
| 21 | 23 |
|
| 22 | 24 |
// test content |
| 23 |
File[] files = preferencePackageDirectory.listFiles(); |
|
| 25 |
File[] files = preferencePackageDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 24 | 26 |
if (files == null) {
|
| 25 | 27 |
error("No preference class file.");
|
| 26 | 28 |
return; |
| tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/CQPSearchEngine.java (revision 1370) | ||
|---|---|---|
| 23 | 23 |
import org.txm.searchengine.cqp.corpus.query.CQLQuery; |
| 24 | 24 |
import org.txm.utils.OSDetector; |
| 25 | 25 |
import org.txm.utils.Sh; |
| 26 |
import org.txm.utils.io.IOUtils; |
|
| 26 | 27 |
import org.txm.utils.logger.Log; |
| 27 | 28 |
|
| 28 | 29 |
public class CQPSearchEngine extends SearchEngine {
|
| ... | ... | |
| 71 | 72 |
System.out.println("Error: Toolbox is not correctly initialized. Aborting CQP engine start...");
|
| 72 | 73 |
return false; |
| 73 | 74 |
} |
| 74 |
for (File binDir : wl.listFiles()) {
|
|
| 75 |
for (File binDir : wl.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 75 | 76 |
if (!binDir.isDirectory()) continue; |
| 76 |
if (binDir.isHidden()) continue; |
|
| 77 | 77 |
if (binDir.getName().startsWith(".")) continue;
|
| 78 | 78 |
if (binDir.getName().startsWith("~")) continue;
|
| 79 | 79 |
|
| 80 | 80 |
File registryDir = new File(binDir, "registry"); |
| 81 | 81 |
if (!registryDir.isDirectory()) continue; |
| 82 | 82 |
|
| 83 |
File[] files = registryDir.listFiles(); |
|
| 83 |
File[] files = registryDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 84 | 84 |
if (files != null && files.length > 0) {
|
| 85 | 85 |
reg_path += path_separator + registryDir.getAbsolutePath(); |
| 86 | 86 |
for (File registryFile : files) {
|
| tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/FixMilestoneDeclarations.java (revision 1370) | ||
|---|---|---|
| 9 | 9 |
import java.util.ArrayList; |
| 10 | 10 |
import java.util.HashMap; |
| 11 | 11 |
|
| 12 |
import org.txm.utils.io.IOUtils; |
|
| 13 |
|
|
| 12 | 14 |
/** |
| 13 | 15 |
* Remove milestone declarations and index files. Milestones are empty structures that cannot be used with CQL |
| 14 | 16 |
* |
| ... | ... | |
| 56 | 58 |
reader.close(); |
| 57 | 59 |
if (debug) System.out.println("Structures: "+structures);
|
| 58 | 60 |
|
| 59 |
File[] files = dataDirectory.listFiles(); |
|
| 61 |
File[] files = dataDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 60 | 62 |
if (files == null) return false; |
| 61 | 63 |
|
| 62 | 64 |
//removing empty data files |
| tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/PatchCwbRegistry.java (revision 1370) | ||
|---|---|---|
| 282 | 282 |
System.out.println("rename "+oldname+".* files to "+newname+".*"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
| 283 | 283 |
File datadir = new File(datapath); |
| 284 | 284 |
if (datadir.exists()) {
|
| 285 |
for (File f : datadir.listFiles()) |
|
| 285 |
for (File f : datadir.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 286 | 286 |
if (f.getName().startsWith(oldname+".")) //$NON-NLS-1$ |
| 287 | 287 |
f.renameTo(new File(f.getParent(), f.getName().replace(oldname+".", newname+"."))); //$NON-NLS-1$ //$NON-NLS-2$ |
| 288 | 288 |
} |
| tmp/org.txm.searchengine.cqp.core/src/org/txm/importer/cwb/CwbEncode.java (revision 1370) | ||
|---|---|---|
| 328 | 328 |
return; |
| 329 | 329 |
} |
| 330 | 330 |
|
| 331 |
for (File corpus : corpora.listFiles()) {
|
|
| 331 |
for (File corpus : corpora.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 332 | 332 |
if (!corpus.isDirectory()) continue; |
| 333 | 333 |
|
| 334 | 334 |
System.out.println(TXMCoreMessages.bind(CQPSearchEngineCoreMessages.processingCorpus, corpus.getName())); |
| tmp/org.txm.groovy.core/src/java/org/txm/groovy/core/GroovyImportEngine.java (revision 1370) | ||
|---|---|---|
| 10 | 10 |
import org.txm.core.engines.ImportEngines; |
| 11 | 11 |
import org.txm.core.engines.ScriptedImportEngine; |
| 12 | 12 |
import org.txm.objects.Project; |
| 13 |
import org.txm.utils.io.IOUtils; |
|
| 13 | 14 |
|
| 14 | 15 |
public class GroovyImportEngine extends ImportEngine {
|
| 15 | 16 |
|
| ... | ... | |
| 27 | 28 |
if (!importsPackageDirectory.exists()) {
|
| 28 | 29 |
return false; |
| 29 | 30 |
} |
| 30 |
for (File dir : importsPackageDirectory.listFiles()) {
|
|
| 31 |
for (File dir : importsPackageDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 31 | 32 |
if (!dir.isDirectory()) continue; |
| 32 |
if (dir.isHidden()) continue; |
|
| 33 | 33 |
|
| 34 | 34 |
String name = dir.getName(); |
| 35 | 35 |
File loader = new File(dir, name+"Loader.groovy"); |
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/ExternalizationFilesUpdater.java (revision 1370) | ||
|---|---|---|
| 55 | 55 |
import java.util.LinkedList; |
| 56 | 56 |
import java.util.List; |
| 57 | 57 |
|
| 58 |
import org.txm.utils.io.IOUtils; |
|
| 59 |
|
|
| 58 | 60 |
// TODO: Auto-generated Javadoc |
| 59 | 61 |
/** |
| 60 | 62 |
* Tool to update the key of externalization files xxxx_fr.properties |
| ... | ... | |
| 278 | 280 |
File current = files.removeFirst(); |
| 279 | 281 |
if (current.isDirectory() && !current.getName().equals("bin")) {
|
| 280 | 282 |
List<File> currentpfiles = new ArrayList<File>(); |
| 281 |
for (File sfile : current.listFiles()) {
|
|
| 283 |
for (File sfile : current.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 282 | 284 |
if (sfile.isDirectory()) |
| 283 | 285 |
files.add(sfile); |
| 284 | 286 |
else if(sfile.getName().endsWith(".properties") && (sfile.getName().startsWith("messages") || sfile.getName().startsWith("bundle")) )
|
| ... | ... | |
| 303 | 305 |
String userdir = System.getProperty("user.home");
|
| 304 | 306 |
File workspaceDir = new File(userdir, "workspace047/org.txm.annotation.urs.rcp"); |
| 305 | 307 |
|
| 306 |
for (File project : workspaceDir.listFiles()) {
|
|
| 308 |
for (File project : workspaceDir.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 307 | 309 |
if (!project.isDirectory()) continue; |
| 308 | 310 |
if (project.isHidden()) continue; |
| 309 | 311 |
// if (!project.getName().endsWith(".rcp")) continue;
|
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/ExternalizationFilesUpdater.groovy (revision 1370) | ||
|---|---|---|
| 47 | 47 |
import java.io.File; |
| 48 | 48 |
import java.io.FileInputStream; |
| 49 | 49 |
import java.io.InputStreamReader; |
| 50 |
import java.util.LinkedList; |
|
| 50 |
import java.util.LinkedList; |
|
| 51 |
|
|
| 52 |
import org.txm.utils.io.IOUtils |
|
| 51 | 53 |
|
| 52 | 54 |
// TODO: Auto-generated Javadoc |
| 53 | 55 |
/** |
| ... | ... | |
| 268 | 270 |
if(current.isDirectory()) |
| 269 | 271 |
{
|
| 270 | 272 |
List<String> currentpfiles = []; |
| 271 |
for(File sfile : current.listFiles()) |
|
| 273 |
for(File sfile : current.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 272 | 274 |
{
|
| 273 | 275 |
if(sfile.isDirectory()) |
| 274 | 276 |
files.add(sfile); |
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/MergeExternalizedStringFiles.groovy (revision 1370) | ||
|---|---|---|
| 3 | 3 |
import java.io.File; |
| 4 | 4 |
import org.eclipse.osgi.util.NLS; |
| 5 | 5 |
import org.txm.utils.DeleteDir; |
| 6 |
import org.txm.utils.io.IOUtils |
|
| 6 | 7 |
|
| 7 | 8 |
/** |
| 8 | 9 |
* Scan for *.properties files and merge them into one |
| ... | ... | |
| 33 | 34 |
continue; |
| 34 | 35 |
//System.out.println("Dir: "+dir);
|
| 35 | 36 |
externalizeMessages = new ArrayList<File>(); |
| 36 |
for (File f : dir.listFiles()) {
|
|
| 37 |
for (File f : dir.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 37 | 38 |
if (f.getName() == "Messages.java") |
| 38 | 39 |
messageClass = f |
| 39 | 40 |
if (f.getName() =~ "messages(_..)?\\.properties") |
| ... | ... | |
| 89 | 90 |
if (current.isDirectory() && !current.getName().startsWith(".")) {
|
| 90 | 91 |
//println "add dir: "+current |
| 91 | 92 |
List<String> currentpfiles = []; |
| 92 |
for (File sfile : current.listFiles()) {
|
|
| 93 |
for (File sfile : current.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 93 | 94 |
if (sfile.isDirectory()) |
| 94 | 95 |
files.add(sfile); |
| 95 | 96 |
} |
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/PluginMessagesManager.java (revision 1370) | ||
|---|---|---|
| 199 | 199 |
|
| 200 | 200 |
if (this.javaMessageFile != null) {
|
| 201 | 201 |
|
| 202 |
File[] propFiles = javaMessageFile.getParentFile().listFiles(); |
|
| 202 |
File[] propFiles = javaMessageFile.getParentFile().listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 203 | 203 |
for (File propFile : propFiles) {
|
| 204 | 204 |
String name = propFile.getName(); |
| 205 | 205 |
if (!name.endsWith(".properties")) continue;
|
| ... | ... | |
| 255 | 255 |
|
| 256 | 256 |
File osgiInf = new File(projectDirectory, "OSGI-INF/l10n"); |
| 257 | 257 |
if (osgiInf.exists()) {
|
| 258 |
for (File propFile : osgiInf.listFiles()) {
|
|
| 258 |
for (File propFile : osgiInf.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 259 | 259 |
if (propFile.getName().startsWith("bundle") && propFile.getName().endsWith(".properties")) {
|
| 260 | 260 |
Properties props = new Properties(); |
| 261 | 261 |
props.load(IOUtils.getReader(propFile)); |
| ... | ... | |
| 352 | 352 |
return null; |
| 353 | 353 |
} |
| 354 | 354 |
|
| 355 |
for (File messagesJavaFile : messagesPackageDir.listFiles()) {
|
|
| 355 |
for (File messagesJavaFile : messagesPackageDir.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 356 | 356 |
if (messagesJavaFile.isDirectory()) continue; |
| 357 | 357 |
if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
|
| 358 | 358 |
return messagesJavaFile; |
| ... | ... | |
| 376 | 376 |
// return null; |
| 377 | 377 |
// } |
| 378 | 378 |
// |
| 379 |
// for (File messagesJavaFile : messagesPackageDir.listFiles()) {
|
|
| 379 |
// for (File messagesJavaFile : messagesPackageDir.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 380 | 380 |
// if (messagesJavaFile.isDirectory()) continue; |
| 381 | 381 |
// if (!messagesJavaFile.getName().endsWith("Messages.java")) continue;
|
| 382 | 382 |
// return messagesJavaFile; |
| ... | ... | |
| 726 | 726 |
* Parses the specified path and stores a list of the source files. |
| 727 | 727 |
*/ |
| 728 | 728 |
private void createSourceFilesList(File path) {
|
| 729 |
File[] list = path.listFiles(); |
|
| 729 |
File[] list = path.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 730 | 730 |
|
| 731 | 731 |
if (list == null) {
|
| 732 | 732 |
return; |
| tmp/org.txm.translate.rcp/src/org/txm/rcp/translate/i18n/WorkspaceMessagesManager.java (revision 1370) | ||
|---|---|---|
| 105 | 105 |
|
| 106 | 106 |
System.out.println("Initializing project messages...");
|
| 107 | 107 |
ArrayList<File> files = new ArrayList<File>(); |
| 108 |
for (File project : workspaceLocation.listFiles()) {
|
|
| 108 |
for (File project : workspaceLocation.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 109 | 109 |
if (!project.isDirectory()) continue; |
| 110 | 110 |
if (project.isHidden()) continue; |
| 111 | 111 |
if (!project.getName().startsWith("org.txm")) continue;
|
| tmp/org.txm.translate.rcp/.~lock.messages_fr.ods# (revision 1370) | ||
|---|---|---|
| 1 |
,mdecorde,matthieuPC,13.11.2018 16:47,file:///home/mdecorde/.config/libreoffice/4; |
|
| tmp/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/conversion/CorpusRuledConvertion.java (revision 1370) | ||
|---|---|---|
| 61 | 61 |
System.out.println("'"+corpus.getName()+"' corpus directory not found in "+txmDirectory.getAbsolutePath());
|
| 62 | 62 |
return false; |
| 63 | 63 |
} |
| 64 |
File[] files = txmCorpusDirectory.listFiles(); |
|
| 64 |
File[] files = txmCorpusDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 65 | 65 |
if (files == null || files.length == 0) {
|
| 66 | 66 |
System.out.println("No file in "+txmCorpusDirectory);
|
| 67 | 67 |
return false; |
| tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/AnnotateWTC.groovy (revision 1370) | ||
|---|---|---|
| 38 | 38 |
import org.txm.stat.utils.ConsoleProgressBar |
| 39 | 39 |
import org.txm.utils.DeleteDir; |
| 40 | 40 |
import org.txm.utils.LangDetector; |
| 41 |
import org.txm.utils.io.IOUtils |
|
| 41 | 42 |
import org.txm.utils.treetagger.TreeTagger |
| 42 | 43 |
|
| 43 | 44 |
// TODO: Auto-generated Javadoc |
| ... | ... | |
| 123 | 124 |
annotDir.mkdir(); |
| 124 | 125 |
|
| 125 | 126 |
//BUILD TT FILE READY TO BE TAGGED |
| 126 |
List<File> files = txmDir.listFiles() |
|
| 127 |
List<File> files = txmDir.listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 127 | 128 |
|
| 128 | 129 |
// get model file and check it |
| 129 | 130 |
File modelfile = new File(Toolbox.getPreference(Toolbox.TREETAGGER_MODELS_PATH), modelfilename); |
| tmp/org.txm.treetagger.core/src/org/txm/importer/xmltxm/Annotate.groovy (revision 1370) | ||
|---|---|---|
| 41 | 41 |
import org.txm.stat.utils.ConsoleProgressBar; |
| 42 | 42 |
import org.txm.treetagger.core.preferences.TreeTaggerPreferences |
| 43 | 43 |
import org.txm.utils.LangDetector; |
| 44 |
import org.txm.utils.io.IOUtils |
|
| 44 | 45 |
import org.txm.utils.logger.Log; |
| 45 | 46 |
import org.txm.utils.treetagger.TreeTagger |
| 46 | 47 |
|
| ... | ... | |
| 308 | 309 |
ArrayList<String> milestones = []; |
| 309 | 310 |
|
| 310 | 311 |
//BUILD TT FILE READY TO BE TAGGED |
| 311 |
List<File> files = txmDir.listFiles() |
|
| 312 |
List<File> files = txmDir.listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 312 | 313 |
|
| 313 | 314 |
println("Building TT source files ("+files.size()+") from directory "+txmDir)
|
| 314 | 315 |
ConsoleProgressBar cpb = new ConsoleProgressBar(files.size()) |
| ... | ... | |
| 337 | 338 |
//Convert encoding if needed |
| 338 | 339 |
|
| 339 | 340 |
//APPLY TREETAGGER |
| 340 |
files = new File(binDir, "treetagger").listFiles() |
|
| 341 |
files = new File(binDir, "treetagger").listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 341 | 342 |
println("Applying $modelfilename TreeTagger model on dir: "+new File(binDir, "treetagger")+ " ("+files.size()+" files)")
|
| 342 | 343 |
if (files == null || files.size() == 0) |
| 343 | 344 |
return false; |
| ... | ... | |
| 400 | 401 |
} |
| 401 | 402 |
|
| 402 | 403 |
initTTOutfileInfos(binDir, modelfile, modelfilename); |
| 403 |
files = new File(binDir, "treetagger").listFiles()// now contains the result files of TT |
|
| 404 |
files = new File(binDir, "treetagger").listFiles(IOUtils.FILTER_HIDDEN)// now contains the result files of TT
|
|
| 404 | 405 |
println "Building stdoff files ("+files.size()+") from dir:"+new File(binDir, "treetagger")+" to "+new File(binDir, "annotations");
|
| 405 | 406 |
if (files == null || files.size() == 0) |
| 406 | 407 |
return false; |
| ... | ... | |
| 416 | 417 |
if (cancelNow) return; |
| 417 | 418 |
|
| 418 | 419 |
//INJECT ANNOTATIONS |
| 419 |
List<File> interpfiles = new File(binDir, "annotations").listFiles(); |
|
| 420 |
List<File> txmfiles = txmDir.listFiles(); |
|
| 420 |
List<File> interpfiles = new File(binDir, "annotations").listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 421 |
List<File> txmfiles = txmDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 421 | 422 |
if (txmfiles == null) {
|
| 422 | 423 |
println "No file to annotate in "+txmDir.getAbsolutePath() |
| 423 | 424 |
return false; |
| ... | ... | |
| 480 | 481 |
return true; |
| 481 | 482 |
} |
| 482 | 483 |
|
| 483 |
List<File> listfiles = txmDir.listFiles(); |
|
| 484 |
List<File> listfiles = txmDir.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 484 | 485 |
|
| 485 | 486 |
//cleaning |
| 486 | 487 |
File annotDir = new File(binDir,"annotations"); |
| ... | ... | |
| 497 | 498 |
int coresToUse = Math.max(1.0, cores * 0.7) |
| 498 | 499 |
ExecutorService pool = Executors.newFixedThreadPool(coresToUse) |
| 499 | 500 |
|
| 500 |
def files = txmDir.listFiles() |
|
| 501 |
def files = txmDir.listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 501 | 502 |
ConsoleProgressBar cpb = new ConsoleProgressBar(files.size()) |
| 502 | 503 |
for (File teiFile : files) {
|
| 503 | 504 |
int counter = 1; |
| tmp/org.txm.core/src/java/org/txm/scripts/importer/TabulatedToXml.groovy (revision 1370) | ||
|---|---|---|
| 37 | 37 |
import javax.xml.stream.XMLOutputFactory; |
| 38 | 38 |
import javax.xml.stream.XMLStreamWriter; |
| 39 | 39 |
|
| 40 |
import org.txm.utils.io.IOUtils |
|
| 41 |
|
|
| 40 | 42 |
// TODO: Auto-generated Javadoc |
| 41 | 43 |
/** |
| 42 | 44 |
* Tool to convert Tabulated file to xml file. Such as CWB files or TreeTagger ouput |
| ... | ... | |
| 227 | 229 |
String encoding = "UTF-8"; |
| 228 | 230 |
|
| 229 | 231 |
TabulatedToXml ttx = new TabulatedToXml(colnames, "debat", tag); |
| 230 |
for(File tabulatedfile : srcdir.listFiles()) |
|
| 232 |
for(File tabulatedfile : srcdir.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 231 | 233 |
{
|
| 232 | 234 |
if(tabulatedfile.getName().endsWith(".txt"))
|
| 233 | 235 |
{
|
| tmp/org.txm.core/src/java/org/txm/scripts/importer/DisplayXmlTags.groovy (revision 1370) | ||
|---|---|---|
| 31 | 31 |
import java.util.ArrayList; |
| 32 | 32 |
import java.io.File; |
| 33 | 33 |
import javax.xml.stream.*; |
| 34 |
|
|
| 35 |
import org.txm.utils.io.IOUtils |
|
| 36 |
|
|
| 34 | 37 |
import java.net.URL; |
| 35 | 38 |
|
| 36 | 39 |
// TODO: Auto-generated Javadoc |
| ... | ... | |
| 58 | 61 |
*/ |
| 59 | 62 |
public DisplayXmlTags(File infile) {
|
| 60 | 63 |
if (infile.isDirectory()) {
|
| 61 |
for (File f : infile.listFiles()) {
|
|
| 64 |
for (File f : infile.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 62 | 65 |
processxmlFile(f); |
| 63 | 66 |
} |
| 64 | 67 |
} else |
| tmp/org.txm.core/src/java/org/txm/scripts/importer/SAttributesListener.groovy (revision 1370) | ||
|---|---|---|
| 5 | 5 |
|
| 6 | 6 |
import javax.xml.stream.*; |
| 7 | 7 |
|
| 8 |
import org.txm.utils.io.IOUtils |
|
| 9 |
|
|
| 8 | 10 |
/** |
| 9 | 11 |
* Read an XML file and find out : XML elements, their attributes and recursivity level |
| 10 | 12 |
* names are lowercases |
| ... | ... | |
| 202 | 204 |
public static SAttributesListener scanFiles(File xmlDirectory, String wordTag) {
|
| 203 | 205 |
SAttributesListener listener = new SAttributesListener() |
| 204 | 206 |
listener.W = wordTag |
| 205 |
for (File xmlFile : xmlDirectory.listFiles()) {
|
|
| 207 |
for (File xmlFile : xmlDirectory.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 206 | 208 |
if (xmlFile.isFile() && !xmlFile.isHidden() && xmlFile.getName().toLowerCase().endsWith(".xml")) {
|
| 207 | 209 |
scanFile(xmlFile, listener); // results saved in 'listener' data |
| 208 | 210 |
// println "LISTENER RESULT with ${xmlFile.getName()}: "+listener
|
| tmp/org.txm.core/src/java/org/txm/scripts/importer/WExtract.groovy (revision 1370) | ||
|---|---|---|
| 38 | 38 |
import javax.xml.transform.dom.DOMSource; |
| 39 | 39 |
import javax.xml.transform.stream.StreamResult; |
| 40 | 40 |
|
| 41 |
import org.txm.utils.io.IOUtils |
|
| 41 | 42 |
import org.w3c.dom.Document; |
| 42 | 43 |
import org.w3c.dom.Element; |
| 43 | 44 |
import org.w3c.dom.NodeList; |
| ... | ... | |
| 319 | 320 |
} |
| 320 | 321 |
println maxperfile; |
| 321 | 322 |
|
| 322 |
def files = directory.listFiles(); |
|
| 323 |
for(File infile : files) |
|
| 324 |
{
|
|
| 325 |
|
|
| 326 |
if(maxperfile.containsKey(infile.getName())) |
|
| 327 |
{
|
|
| 323 |
def files = directory.listFiles(IOUtils.FILTER_HIDDEN); |
|
| 324 |
for (File infile : files) {
|
|
| 325 |
if (maxperfile.containsKey(infile.getName())) {
|
|
| 328 | 326 |
File outfile = new File(outdir, infile.getName()); |
| 329 | 327 |
int max= maxperfile.get(infile.getName()); |
| 330 | 328 |
new WExtract().process(infile, outfile, max) |
| tmp/org.txm.core/src/java/org/txm/scripts/importer/WExtractWithMode.groovy (revision 1370) | ||
|---|---|---|
| 38 | 38 |
import javax.xml.transform.dom.DOMSource; |
| 39 | 39 |
import javax.xml.transform.stream.StreamResult; |
| 40 | 40 |
|
| 41 |
import org.txm.utils.io.IOUtils |
|
| 41 | 42 |
import org.w3c.dom.Document; |
| 42 | 43 |
import org.w3c.dom.Element; |
| 43 | 44 |
import org.w3c.dom.NodeList; |
| ... | ... | |
| 361 | 362 |
} |
| 362 | 363 |
println maxperfile; |
| 363 | 364 |
|
| 364 |
def files = directory.listFiles(); |
|
| 365 |
for(File infile : files) |
|
| 366 |
{
|
|
| 367 |
|
|
| 368 |
if(maxperfile.containsKey(infile.getName())) |
|
| 369 |
{
|
|
| 365 |
def files = directory.listFiles(IOUtils.FILTER_HIDDEN); |
|
| 366 |
for(File infile : files) {
|
|
| 367 |
if(maxperfile.containsKey(infile.getName())) {
|
|
| 370 | 368 |
File outfile = new File(outdir, infile.getName()); |
| 371 | 369 |
String modemax = maxperfile.get(infile.getName()); |
| 372 | 370 |
new WExtractWithMode().process(infile, outfile, modemax) |
| tmp/org.txm.core/src/java/org/txm/scripts/importer/XMLText2TXTCSV.groovy (revision 1370) | ||
|---|---|---|
| 1 | 1 |
package org.txm.scripts.importer |
| 2 | 2 |
|
| 3 | 3 |
import org.txm.metadatas.Metadatas |
| 4 |
import org.txm.utils.io.IOUtils |
|
| 4 | 5 |
|
| 5 | 6 |
File dir = new File("/home/mdecorde/xml/voeux/split_xml")
|
| 6 | 7 |
File outdir = new File("/home/mdecorde/xml/voeux/split_txtcsv")
|
| ... | ... | |
| 10 | 11 |
File metadatafile = Metadatas.findMetadataFile(outdir) |
| 11 | 12 |
String csvString = "" |
| 12 | 13 |
|
| 13 |
def files = dir.listFiles() |
|
| 14 |
def files = dir.listFiles(IOUtils.FILTER_HIDDEN)
|
|
| 14 | 15 |
files.sort() |
| 15 |
for(File f : files) |
|
| 16 |
{
|
|
| 16 |
for(File f : files) {
|
|
| 17 | 17 |
File outfile = new File(outdir, f.getName()+".txt"); |
| 18 | 18 |
String text = f.getText("UTF-8");
|
| 19 | 19 |
String texttag = text.find("<text id.*>")
|
| tmp/org.txm.core/src/java/org/txm/scripts/importer/ApplyXsl.groovy (revision 1370) | ||
|---|---|---|
| 51 | 51 |
import javax.xml.transform.Transformer |
| 52 | 52 |
import javax.xml.transform.TransformerFactory |
| 53 | 53 |
import javax.xml.transform.stream.StreamResult |
| 54 |
import javax.xml.transform.stream.StreamSource; |
|
| 55 |
|
|
| 54 |
import javax.xml.transform.stream.StreamSource; |
|
| 55 |
|
|
| 56 |
import org.txm.utils.io.IOUtils |
|
| 57 |
|
|
| 56 | 58 |
import net.sf.saxon.*; |
| 57 | 59 |
import net.sf.saxon.s9api.*; |
| 58 | 60 |
|
| ... | ... | |
| 220 | 222 |
assert(srcdirectory.canRead()) |
| 221 | 223 |
assert(srcdirectory.canExecute()) |
| 222 | 224 |
|
| 223 |
List<File> files = srcdirectory.listFiles(); |
|
| 225 |
List<File> files = srcdirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 224 | 226 |
|
| 225 | 227 |
files = files.findAll{item-> item.getName().endsWith(".xml")}
|
| 226 | 228 |
|
| tmp/org.txm.core/src/java/org/txm/importer/scripts/filters/FilterManager.java (revision 1370) | ||
|---|---|---|
| 32 | 32 |
|
| 33 | 33 |
import org.eclipse.osgi.util.NLS; |
| 34 | 34 |
import org.txm.core.messages.TXMCoreMessages; |
| 35 |
import org.txm.utils.io.IOUtils; |
|
| 35 | 36 |
|
| 36 | 37 |
// TODO: Auto-generated Javadoc |
| 37 | 38 |
/** |
| ... | ... | |
| 63 | 64 |
System.out |
| 64 | 65 |
.println(NLS.bind(TXMCoreMessages.filterManagerErrorColonInitializationP0NotFound, path)); |
| 65 | 66 |
else {
|
| 66 |
File[] list = home.listFiles(); |
|
| 67 |
File[] list = home.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 67 | 68 |
for (File f : list) |
| 68 | 69 |
if (f.isDirectory()) {
|
| 69 | 70 |
this.hashtable.put(f.getName(), f.getPath()); |
| tmp/org.txm.core/src/java/org/txm/importer/scripts/filters/CatalogManager.java (revision 1370) | ||
|---|---|---|
| 32 | 32 |
|
| 33 | 33 |
import org.eclipse.osgi.util.NLS; |
| 34 | 34 |
import org.txm.core.messages.TXMCoreMessages; |
| 35 |
import org.txm.utils.io.IOUtils; |
|
| 35 | 36 |
|
| 36 | 37 |
// TODO: Auto-generated Javadoc |
| 37 | 38 |
/** |
| ... | ... | |
| 57 | 58 |
System.out |
| 58 | 59 |
.println(NLS.bind(TXMCoreMessages.managerErrorDuringInitializationColonP0NotFound, path)); |
| 59 | 60 |
else {
|
| 60 |
File[] list = home.listFiles(); |
|
| 61 |
File[] list = home.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 61 | 62 |
for (File f : list) |
| 62 | 63 |
this.put(f.getName(), new Catalog(f.getPath())); |
| 63 | 64 |
} |
| tmp/org.txm.core/src/java/org/txm/importer/ApplyXsl2.java (revision 1370) | ||
|---|---|---|
| 502 | 502 |
*/ |
| 503 | 503 |
public static boolean processWithMultipleXSL(File[] filesToProcess, File xslDirectory, HashMap<String, Object> xslParams) throws TransformerException, IOException {
|
| 504 | 504 |
if (xslDirectory.exists()) {
|
| 505 |
File[] xslFiles = xslDirectory.listFiles(); |
|
| 505 |
File[] xslFiles = xslDirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 506 | 506 |
Arrays.sort(xslFiles); |
| 507 | 507 |
return processWithMultipleXSL(filesToProcess, xslFiles, xslParams); |
| 508 | 508 |
} else {
|
| ... | ... | |
| 557 | 557 |
assert(srcdirectory.canRead()); |
| 558 | 558 |
assert(srcdirectory.canExecute()); |
| 559 | 559 |
|
| 560 |
File[] files = srcdirectory.listFiles(); |
|
| 560 |
File[] files = srcdirectory.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 561 | 561 |
System.out.println("process : "+srcdirectory+"/*");
|
| 562 | 562 |
System.out.println("with : "+xslfile);
|
| 563 | 563 |
long bigstart = System.currentTimeMillis(); |
| tmp/org.txm.core/src/java/org/txm/importer/Convert5To6.java (revision 1370) | ||
|---|---|---|
| 14 | 14 |
import org.txm.objects.BaseOldParameters; |
| 15 | 15 |
import org.txm.objects.Page; |
| 16 | 16 |
import org.txm.utils.io.FileCopy; |
| 17 |
import org.txm.utils.io.IOUtils; |
|
| 17 | 18 |
import org.txm.utils.xml.DomUtils; |
| 18 | 19 |
import org.txm.utils.zip.Zip; |
| 19 | 20 |
import org.w3c.dom.Document; |
| ... | ... | |
| 85 | 86 |
return false; |
| 86 | 87 |
} |
| 87 | 88 |
|
| 88 |
return REGISTRY.listFiles().length > 0; |
|
| 89 |
return REGISTRY.listFiles(IOUtils.FILTER_HIDDEN).length > 0;
|
|
| 89 | 90 |
} |
| 90 | 91 |
|
| 91 | 92 |
private boolean process() throws Exception {
|
| 92 | 93 |
System.out.println(TXMCoreMessages.processing); |
| 93 |
String corpusname = REGISTRY.listFiles()[0].getName().toUpperCase(); |
|
| 94 |
String corpusname = REGISTRY.listFiles(IOUtils.FILTER_HIDDEN)[0].getName().toUpperCase();
|
|
| 94 | 95 |
|
| 95 | 96 |
// create the corpus directories |
| 96 | 97 |
File HTMLc = new File(HTMLs, corpusname); |
| ... | ... | |
| 102 | 103 |
// mkdirs |
| 103 | 104 |
HTMLc.mkdir(); |
| 104 | 105 |
HTMLcmulti.mkdir(); |
| 105 |
File[] files = HTMLs.listFiles(); |
|
| 106 |
File[] files = HTMLs.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 106 | 107 |
if (files != null && files.length > 1) |
| 107 | 108 |
HTMLconepage.mkdir(); |
| 108 | 109 |
TXMc.mkdir(); |
| ... | ... | |
| 110 | 111 |
|
| 111 | 112 |
System.out.println(NLS.bind(TXMCoreMessages.reorganizingFilesOfP0, OUTDIR)); |
| 112 | 113 |
// move files |
| 113 |
for (File f : HTMLmulti.listFiles()) |
|
| 114 |
for (File f : HTMLmulti.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 114 | 115 |
f.renameTo(new File(HTMLcmulti, f.getName())); |
| 115 | 116 |
if (HTMLconepage.exists()) {
|
| 116 |
for (File f : HTMLs.listFiles()) |
|
| 117 |
for (File f : HTMLs.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 117 | 118 |
if (f.isFile()) |
| 118 | 119 |
f.renameTo(new File(HTMLconepage, f.getName())); |
| 119 | 120 |
} |
| 120 |
for (File f : DATAs.listFiles()) |
|
| 121 |
for (File f : DATAs.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 121 | 122 |
f.renameTo(new File(DATAc, f.getName())); |
| 122 |
for (File f : TXMs.listFiles()) |
|
| 123 |
for (File f : TXMs.listFiles(IOUtils.FILTER_HIDDEN))
|
|
| 123 | 124 |
f.renameTo(new File(TXMc, f.getName())); |
| 124 | 125 |
|
| 125 | 126 |
// remove unused dir |
| ... | ... | |
| 181 | 182 |
//process xml-txm files |
| 182 | 183 |
//params.addEditionDefinition(corpusElem, "default", "groovy", ""); |
| 183 | 184 |
params.addEditionDefinition(corpusElem, "onepage", "groovy", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ |
| 184 |
for (File txmFile : TXMc.listFiles()) {
|
|
| 185 |
for (File txmFile : TXMc.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 185 | 186 |
System.out.println(NLS.bind(TXMCoreMessages.processingTextColonP0, txmFile)); |
| 186 | 187 |
String textname = txmFile.getName(); |
| 187 | 188 |
textname = textname.substring(0, textname.lastIndexOf(".")); //$NON-NLS-1$
|
| ... | ... | |
| 189 | 190 |
Element textElem = params.addText(corpusElem, textname, txmFile); |
| 190 | 191 |
Element editionElem = params.addEdition(textElem, "default", HTMLc.getAbsolutePath(), "html"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 191 | 192 |
|
| 192 |
File[] htmlfiles = HTMLcmulti.listFiles(); |
|
| 193 |
File[] htmlfiles = HTMLcmulti.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 193 | 194 |
Arrays.sort(htmlfiles, new Comparator<File>() {
|
| 194 | 195 |
@Override |
| 195 | 196 |
public int compare(File arg0, File arg1) {
|
| ... | ... | |
| 208 | 209 |
// add default Edition |
| 209 | 210 |
if (HTMLconepage.exists()) {
|
| 210 | 211 |
editionElem = params.addEdition(textElem, "onepage", HTMLc.getAbsolutePath(), "html"); //$NON-NLS-1$ //$NON-NLS-2$ |
| 211 |
htmlfiles = HTMLconepage.listFiles(); |
|
| 212 |
htmlfiles = HTMLconepage.listFiles(IOUtils.FILTER_HIDDEN);
|
|
| 212 | 213 |
pagecounter = 1; |
| 213 | 214 |
for (File page : htmlfiles) {
|
| 214 | 215 |
if (page.getName().startsWith(textname)) {
|
| tmp/org.txm.core/src/java/org/txm/importer/EncodingConverter.java (revision 1370) | ||
|---|---|---|
| 182 | 182 |
|
| 183 | 183 |
while (racine != null) {
|
| 184 | 184 |
if (racine.exists()) |
| 185 |
for (File f : racine.listFiles()) {
|
|
| 185 |
for (File f : racine.listFiles(IOUtils.FILTER_HIDDEN)) {
|
|
| 186 | 186 |
// System.out.println("scan file "+f);
|
| 187 | 187 |
if (f.isDirectory()) {
|
| 188 | 188 |
if (!f.getName().equals(".svn"))
|
Formats disponibles : Unified diff