Reputation: 10815
I was working on a java project with NIO.2 and I encountered the Files.createLink method. Upon doing some research on The Java Tutorials I found that these seem similar to windows shortcuts, but I'm not exactly sure if that's what they are. If they aren't how could I create a platform independent way to create a shortcut?
Upvotes: 0
Views: 94
Reputation: 12725
Creating a Symbolic Link
If your file system supports it, you can create a symbolic link by using the createSymbolicLink(Path, Path, FileAttribute) method. The second Path argument represents the target file or directory and might or might not exist. The following code snippet creates a symbolic link with default permissions:
SOURCE: http://docs.oracle.com/javase/tutorial/essential/io/links.html
Upvotes: 2