Created
October 2, 2014 10:04
-
-
Save amr/cc51a04d3511d272db36 to your computer and use it in GitHub Desktop.
Create temporary directory with the JVM (Scala here)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def createTempDir(tmpName: String): String = { | |
val tmpDir = Paths.get(System.getProperty("java.io.tmpdir")) | |
val name: Path = tmpDir.getFileSystem.getPath(tmpName) | |
if (name.getParent != null) throw new IllegalArgumentException("Invalid prefix or suffix") | |
tmpDir.resolve(name).toString | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment