Java Path File Name nio getPath(File dir, String filename)

Here you can find the source of getPath(File dir, String filename)

Description

get Path

License

Apache License

Parameter

Parameter Description
contentDir a parameter
filename a parameter

Declaration

public static Path getPath(File dir, String filename) 

Method Source Code


//package com.java2s;
/*//from w  ww  . ja v  a2 s . c o  m
 * The contents of this file are subject to the license and copyright
 * detailed in the LICENSE and NOTICE files at the root of the source
 * tree and available online at
 *
 *     http://duracloud.org/license/
 */

import java.io.File;
import java.nio.file.FileSystems;
import java.nio.file.Path;

public class Main {
    /**
     * @param contentDir
     * @param filename
     * @return
     */
    public static Path getPath(File dir, String filename) {
        Path path = FileSystems.getDefault().getPath(dir.getAbsolutePath(), filename);
        return path;
    }
}

Related

  1. getNameWithoutSuffix(Path path)
  2. getNormalizedFileName(Path file)
  3. getPackageURI(String pkgName, String pkgPath, String currentPkgName)
  4. getPath(Class example, String filename)
  5. getPath(Class baseClass, String resourceName)
  6. getPath(final String fullFileName)
  7. getPath(Object name)
  8. getPath(String dirName, String fileName)
  9. getPathByClassName(Class clazz, String relativeDir)