Java File System getPath(FileSystem targetFS, String fileName)

Here you can find the source of getPath(FileSystem targetFS, String fileName)

Description

get Path

License

Open Source License

Declaration

public static Path getPath(FileSystem targetFS, String fileName) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.nio.file.FileSystem;

import java.nio.file.Path;

import java.util.Arrays;

public class Main {
    public static Path getPath(FileSystem targetFS, String fileName) {
        String[] nameComps = fileName.replace('\\', '/').split("/");
        if (nameComps.length == 1) {
            return targetFS.getPath(nameComps[0]);
        } else {//from w  ww.j a  va2s. c o  m
            return targetFS.getPath(nameComps[0],
                    Arrays.copyOfRange(nameComps, 1, nameComps.length));
        }

    }
}

Related

  1. findFile(FileSystem fileSystem, String path, String optionalFileSuffix)
  2. getFileSystem(Path file)
  3. getFileSystem(Path path)
  4. isFileSystemAvailable(final Path file, final String topLevelAbsolutePath)
  5. isFileSystemAvailable2(final Path file, final String topLevelAbsolutePath)
  6. loadSystemResourceKeyValueCsvFileToMap(String resourcePath)
  7. newJarFileSystem(Path jarFilePath)