aboutsummaryrefslogtreecommitdiff
path: root/stage1/cbt.scala
diff options
context:
space:
mode:
authorChristopher Vogt <oss.nsp@cvogt.org>2017-03-01 00:39:04 +0000
committerChristopher Vogt <oss.nsp@cvogt.org>2017-03-01 00:39:04 +0000
commite8b0d49a9cf8eeb95e2e41555d12f43724e417f1 (patch)
tree0cacacfe83c6b3c270b64e21dd4bce50688d3489 /stage1/cbt.scala
parent7ddfd1a4336d53a1ae59582b9f4aa130cfd44fcb (diff)
downloadcbt-e8b0d49a9cf8eeb95e2e41555d12f43724e417f1.tar.gz
cbt-e8b0d49a9cf8eeb95e2e41555d12f43724e417f1.tar.bz2
cbt-e8b0d49a9cf8eeb95e2e41555d12f43724e417f1.zip
add / helper also for Path anticipating migration to nio
Diffstat (limited to 'stage1/cbt.scala')
-rw-r--r--stage1/cbt.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/stage1/cbt.scala b/stage1/cbt.scala
index 44506d2..ea3237d 100644
--- a/stage1/cbt.scala
+++ b/stage1/cbt.scala
@@ -18,6 +18,16 @@ object `package`{
val sonatypeSnapshots = sonatypeBase ++ "snapshots"
private val lib = new BaseLib
+
+ implicit class PathExtensionMethods( path: Path ){
+ def /(s: String): Path = path.resolve(s)
+ def ++( s: String ): Path = {
+ if(s endsWith "/") throw new Exception(
+ """Trying to append a String that ends in "/" to a Path would loose the trailing "/". Use .stripSuffix("/") if you need to."""
+ )
+ Paths.get( path.toString ++ s )
+ }
+ }
implicit class FileExtensionMethods( file: File ){
def ++( s: String ): File = {
if(s endsWith "/") throw new Exception(