Java File System isFileSystemAvailable2(final Path file, final String topLevelAbsolutePath)

Here you can find the source of isFileSystemAvailable2(final Path file, final String topLevelAbsolutePath)

Description

is File System Available

License

Open Source License

Declaration

private static boolean isFileSystemAvailable2(final Path file,
            final String topLevelAbsolutePath) 

Method Source Code

//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());
    }
}

Related

  1. findFile(FileSystem fileSystem, String path, String optionalFileSuffix)
  2. getFileSystem(Path file)
  3. getFileSystem(Path path)
  4. getPath(FileSystem targetFS, String fileName)
  5. isFileSystemAvailable(final Path file, final String topLevelAbsolutePath)
  6. loadSystemResourceKeyValueCsvFileToMap(String resourcePath)
  7. newJarFileSystem(Path jarFilePath)
  8. newOutputStream(FileSystem system, Path path)
  9. systemEnvironmentPaths()