https://github.com/atry/scala-junction
Create NTFS junction point from Scala or Java.
https://github.com/atry/scala-junction
Last synced: 11 months ago
JSON representation
Create NTFS junction point from Scala or Java.
- Host: GitHub
- URL: https://github.com/atry/scala-junction
- Owner: Atry
- License: apache-2.0
- Created: 2012-01-15T17:21:48.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2014-07-08T01:40:06.000Z (almost 12 years ago)
- Last Synced: 2025-03-14T03:11:42.184Z (over 1 year ago)
- Language: Scala
- Homepage:
- Size: 551 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
`scala-junction` is an utility that creates [NTFS junction points](https://en.wikipedia.org/wiki/NTFS_junction_point) on Windows for Scala or Java.
# How to use it?
If you use sbt, add following lines to you `build.sbt`:
libraryDependencies += "com.dongxiguo" %% "scala-junction" % "0.1.0"
The [API](http://atry.github.com/scala-junction/api/index.html) of `scala-junction` is quite simple. There are only three public static functions:
com.dongxiguo.junction.Junction.createJunction(new java.io.File("my-link"), new java.io.File("D:\\target"));
// Or if you are using Java 7:
com.dongxiguo.junction.java7.Junction.createJunction(java.nio.file.Paths.get("my-link"), java.nio.file.Paths.get("D:\\target"));
// Create junction only if failed to create a symblic link:
com.dongxiguo.junction.java7.Junction.createSymbolicLinkOrJunction(java.nio.file.Paths.get("my-link"), java.nio.file.Paths.get("D:\\target"));
# What's the difference between symblic links and junctions?
Java 7 supports symblic links, but symblic links can only be created on POSIX, or by elevated user on Windows Vista/7/2008. On the other hand, `scala-junction` is tested working on Windows XP and Windows 7 (for both elevated user and non-elevated user). I guess `scala-junction` works on any version of Windows NT.