Here you can find the source of isFileSystemAvailable2(final Path file, final String topLevelAbsolutePath)
private static boolean isFileSystemAvailable2(final Path file, final String topLevelAbsolutePath)
//package com.java2s; import java.nio.file.Files; import java.nio.file.Path; public class Main { private static boolean isFileSystemAvailable2(final Path file, final String topLevelAbsolutePath) { boolean available; if (Files.exists(file)) { available = true;// ww w. ja v a 2 s . co m } else { if (isEqualPath(file, topLevelAbsolutePath)) { available = false; } else { available = isFileSystemAvailable2(file.getParent(), topLevelAbsolutePath); } } return available; } private static boolean isEqualPath(final Path file1, final String topLevelAbsolutePath) { return topLevelAbsolutePath.equals(file1.toAbsolutePath() .toString()); } }