Java Path File Extention nio getExtension(final Path path)

Here you can find the source of getExtension(final Path path)

Description

get Extension

License

Open Source License

Declaration

public static String getExtension(final Path path) 

Method Source Code

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

import java.nio.file.Path;

public class Main {
    public static String getExtension(final Path path) {

        int i = path.toString().lastIndexOf(".");

        if (i >= 0) {
            return path.toString().substring(i + 1);
        }/*www  . j  a v  a  2  s  .c  om*/

        return "";

    }
}

Related

  1. changeFileExtension(Path fileName, String extension)
  2. fileExtension(final Path thePath)
  3. fileRenamer(final String fromPath, final String toPath, @Nullable final String toExtension, final boolean junkPaths)
  4. findFilesWithExtension(Path directory, String targetExtension)
  5. getAllPaths(Path root, final String... extensions)
  6. getExtension(Path file)
  7. getExtension(Path path)
  8. getFileExtension(final Path file)
  9. getFileExtension(final Path path)