Java Path File Check nio isFolder(Path path)

Here you can find the source of isFolder(Path path)

Description

Tests whether a file is a directory.

License

Open Source License

Parameter

Parameter Description
path the path to the file to test.

Return

true if the file is a directory; false if the file does not exist, is not a directory, or it cannot be determined if the file is a directory or not.

Declaration

public static boolean isFolder(Path path) 

Method Source Code

//package com.java2s;

import java.nio.file.*;

public class Main {
    /**//from w  w  w .j  a v  a  2  s .  c  o  m
     * Tests whether a file is a directory.
     *
     * @param path the path to the file to test.
     * @return true if the file is a directory; false if the file does not
     * exist, is not a directory, or it cannot be determined if the file
     * is a directory or not.
     */
    public static boolean isFolder(Path path) {
        return Files.isDirectory(path);
    }
}

Related

  1. isFile(final String path)
  2. isFile(Path file)
  3. isFileHidden(Path file)
  4. isFileSymLink(File path)
  5. isFileWritable(final Path file)
  6. isHidden(final Path path)
  7. isHidden(Path path)
  8. isHidden(Path path)
  9. isHidden(Path value)