[Castore-commits] ConverterThread.java 1.4.2.5 1.4.2.6

Stéphane Bouchet sbouchet at adullact1.hosting.cri74.org
Lun 6 Mar 12:12:33 CET 2006


Update of /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/retro
In directory adullact1:/tmp/cvs-serv11743/src/java/fr/emn/castor/documents/retro

Modified Files:
      Tag: v1_1_branch
	ConverterThread.java 
Log Message:
correction bug empechant la suppression des residus de la retro

Index: ConverterThread.java
===================================================================
RCS file: /cvsroot/castore/castore-core/src/java/fr/emn/castor/documents/retro/ConverterThread.java,v
retrieving revision 1.4.2.5
retrieving revision 1.4.2.6
diff -C2 -d -r1.4.2.5 -r1.4.2.6
*** ConverterThread.java	20 Jan 2006 10:41:06 -0000	1.4.2.5
--- ConverterThread.java	6 Mar 2006 11:12:31 -0000	1.4.2.6
***************
*** 43,46 ****
--- 43,47 ----
  import java.io.FileNotFoundException;
  import java.io.FileOutputStream;
+ import java.io.IOException;
  import java.io.PrintStream;
  
***************
*** 102,106 ****
       */
      public void run() {
- 
          // on lance la tache ant de conversion
          // 5 parametres
--- 103,106 ----
***************
*** 131,135 ****
                  .getPathForId(this.id));
              project.setUserProperty("ant.version", Main.getAntVersion());
- 
              project.init();
              ProjectHelperImpl helper = new ProjectHelperImpl();
--- 131,134 ----
***************
*** 142,154 ****
                  logger.setMessageOutputLevel(Project.MSG_INFO);
              }
!             logger.setOutputPrintStream(new PrintStream(
!                 new FileOutputStream(this.fonds.getPathForId(this.id)
!                         + Constants.FILE_SEPARATOR + "out.log")));
!             logger.setErrorPrintStream(new PrintStream(new FileOutputStream(
                  this.fonds.getPathForId(this.id) + Constants.FILE_SEPARATOR
!                         + "err.log")));
              project.addBuildListener(logger);
              project.fireBuildStarted();
              project.executeTarget(project.getDefaultTarget());
          } catch (BuildException be) {
              if (log.isFatalEnabled()) {
--- 141,162 ----
                  logger.setMessageOutputLevel(Project.MSG_INFO);
              }
!             FileOutputStream fOutOutputStream = new FileOutputStream(
                  this.fonds.getPathForId(this.id) + Constants.FILE_SEPARATOR
!                         + "out.log");
!             PrintStream outStream = new PrintStream(fOutOutputStream);
!             logger.setOutputPrintStream(outStream);
!             FileOutputStream fErrOutputStream = new FileOutputStream(
!                 this.fonds.getPathForId(this.id) + Constants.FILE_SEPARATOR
!                         + "err.log");
!             PrintStream errStream = new PrintStream(fErrOutputStream);
!             logger.setErrorPrintStream(errStream);
              project.addBuildListener(logger);
              project.fireBuildStarted();
              project.executeTarget(project.getDefaultTarget());
+             project.fireBuildFinished(null);
+             errStream.close();
+             outStream.close();
+             fErrOutputStream.close();
+             fOutOutputStream.close();
          } catch (BuildException be) {
              if (log.isFatalEnabled()) {
***************
*** 169,172 ****
--- 177,190 ----
                  this.id, DocumentsConstants.CONVERTION_ERROR);
              return;
+ 
+         } catch (IOException ioe) {
+             if (log.isFatalEnabled()) {
+                 log.fatal(
+                     "Une erreur est survenue lors de la retro-conversion : "
+                             + ioe.getMessage(), ioe);
+             }
+             this.fonds.setRetroStatut(
+                 this.id, DocumentsConstants.CONVERTION_ERROR);
+             return;
          }
          if (log.isDebugEnabled()) {
***************
*** 181,185 ****
              // on supprime le résultat de la convertion
              Converter converter = Converter.getInstance();
!             converter.cleanConv(this.id, false);
          }
      }
--- 199,209 ----
              // on supprime le résultat de la convertion
              Converter converter = Converter.getInstance();
!             boolean okClean = converter.cleanConv(this.id, false);
!             if (!okClean) {
!                 if (log.isErrorEnabled()) {
!                     log
!                         .error("Le nettoyage ne s'est pas correctement terminé.");
!                 }
!             }
          }
      }




Plus d'informations sur la liste de diffusion Castore-commits