Java File Name Get getFilename(String path)

Here you can find the source of getFilename(String path)

Description

get Filename

License

Apache License

Declaration

public static String getFilename(String path) 

Method Source Code


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

import java.io.File;

import java.util.List;

import com.google.common.base.Splitter;

public class Main {
    public static String getFilename(String path) {
        List<String> list = Splitter.on(File.separator).splitToList(path);
        return list.get(list.size() - 1);
    }/*from  w  ww . j  ava  2  s  .c  o m*/
}

Related

  1. getFileName(String name)
  2. getFileName(String originPath)
  3. getFileName(String path)
  4. getFilename(String path)
  5. getFileName(String path)
  6. getFileName(String path)
  7. getFileName(String path)
  8. getFileName(String path)
  9. getFileName(String path)