Changeset 7372 for lang/scala/sandbox
- Timestamp:
- 03/02/08 15:06:12 (9 months ago)
- Location:
- lang/scala/sandbox
- Files:
-
- 5 modified
-
build.xml (modified) (2 diffs)
-
lib/scala-sandbox.jar (modified) (previous)
-
src/jp/ne/cappuccino/keisuken/scl/io/FileUtils.scala (modified) (3 diffs)
-
src/jp/ne/cappuccino/keisuken/scl/lang/ProcessBuilder.scala (modified) (2 diffs)
-
webpages/lib/scala-sandbox.jar (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
lang/scala/sandbox/build.xml
r7160 r7372 30 30 =================================================================--> 31 31 32 <taskdef resource="scala/tools/ant/antlib.xml" 33 classpath="${scala-task-classpath}"/> 34 <!-- 32 35 <taskdef name="scalac" 33 36 classname="scala.tools.ant.Scalac" classpath="${scala-task-classpath}"/> … … 36 39 <taskdef name="scaladoc" 37 40 classname="scala.tools.ant.Scaladoc" classpath="${scala-task-classpath}"/> 41 --> 38 42 39 43 <!--================================================================ -
lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/io/FileUtils.scala
r7160 r7372 7 7 @throws(classOf[IOException]) 8 8 def copy(src: File, dst: File) { 9 if(src.isFile ()) {9 if(src.isFile) { 10 10 copyFile(src, dst) 11 } else if(src.isDirectory ()) {11 } else if(src.isDirectory) { 12 12 for(file <- src.listFiles()) { 13 copy(file, new File(dst, src.getName ()))13 copy(file, new File(dst, src.getName)) 14 14 } 15 15 } … … 22 22 23 23 @throws(classOf[IOException]) 24 def delete(path: File) { 25 if(path.exists) { 26 if(path.isFile) { 27 path.delete 28 } else if(path.isDirectory) { 29 for(file <- path.listFiles) { 30 delete(file) 31 } 32 path.delete 33 } 34 } 35 } 36 37 @throws(classOf[IOException]) 38 def delete(path: String) { 39 delete(new File(path)) 40 } 41 42 @throws(classOf[IOException]) 24 43 private def copyFile(srcFile: File, dstDir: File) { 25 44 var exp: IOException = null 26 if( dstDir.exists() == false) {45 if(!dstDir.exists) { 27 46 dstDir.mkdirs 28 47 } … … 61 80 */ 62 81 copy("src", "..") 82 delete("../src/jp/ne") 63 83 } 64 84 } -
lang/scala/sandbox/src/jp/ne/cappuccino/keisuken/scl/lang/ProcessBuilder.scala
r7160 r7372 8 8 */ 9 9 object ProcessBuilder { 10 11 final val STDIN = new NoCloseInputStream(System.in) 12 final val STDOUT = new NoCloseOutputStream(System.out) 13 final val STDERR = new NoCloseOutputStream(System.err) 14 15 class NoCloseInputStream(in: InputStream) 16 extends FilterInputStream(in) { 17 @throws(classOf[IOException]) 18 override def close() {} 19 } 20 class NoCloseOutputStream(out: OutputStream) 21 extends FilterOutputStream(out) { 22 @throws(classOf[IOException]) 23 override def close() {out.flush} 24 } 10 25 11 26 class ProcessStream(in: InputStream, out: OutputStream) { … … 121 136 @throws(classOf[IOException]) 122 137 def exec(command: Array[String]): Process = 123 createProcess(command, null, null, S ystem.in, System.out, System.err)138 createProcess(command, null, null, STDIN, STDOUT, STDERR) 124 139 125 140 @throws(classOf[IOException]) 126 141 def exec(command: Array[String], env: Array[String]): Process = 127 createProcess(command, env, null, S ystem.in, System.out, System.err)142 createProcess(command, env, null, STDIN, STDOUT, STDERR) 128 143 129 144 @throws(classOf[IOException]) 130 145 def exec(command: Array[String], dir: File): Process = 131 createProcess(command, null, dir, S ystem.in, System.out, System.err)146 createProcess(command, null, dir, STDIN, STDOUT, STDERR) 132 147 133 148 @throws(classOf[IOException])
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)