Skip to content

Instantly share code, notes, and snippets.

View jarikujansuu's full-sized avatar

Jari Kujansuu jarikujansuu

  • Helsinki, Finland
View GitHub Profile
@ElectricCoffee
ElectricCoffee / RichPath.scala
Last active August 29, 2015 14:03
A simple bit of extension methods that lets you write "someFolder" / "otherFolder" / "LastFolder" to create a java.io.File with that kind of path. An important feature of this, is that it's completely OS agnostic, meaning you don't have to worry about it being \ in Windows and / in Unix-based OSs, you just write it, and it handles the rest from …
import java.io.File
/**
* A completely OS-Agnostic way of dealing with java.io.File paths
*/
object RichPath {
sealed class RichBase[+A](left: A) {
/**
* Simple enrichment method designed to let you create a java.io.File
* by simply writing "folderA" / "folderB" / "folderC"