Я хочу создать символическую ссылку в RHEL 5 с помощью Java. В java6 createSymbolicLink имеет только два параметра. Но в случае Java7 FileAttribute был включен вместе с параметрами, т.е. всего три параметра.
public static Path createSymbolicLink(Path link, Path target, FileAttribute... attrs) throws IOException Creates a symbolic link to a target (optional operation). The target parameter is the target of the link. It may be an absolute or relative path and may not exist. When the target is a relative path then file system operations on the resulting link are relative to the path of the link. The attrs parameter is optional attributes to set atomically when creating the link. Each attribute is identified by its name. If more than one attribute of the same name is included in the array then all but the last occurrence is ignored. Where symbolic links are supported, but the underlying FileStore does not support symbolic links, then this may fail with an IOException. Additionally, some operating systems may require that the Java virtual machine be started with implementation specific privileges to create symbolic links, in which case this method may throw IOException. Parameters: link - the path of the symbolic link to create target - the target of the symbolic link attrs - the array of attributes to set atomically when creating the symbolic link
Я не мог понять, что я должен дать там в качестве третьего параметра. Все, что мне нужно сделать, это создать символическую ссылку.
Проблема в том, что я не знаю, что я должен указать в третьем параметре, а также я не очень разбираюсь в интерфейсе FileAttribute
. Пожалуйста помоги.
Для Downvoters, пожалуйста, прокомментируйте причину для downvoting.