In the interest of anyone who finds this question now, in Java SE 7, you can use the java.nio.file.Files package to create links. I think this is what Michal Marchik mentioned in his commentary on the future.
public static Path createLink(Path link, Path existing) throws IOException
public static Path createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException
This page from the java docs tutorial contains these examples.
Path newLink = ...; Path target = ...; try { Files.createSymbolicLink(newLink, target); } catch (IOException x) { System.err.println(x); } catch (UnsupportedOperationException x) { // Some file systems do not support symbolic links. System.err.println(x); }
Path newLink = ...; Path existingFile = ...; try { Files.createLink(newLink, existingFile); } catch (IOException x) { System.err.println(x); } catch (UnsupportedOperationException x) {
source share