summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/io/Path.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/scala/tools/nsc/io/Path.scala')
-rw-r--r--src/compiler/scala/tools/nsc/io/Path.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/nsc/io/Path.scala b/src/compiler/scala/tools/nsc/io/Path.scala
index 39fba8bcb2..2b7f2620d6 100644
--- a/src/compiler/scala/tools/nsc/io/Path.scala
+++ b/src/compiler/scala/tools/nsc/io/Path.scala
@@ -141,6 +141,8 @@ class Path private[io] (val jfile: JFile)
}
// compares against extension in a CASE INSENSITIVE way.
def hasExtension(other: String) = extension.toLowerCase == other.toLowerCase
+ // returns the filename without the extension.
+ def stripExtension: String = name stripSuffix ("." + extension)
// conditionally execute
def ifFile[T](f: File => T): Option[T] = if (isFile) Some(f(toFile)) else None