Java Path File Name nio getPathOfClass(Class cls, String filename)

Here you can find the source of getPathOfClass(Class cls, String filename)

Description

get Path Of Class

License

Apache License

Declaration

public static Path getPathOfClass(Class cls, String filename) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.URL;

import java.nio.file.*;

public class Main {

    public static Path getPathOfClass(Class cls, String filename) {
        URL uri = cls.getResource(filename);
        return uri == null ? null : Paths.get(uri.getFile());
    }/*w ww.j a  v  a 2 s .c o  m*/
}

Related

  1. getPathByFilename(String filename, List files)
  2. getPathByFormat(String nameBeforeDot, String nameAfterDot, Path parent, int i, String date)
  3. getPathCleanName(Path object)
  4. getPathInTmpDir(String fileName)
  5. GetPathName(String path)
  6. getPathProperty(Properties props, String propName)
  7. getPaths(Path dir, String fileNames)
  8. getPrefix(final Path file, final int filenameSuffixLength)
  9. getPrintWriter(String className, String flushPath)