我正在使用 NIO.2 开发一个 java 项目,并且遇到了 Files.createLink 方法。在对 Java 教程进行一些研究后,我发现这些看起来与 Windows 快捷方式类似,但我不确定它们是否就是这样。如果不是,我如何创建一种独立于平台的方式来创建快捷方式?
最佳答案
创建符号链接(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:
来源: http://docs.oracle.com/javase/tutorial/essential/io/links.html
关于java - 到底什么是链接(符号或其他),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15646691/