diff options
author | Paul Phillips <paulp@improving.org> | 2010-03-26 04:26:03 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-03-26 04:26:03 +0000 |
commit | 2bf117c3b2545856ace3d2dd23e5fffad199bac9 (patch) | |
tree | a72d6ec99bd04abb89d89a1d49cfad036d5e7ae8 /src/compiler/scala/tools/nsc/util/ClassPath.scala | |
parent | f427b1e67d63dfe49d8b0dd25265c721ce5851cc (diff) | |
download | scala-2bf117c3b2545856ace3d2dd23e5fffad199bac9.tar.gz scala-2bf117c3b2545856ace3d2dd23e5fffad199bac9.tar.bz2 scala-2bf117c3b2545856ace3d2dd23e5fffad199bac9.zip |
Some minor I/O changes. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/util/ClassPath.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/util/ClassPath.scala | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/util/ClassPath.scala b/src/compiler/scala/tools/nsc/util/ClassPath.scala index 9ec9bf584f..f54fb4d0a2 100644 --- a/src/compiler/scala/tools/nsc/util/ClassPath.scala +++ b/src/compiler/scala/tools/nsc/util/ClassPath.scala @@ -71,7 +71,7 @@ object ClassPath { def split(path: String): List[String] = (path split pathSeparator).toList filterNot (_ == "") distinct /** Join classpath using platform-dependent path separator */ - def join(path: String*): String = path filterNot (_ == "") mkString pathSeparator + def join(paths: String*): String = paths filterNot (_ == "") mkString pathSeparator /** Split the classpath, apply a transformation function, and reassemble it. */ def map(cp: String, f: String => String): String = join(split(cp) map f: _*) @@ -82,6 +82,9 @@ object ClassPath { /** Split the classpath and map them into Paths */ def toPaths(cp: String): List[Path] = split(cp) map (x => Path(x).toAbsolute) + /** Join the paths as a classpath */ + def fromPaths(paths: Path*): String = join(paths map (_.path): _*) + /** Split the classpath and map them into URLs */ def toURLs(cp: String): List[URL] = toPaths(cp) map (_.toURL) |