/**
* @author David Roden <droden@gmail.com>
- * @version $Id: ProjectInserter.java 440 2006-03-30 09:31:25Z bombe $
+ * @version $Id: ProjectInserter.java 486 2006-04-27 10:58:34Z bombe $
*/
public class ProjectInserter implements FileScannerListener, Runnable {
outputStream.addReplacement("$[EDITION]", String.valueOf(edition));
outputStream.addReplacement("$[URI]", project.getFinalURI(0));
for (int index = 1; index <= fileOption.getEditionRange(); index++) {
- outputStream.addReplacement("$[URI+" + index + "]", project.getFinalURI(index));
outputStream.addReplacement("$[URI+" + index + "]", project.getFinalURI(index));
+ outputStream.addReplacement("$[EDITION+" + index + "]", String.valueOf(edition + index));
}
StreamCopier.copy(fileInput, outputStream, length[0]);
outputStream.close();
/* create connection to node */
Connection connection = freenetInterface.getConnection("project-insert-" + counter++);
+ boolean connected = false;
+ Throwable cause = null;
try {
- connection.connect();
+ connected = connection.connect();
} catch (IOException e1) {
- fireProjectInsertFinished(false, e1);
+ cause = e1;
+ }
+
+ if (!connected) {
+ fireProjectInsertFinished(false, cause);
return;
}
+
Client client = new Client(connection);
/* create containers */