Java Path File Check nio isSame(Path expected, Path actual)

Here you can find the source of isSame(Path expected, Path actual)

Description

Tests if two paths locate the same file.

License

Open Source License

Parameter

Parameter Description
expected expected path.
actual actual path.

Exception

Parameter Description
IOException if something goes wrong.

Return

true if, and only if, the two paths locate the same file

Declaration

public static boolean isSame(Path expected, Path actual) throws IOException 

Method Source Code


//package com.java2s;
import java.io.IOException;

import java.nio.file.*;

public class Main {
    /**//from  w  w w  .j  av a2s .  com
     * Tests if two paths locate the same file.
     *
     * @param expected expected path.
     * @param actual   actual path.
     * @return true if, and only if, the two paths locate the same file
     * @throws IOException if something goes wrong.
     */
    public static boolean isSame(Path expected, Path actual) throws IOException {
        return Files.isSameFile(expected, actual);
    }
}

Related

  1. isParentOf(Path possibleParent, Path possibleChild)
  2. isPath(Class clazz)
  3. isPermission(Path p, Function function)
  4. isPictureFile(Path file)
  5. isRegularUsable(final Path pathToFile, final LinkOption... linkOption)
  6. isSameFile(Path path1, Path path2)
  7. isSteadyStateReached(Path integrationStepFile, double minStepAtEndOfStabilization)
  8. isUNC(Path inputPath)
  9. isUnix(Path path)