diff options
author | michelou <michelou@epfl.ch> | 2010-12-02 10:58:02 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2010-12-02 10:58:02 +0000 |
commit | 2b689f169e9c2112dd243cac186038eeb952eead (patch) | |
tree | 5beeee5c64249115b873f0164efdbbdff23589a1 | |
parent | b2bade0259f2c6e7276dcb8b675131ea7d809906 (diff) | |
download | scala-2b689f169e9c2112dd243cac186038eeb952eead.tar.gz scala-2b689f169e9c2112dd243cac186038eeb952eead.tar.bz2 scala-2b689f169e9c2112dd243cac186038eeb952eead.zip |
minor update (detach examples)
-rw-r--r-- | test/files/detach-run/actor/actor.scala | 8 | ||||
-rw-r--r-- | test/files/detach-run/basic/Server.scala | 3 | ||||
-rw-r--r-- | test/files/detach-run/basic/basic.scala | 8 |
3 files changed, 12 insertions, 7 deletions
diff --git a/test/files/detach-run/actor/actor.scala b/test/files/detach-run/actor/actor.scala index 958b209594..f3ed4c2d26 100644 --- a/test/files/detach-run/actor/actor.scala +++ b/test/files/detach-run/actor/actor.scala @@ -99,17 +99,19 @@ object Env { def generateJarFile(classNames: List[String]) { val out = new JarOutputStream(new FileOutputStream(deployJar)) - classNames foreach (name => { + classNames foreach (name => try { val classFile = name+".class" - out putNextEntry new JarEntry(classFile) val in = new FileInputStream(outPath+sep+classFile) - val buf = new Array[Byte](256) + out putNextEntry new JarEntry(classFile) + val buf = new Array[Byte](512) var len = in read buf while (len != -1) { out.write(buf, 0, len) len = in read buf } in.close() + } catch { + case e: FileNotFoundException => println(e) }) out.close() } diff --git a/test/files/detach-run/basic/Server.scala b/test/files/detach-run/basic/Server.scala index 601eea3c58..02150b36ff 100644 --- a/test/files/detach-run/basic/Server.scala +++ b/test/files/detach-run/basic/Server.scala @@ -14,4 +14,5 @@ object Server extends ServerConsole { client ! result } server.close() - }
} + } +} diff --git a/test/files/detach-run/basic/basic.scala b/test/files/detach-run/basic/basic.scala index 1bfb838b21..03e56a74a1 100644 --- a/test/files/detach-run/basic/basic.scala +++ b/test/files/detach-run/basic/basic.scala @@ -112,17 +112,19 @@ object Env { def generateJarFile(classNames: List[String]) { val out = new JarOutputStream(new FileOutputStream(deployJar)) - classNames foreach (name => { + classNames foreach (name => try { val classFile = name+".class" - out putNextEntry new JarEntry(classFile) val in = new FileInputStream(outPath+sep+classFile) - val buf = new Array[Byte](256) + out putNextEntry new JarEntry(classFile) + val buf = new Array[Byte](512) var len = in read buf while (len != -1) { out.write(buf, 0, len) len = in read buf } in.close() + } catch { + case e: FileNotFoundException => println(e) }) out.close() } |