Révision 2483
tmp/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/MainCorpus.java (revision 2483) | ||
---|---|---|
289 | 289 |
} |
290 | 290 |
|
291 | 291 |
/** |
292 |
* Export. |
|
293 |
* |
|
294 |
* @param exportzip the exportzip |
|
295 |
* @return true, if successful |
|
296 |
*/ |
|
297 |
@Override |
|
298 |
public boolean export(File exportzip) { |
|
299 |
return export(exportzip, null); |
|
300 |
} |
|
301 |
|
|
302 |
|
|
303 |
|
|
304 |
|
|
305 |
/** |
|
306 |
* Export. |
|
307 |
* |
|
308 |
* @param exportzip the exportzip |
|
309 |
* @return true, if successful |
|
310 |
*/ |
|
311 |
@Override |
|
312 |
public boolean export(File exportzip, IProgressMonitor monitor) { |
|
313 |
if (this.getProject() != null) { |
|
314 |
try { |
|
315 |
this.getProject().saveParameters(true); // write parameters in preferences |
|
316 |
this.getProject().persist(true); // save preferences |
|
317 |
return this.getProject().export(exportzip, monitor); |
|
318 |
} |
|
319 |
catch (Exception e) { |
|
320 |
// TODO Auto-generated catch block |
|
321 |
e.printStackTrace(); |
|
322 |
} |
|
323 |
} |
|
324 |
return false; |
|
325 |
} |
|
326 |
|
|
327 |
/** |
|
328 | 292 |
* Find text no. |
329 | 293 |
* |
330 | 294 |
* @param textid the textid |
tmp/org.txm.core/src/java/org/txm/objects/CorpusBuild.java (revision 2483) | ||
---|---|---|
33 | 33 |
import java.util.ArrayList; |
34 | 34 |
import java.util.Arrays; |
35 | 35 |
import java.util.HashMap; |
36 |
import java.util.HashSet; |
|
36 | 37 |
import java.util.List; |
37 | 38 |
|
38 | 39 |
import org.eclipse.core.runtime.IProgressMonitor; |
... | ... | |
472 | 473 |
// } |
473 | 474 |
|
474 | 475 |
public boolean export(File exportzip) { |
475 |
return export(exportzip, null); |
|
476 |
return export(exportzip, null, null);
|
|
476 | 477 |
} |
477 | 478 |
|
478 |
/** |
|
479 |
* Export. |
|
480 |
* |
|
481 |
* @param exportzip the exportzip |
|
482 |
* @return true, if successful |
|
483 |
*/ |
|
484 |
public boolean export(File exportzip, IProgressMonitor monitor) { |
|
485 |
File binarydir = this.getProjectDirectory(); |
|
486 |
if (binarydir.exists() && exportzip.getParentFile().exists()) { |
|
479 |
public boolean export(File exportzip, IProgressMonitor monitor, HashSet<String> ignore) { |
|
480 |
if (this.getProject() != null) { |
|
487 | 481 |
try { |
488 |
Zip.compress(binarydir, exportzip, monitor); |
|
482 |
this.getProject().saveParameters(true); // write parameters in preferences |
|
483 |
this.getProject().persist(true); // save preferences |
|
484 |
return this.getProject().export(exportzip, monitor, ignore); |
|
489 | 485 |
} |
490 |
catch (IOException e) {
|
|
491 |
org.txm.utils.logger.Log.printStackTrace(e);
|
|
492 |
return false;
|
|
486 |
catch (Exception e) { |
|
487 |
// TODO Auto-generated catch block
|
|
488 |
e.printStackTrace();
|
|
493 | 489 |
} |
494 |
return true; |
|
495 | 490 |
} |
496 |
else { |
|
497 |
System.out.println(NLS.bind(TXMCoreMessages.binaryDirectoryP0NotFound, binarydir)); |
|
498 |
System.out.println(NLS.bind(TXMCoreMessages.parentDirectoryP0NotFound, exportzip.getParentFile())); |
|
499 |
|
|
500 |
} |
|
501 | 491 |
return false; |
502 | 492 |
} |
503 | 493 |
|
494 |
// /** |
|
495 |
// * Export. |
|
496 |
// * |
|
497 |
// * @param exportzip the exportzip |
|
498 |
// * @return true, if successful |
|
499 |
// */ |
|
500 |
// public boolean export(File exportzip, IProgressMonitor monitor) { |
|
501 |
// File binarydir = this.getProjectDirectory(); |
|
502 |
// if (binarydir.exists() && exportzip.getParentFile().exists()) { |
|
503 |
// try { |
|
504 |
// Zip.compress(binarydir, exportzip, monitor); |
|
505 |
// } |
|
506 |
// catch (IOException e) { |
|
507 |
// org.txm.utils.logger.Log.printStackTrace(e); |
|
508 |
// return false; |
|
509 |
// } |
|
510 |
// return true; |
|
511 |
// } |
|
512 |
// else { |
|
513 |
// System.out.println(NLS.bind(TXMCoreMessages.binaryDirectoryP0NotFound, binarydir)); |
|
514 |
// System.out.println(NLS.bind(TXMCoreMessages.parentDirectoryP0NotFound, exportzip.getParentFile())); |
|
515 |
// |
|
516 |
// } |
|
517 |
// return false; |
|
518 |
// } |
|
519 |
|
|
504 | 520 |
/** |
505 | 521 |
* Gets the import metadata. |
506 | 522 |
* |
tmp/org.txm.core/src/java/org/txm/objects/Project.java (revision 2483) | ||
---|---|---|
34 | 34 |
import java.util.ArrayList; |
35 | 35 |
import java.util.Arrays; |
36 | 36 |
import java.util.HashMap; |
37 |
import java.util.HashSet; |
|
37 | 38 |
import java.util.List; |
38 | 39 |
|
39 | 40 |
import javax.xml.parsers.ParserConfigurationException; |
... | ... | |
799 | 800 |
} |
800 | 801 |
|
801 | 802 |
public boolean export(File exportzip) { |
802 |
return export(exportzip, null); |
|
803 |
return export(exportzip, null, null);
|
|
803 | 804 |
} |
804 | 805 |
|
805 | 806 |
/** |
... | ... | |
808 | 809 |
* @param exportzip the exportzip |
809 | 810 |
* @return true, if successful |
810 | 811 |
*/ |
811 |
public boolean export(File exportzip, IProgressMonitor monitor) { |
|
812 |
public boolean export(File exportzip, IProgressMonitor monitor, HashSet<String> ignore) {
|
|
812 | 813 |
File binarydir = this.getProjectDirectory(); |
813 | 814 |
|
814 | 815 |
if (binarydir.exists() && exportzip.getParentFile().exists()) { |
815 | 816 |
this.save(); |
816 | 817 |
|
817 | 818 |
try { |
818 |
Zip.compress(binarydir, exportzip, monitor); |
|
819 |
Zip.compress(binarydir, exportzip, monitor, ignore);
|
|
819 | 820 |
} |
820 | 821 |
catch (IOException e) { |
821 | 822 |
org.txm.utils.logger.Log.printStackTrace(e); |
Formats disponibles : Unified diff