Android Path Create getAbsolutePath(String strCurrenDir, String strFileName)

Here you can find the source of getAbsolutePath(String strCurrenDir, String strFileName)

Description

get Absolute Path

Parameter

Parameter Description
strCurrenDir String
strFileName String

Return

String

Declaration

// //////////////////////////////////////////////////////
public static String getAbsolutePath(String strCurrenDir,
        String strFileName) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from w  w  w. j a v  a2  s  . co  m*/
     * 
     * @param strCurrenDir
     *            String
     * @param strFileName
     *            String
     * @return String
     */
    // //////////////////////////////////////////////////////
    public static String getAbsolutePath(String strCurrenDir,
            String strFileName) {
        if (!strFileName.startsWith("/") && !strFileName.startsWith("\\")) {
            if (!strCurrenDir.endsWith("/") && !strCurrenDir.endsWith("\\"))
                return strCurrenDir + "/" + strFileName;
            return strCurrenDir + strFileName;
        }
        return strFileName;
    }
}

Related

  1. ensureSlash(String dirPath)
  2. fileDir(String filename)
  3. fileDir(String folder, String folderName)
  4. getAbsoluteFile(String filename, String basedir)
  5. getAbsolutePathFromResource(Class reference, String resource)
  6. getAbsolutePathFromResource(String resource)
  7. getCanonicalPath(File file)
  8. getDirAndFullName(File f)