Android Path Sub Path Get getLastPathComponent(File file)

Here you can find the source of getLastPathComponent(File file)

Description

get Last Path Component

Declaration

public static String getLastPathComponent(File file) 

Method Source Code

//package com.java2s;

import java.io.File;

public class Main {
    public static String getLastPathComponent(File file) {
        String[] segments = file.getAbsolutePath().split("/");
        String lastPathComponent = segments[segments.length - 1];
        return lastPathComponent;
    }/*from   w w  w.j a  v  a  2 s  .c  o m*/
}

Related

  1. getSubFiles(String parentpath, FileFilter fileFilter)
  2. getSubFiles(String parentpath, String uri)
  3. getSubFiles(String parentpath, String uri, FileFilter fileFilter)
  4. hasSubFiles(String path)
  5. hasSubFiles(String path, String uri)
  6. getLastPathComponent(String filePath)
  7. getLastPathComponent(final String filePath)
  8. getLastPathComponent(String url)