Android Path Create getDirName(String dir)

Here you can find the source of getDirName(String dir)

Description

get Dir Name

Declaration

private static String getDirName(String dir) 

Method Source Code

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.log4j.Logger;

public class Main{
    private static final String separator = "/";
    /*from www .  j av a 2 s .  c  om*/
    private static String getDirName(String dir) {
        if (dir.endsWith(separator)) {
            dir = dir.substring(0, dir.lastIndexOf(separator));
        }
        return dir.substring(dir.lastIndexOf(separator) + 1);
    }
}

Related

  1. getAbsolutePath(String strCurrenDir, String strFileName)
  2. getAbsolutePathFromResource(Class reference, String resource)
  3. getAbsolutePathFromResource(String resource)
  4. getCanonicalPath(File file)
  5. getDirAndFullName(File f)
  6. getDownloadPath()
  7. getFilePath(String path)
  8. getPath(String fullFileName)
  9. getProjectAbsolutePath()