Deprecated
Starting Ant 1.10.2, this class is now deprecated in favour
of the Java java. APIs introduced in
Java 7, for dealing with symbolic links
| Modifier and Type | Field and Description |
|---|---|
| private static final FileUtils | |
| private static final SymbolicLinkUtils | PRIMARY_INSTANCE
Shared instance. |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | deleteSymbolicLink(File
A link, final Task File object of the symlink to delete.An Ant Task required if "rm" needs to be invoked. task)Delete a symlink (without deleting the associated resource). |
| public static SymbolicLinkUtils | Returns: an instance of SymbolicLinkUtils.
Deprecated
as a consequence of
Method to retrieve The SymbolicLinkUtils, which is shared by
all users of this method.
SymbolicLinkUtils being deprecated.
|
| public boolean | Returns: true if the file is a broken symbolic link.the name of the file to test. name)Checks whether a given file is a broken symbolic link. |
| public boolean | Returns: true if the file is a broken symbolic link.the file to test. file)Checks whether a given file is a broken symbolic link. |
| public boolean | Returns: true if the file is a broken symbolic link.the parent directory of the file to test parent, final String the name of the file to test. name)Checks whether a given file is a broken symbolic link. |
| public boolean | Returns: true if the file is a symbolic link.the file to test. Must not be null. file)Checks whether a given file is a symbolic link. |
| public boolean | Returns: true if the file is a symbolic link.the name of the file to test. name)Checks whether a given file is a symbolic link. |
| public boolean | Returns: true if the file is a symbolic link.the parent directory of the file to test parent, final String the name of the file to test. name)Checks whether a given file is a symbolic link. |
| FILE_UTILS | back to summary |
|---|---|
| private static final FileUtils FILE_UTILS | |
| PRIMARY_INSTANCE | back to summary |
|---|---|
| private static final SymbolicLinkUtils PRIMARY_INSTANCE
Deprecated as a consequence of Shared instance. | |
| SymbolicLinkUtils | back to summary |
|---|---|
| protected SymbolicLinkUtils() Empty constructor. | |
| deleteSymbolicLink | back to summary |
|---|---|
| public void deleteSymbolicLink(File link, final Task task) throws IOException Delete a symlink (without deleting the associated resource). This is a utility method that removes a unix symlink without removing the resource that the symlink points to. If it is accidentally invoked on a real file, the real file will not be harmed, but silently ignored. Normally this method works by getting the canonical path of the link, using the canonical path to rename the resource (breaking the link) and then deleting the link. The resource is then returned to its original name inside a finally block to ensure that the resource is unharmed even in the event of an exception. There may be cases where the algorithm described above doesn't work, in that case the method tries to use the native "rm" command on the symlink instead.
| |
| getSymbolicLinkUtils | back to summary |
|---|---|
| public static SymbolicLinkUtils getSymbolicLinkUtils()
Deprecated as a consequence of Method to retrieve The SymbolicLinkUtils, which is shared by all users of this method.
| |
| isDanglingSymbolicLink | back to summary |
|---|---|
| public boolean isDanglingSymbolicLink(final String name) throws IOException Checks whether a given file is a broken symbolic link. It doesn't really test for symbolic links but whether Java reports that the File doesn't exist but its parent's child list contains it--this may lead to false positives on some platforms. Note that #isSymbolicLink returns false if this method returns true since Java won't produce a canonical name different from the absolute one if the link is broken.
| |
| isDanglingSymbolicLink | back to summary |
|---|---|
| public boolean isDanglingSymbolicLink(final File file) throws IOException Checks whether a given file is a broken symbolic link. It doesn't really test for symbolic links but whether Java reports that the File doesn't exist but its parent's child list contains it--this may lead to false positives on some platforms. Note that #isSymbolicLink returns false if this method returns true since Java won't produce a canonical name different from the absolute one if the link is broken.
| |
| isDanglingSymbolicLink | back to summary |
|---|---|
| public boolean isDanglingSymbolicLink(final File parent, final String name) throws IOException Checks whether a given file is a broken symbolic link. It doesn't really test for symbolic links but whether Java reports that the File doesn't exist but its parent's child list contains it--this may lead to false positives on some platforms. Note that #isSymbolicLink returns false if this method returns true since Java won't produce a canonical name different from the absolute one if the link is broken.
| |
| isSymbolicLink | back to summary |
|---|---|
| public boolean isSymbolicLink(final File file) throws IOException Checks whether a given file is a symbolic link. It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are identical--this may lead to false positives on some platforms.
| |
| isSymbolicLink | back to summary |
|---|---|
| public boolean isSymbolicLink(final String name) throws IOException Checks whether a given file is a symbolic link. It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are identical--this may lead to false positives on some platforms.
| |
| isSymbolicLink | back to summary |
|---|---|
| public boolean isSymbolicLink(final File parent, final String name) throws IOException Checks whether a given file is a symbolic link. It doesn't really test for symbolic links but whether the canonical and absolute paths of the file are identical--this may lead to false positives on some platforms.
| |