WindowsJunctionUtils (Apache Ant API)
Description: declaration: package: org.apache.tools.ant.util, class: WindowsJunctionUtils

# Class WindowsJunctionUtils

java.lang.Object
org.apache.tools.ant.util.WindowsJunctionUtils

public class WindowsJunctionUtils extends Object
Contains methods related to Windows NTFS junctions.

Since:
  Ant 1.10.16

- ## Constructor Summary

  Constructors
  Modifier
  Constructor
  Description
  `protected`
  `WindowsJunctionUtils()`
  Empty constructor.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static WindowsJunctionUtils`
  `getWindowsJunctionUtils()`
  Method to retrieve The WindowsJunctionUtils, which is shared by all users of this method.
  `boolean`
  `isJunction(File file)`
  Checks whether a given file is a windows junction.
  `boolean`
  `isJunction(Path path)`
  Checks whether a given path is a windows junction.
  `boolean`
  `isJunctionSafe(File file)`
  Checks whether a given file is a windows junction.
  `boolean`
  `isJunctionSafe(Path path)`
  Checks whether a given path is a windows junction.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WindowsJunctionUtils

    protected WindowsJunctionUtils()
    Empty constructor.

- ## Method Details

  - ### getWindowsJunctionUtils

    public static WindowsJunctionUtils getWindowsJunctionUtils()
    Method to retrieve The WindowsJunctionUtils, which is shared by all users of this method.
    Returns:
      an instance of WindowsJunctionUtils.

  - ### isJunction

    public boolean isJunction(File file) throws IOException
    Checks whether a given file is a windows junction.
    Returns:
      true if the file is a windows junction.
    Throws:
      `IOException` - on error.

  - ### isJunctionSafe

    public boolean isJunctionSafe(File file)
    Checks whether a given file is a windows junction.
    Returns:
      false if the given file is not a windows junction or an exception occured while trying to check the file - most likely because the file didn't exists.

  - ### isJunctionSafe

    public boolean isJunctionSafe(Path path)
    Checks whether a given path is a windows junction.
    Returns:
      false if the given path is not a junction or an exception occured while trying to check the path - most likely because the path didn't exists.

  - ### isJunction

    public boolean isJunction(Path path) throws IOException
    Checks whether a given path is a windows junction.
    Returns:
      true if the path is a windows junction.
    Throws:
      `IOException` - on error.