/** * @param target * If relative, resolved against the location of the symlink. * If absolute, it's absolute. * @throws UnsatisfiedLinkError * If the function is not exported by kernel32. * See http://msdn.microsoft.com/en-us/library/windows/desktop/aa363866(v=vs.85).aspx * for compatibility info. * @deprecated Use {@link Util#createSymlink} instead. */ @Deprecated public static void createSymbolicLink(File symlink, String target, boolean dirLink) throws IOException { if (!Kernel32.INSTANCE.CreateSymbolicLinkW( new WString(symlink.getPath()), new WString(target), dirLink?Kernel32.SYMBOLIC_LINK_FLAG_DIRECTORY:0)) { throw new WinIOException("Failed to create a symlink "+symlink+" to "+target); } }
/** * @param target * If relative, resolved against the location of the symlink. * If absolute, it's absolute. * @throws UnsatisfiedLinkError * If the function is not exported by kernel32. * See http://msdn.microsoft.com/en-us/library/windows/desktop/aa363866(v=vs.85).aspx * for compatibility info. */ public static void createSymbolicLink(File symlink, String target, boolean dirLink) throws IOException { if (!Kernel32.INSTANCE.CreateSymbolicLinkW( new WString(symlink.getPath()), new WString(target), dirLink?Kernel32.SYMBOLIC_LINK_FLAG_DIRECTORY:0)) { throw new WinIOException("Failed to create a symlink "+symlink+" to "+target); } }