Android Path Create getDirAndFullName(File f)

Here you can find the source of getDirAndFullName(File f)

Description

get Dir And Full Name

License

Open Source License

Parameter

Parameter Description
f a parameter

Return

{dir, fullName}

Declaration

public static String[] getDirAndFullName(File f) 

Method Source Code

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

import java.io.File;

public class Main {
    /**//from   w w w.  j  a va 2  s .c o  m
     * 
     * @param f
     * @return {dir, fullName}
     */
    public static String[] getDirAndFullName(File f) {
        String path = f.getPath();
        int index = path.lastIndexOf('/');
        if (index == -1) {
            index = path.lastIndexOf('\\');
        }
        return new String[] { path.substring(0, index + 1),
                path.substring(index + 1) };
    }
}

Related

  1. getAbsoluteFile(String filename, String basedir)
  2. getAbsolutePath(String strCurrenDir, String strFileName)
  3. getAbsolutePathFromResource(Class reference, String resource)
  4. getAbsolutePathFromResource(String resource)
  5. getCanonicalPath(File file)
  6. getDirName(String dir)
  7. getDownloadPath()
  8. getFilePath(String path)
  9. getPath(String fullFileName)