|
From: <fa...@us...> - 2010-03-31 11:11:31
|
Revision: 5736
http://fudaa.svn.sourceforge.net/fudaa/?rev=5736&view=rev
Author: fargeix
Date: 2010-03-31 11:11:24 +0000 (Wed, 31 Mar 2010)
Log Message:
-----------
Bug REFONDE-1 : D?\195?\169finition d'un dossier temporaire d'ex?\195?\169cution des calculs
Modified Paths:
--------------
trunk/business/dodico-corba/pom.xml
trunk/business/dodico-corba/src/main/java/org/fudaa/dodico/calcul/DCalcul.java
Modified: trunk/business/dodico-corba/pom.xml
===================================================================
--- trunk/business/dodico-corba/pom.xml 2010-03-30 21:27:25 UTC (rev 5735)
+++ trunk/business/dodico-corba/pom.xml 2010-03-31 11:11:24 UTC (rev 5736)
@@ -12,7 +12,7 @@
</parent>
<groupId>org.fudaa.business</groupId>
<artifactId>dodico-corba</artifactId>
- <version>1.0</version>
+ <version>1.02</version>
<name>dodico-corba</name>
<!-- on importe les dépendences du framework -->
<dependencyManagement>
Modified: trunk/business/dodico-corba/src/main/java/org/fudaa/dodico/calcul/DCalcul.java
===================================================================
--- trunk/business/dodico-corba/src/main/java/org/fudaa/dodico/calcul/DCalcul.java 2010-03-30 21:27:25 UTC (rev 5735)
+++ trunk/business/dodico-corba/src/main/java/org/fudaa/dodico/calcul/DCalcul.java 2010-03-31 11:11:24 UTC (rev 5736)
@@ -246,6 +246,26 @@
}
return path;
}
+
+ /**
+ * Construire le chemin d'acces au dossier temporaire des serveurs. En premier, la variable d'environnement <code>"FUDAA_TMPDIR"</code>
+ * est utilisee. Si elle n'existe pas, le chemin relatif <code>"dossier_tmp_de_l_os/"+getNomApp()</code> est utilise.
+ *
+ * @return le chemin d'acces au dossier temporaire du serveur (codes de calcul)
+ * @see #getNomApp()
+ */
+ protected final String cheminTmp() {
+ String path = System.getProperty("FUDAA_TMPDIR");
+ if ((path == null) || path.equals("")) {
+ path = System.getProperty("java.io.tmpdir") + File.separator + "fudaa_srv"
+ + File.separator + getNomFichierApp();
+ new File(path).mkdirs();
+ }
+ if (!path.endsWith(File.separator)) {
+ path += File.separator;
+ }
+ return path;
+ }
/**
* Efface tous les fichiers utilises par la connexion <code>_c</code>.
@@ -259,7 +279,7 @@
/**
* Renvoie tous les fichiers utilises par la connexion <code>_c</code>. La localisation des fichiers est specifiee
- * par la fonction <code>cheminServeur()</code>.<br>
+ * par la fonction <code>cheminServeur()</code> ou la fonction <code>cheminTmp()</code>.<br>
* Les noms des fichiers sont construits a partir de la concatenation du nom de l'application <code>getNomApp()</code>
* et du numero de la connexion <code>_c</code>. Le numero est eventuellement complete pour satisfaire au format
* (nombre minimum de chiffres) precise lors de l'affectation
@@ -275,15 +295,20 @@
return new File[0];
}
final String path = cheminServeur();
+ final String tmpdir = cheminTmp();
+ final boolean tmpdirExists = new File(tmpdir).exists();
String noEtude = "" + _c.numero();
final int t = noEtude.length();
for (int i = t; i < formatExt_; i++) {
noEtude = "0" + noEtude;
}
final String nomEtude = getNomFichierApp() + noEtude;
- final File[] fics = new File[extensions_.length];
+
+ final int nbFics = tmpdirExists ? 2*extensions_.length : extensions_.length;
+ final File[] fics = new File[nbFics];
for (int i = 0; i < extensions_.length; i++) {
fics[i] = new File(path + nomEtude + extensions_[i]);
+ if (tmpdirExists) fics[i + extensions_.length] = new File(tmpdir + nomEtude + extensions_[i]);
}
return fics;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|