Gets the absolute file path as a string, normalized
to using front slashes for path separators.
@param {String} fileName
180977
function (fileName) {
            var dir;
            if (currDirRegExp.test(fileName)) {
                dir = frontSlash(location.href);
                if (dir.indexOf('/') !== -1) {
                    dir = dir.split('/');

                    //Pull off protocol and host, just want
                    //to allow paths (other build parts, like
                    //require._isSupportedBuildUrl do not support
                    //full URLs), but a full path from
                    //the root.
                    dir.splice(0, 3);

                    dir.pop();
                    dir = '/' + dir.join('/');
                }

                fileName = dir + fileName.substring(1);
            }

            return fileName;
        }
1160331
function (fileName) {
            fileName = (fileName || "").toLowerCase();
            var validExtensions = ["svg", "cdr", "eps", "ai"],
                fileExtension = fileName.substr(fileName.lastIndexOf('.') + 1);

            return validExtensions.indexOf(fileExtension) != -1;
        }
317649
public static String getFullPath(String filename) {
        if (filename == null) {
            return null;
        }
        int index = indexOfLastSeparator(filename);
        if (index < 0) {
            return StringUtils.EMPTY;
        }
        return filename.substring(0, index);
    }
516053
@Pure
	public static URL dirname(File filename) {
		if (filename == null) {
			return null;
		}
		String parent = fromFileStandardToURLStandard(filename.getParent());
		try {
			if (parent == null || "".equals(parent)) { //$NON-NLS-1$
				if (filename.isAbsolute()) {
					return null;
				}
				return new URL(URISchemeType.FILE.name(), "", CURRENT_DIRECTORY); //$NON-NLS-1$
			}
			// Treat Windows specific.
			if (Pattern.matches("^" + URL_PATH_SEPARATOR + "?[a-zA-Z][:|]$", parent)) { //$NON-NLS-1$ //$NON-NLS-2$
				parent += URL_PATH_SEPARATOR;
			}
			return new URL(URISchemeType.FILE.name(), "", parent); //$NON-NLS-1$
		} catch (MalformedURLException exception) {
			return null;
		}
	}
586333
function normalizePath(filepath) {
			if (!filepath.length) return filepath;

			// Make all slashes forward
			filepath = filepath.replace(/\\/g, '/');

			// Make sure path ends with a slash
			if (!_s.endsWith(filepath, '/')) {
				filepath += '/';
			}

			return filepath;
		}
685904
function fileName(file) {
  let prefix = null
  let reference = null

  if (isPathSubDirOf(file, PROJECT_DIR)) {
    // Assets from the target project.
    prefix = []
    reference = PROJECT_DIR
  } else if (isPathSubDirOf(file, TOOLBOX_DIR)) {
    // Assets from the Toolbox.
    prefix = ['__borela__']
    reference = TOOLBOX_DIR
  }

  const RELATIVE = relative(reference, file)
  let nodes = RELATIVE.split(sep)

  if (nodes[0] === 'src')
    nodes.shift()

  if (prefix.length > 0)
    nodes = [...prefix, ...nodes]

  return `${nodes.join('/')}?[sha512:hash:base64:8]`
}
1094137
def get(cls, filename):
        
        path = os.path.join(SparkFiles.getRootDirectory(), filename)
        return os.path.abspath(path)
914900
function getFileSystemPath (url) {
  // Strip-off the "file://" protocol
  url = stripFileProtocol(url);

  // If the file path includes characters that have special meaning in URLs
  // (such as "#", "?", and "%"), then they MUST be URL-encoded by the user.
  url = decodeURIComponent(url);

  // On Windows, normalize all slashes to backslashes
  if (isWindows) {
    url = url.replace(forwardSlashPattern, '\\');
  }

  return url;
}
1161658
@Pure
	@SuppressWarnings("checkstyle:magicnumber")
	private static String extractLocalPath(String filename) {
		if (filename == null) {
			return null;
		}
		final int max = Math.min(FILE_PREFIX.length, filename.length());
		final int inner = max - 2;
		if (inner <= 0) {
			return filename;
		}
		boolean foundInner = false;
		boolean foundFull = false;
		for (int i = 0; i < max; ++i) {
			final char c = Character.toLowerCase(filename.charAt(i));
			if (FILE_PREFIX[i] != c) {
				foundFull = false;
				foundInner = i >= inner;
				break;
			}
			foundFull = true;
		}
		String fn;
		if (foundFull) {
			fn = filename.substring(FILE_PREFIX.length);
		} else if (foundInner) {
			fn = filename.substring(inner);
		} else {
			fn = filename;
		}
		if (Pattern.matches("^(" + Pattern.quote(URL_PATH_SEPARATOR) + "|" //$NON-NLS-1$ //$NON-NLS-2$
				+ Pattern.quote(WINDOWS_SEPARATOR_STRING) + ")[a-zA-Z][:|].*$", fn)) { //$NON-NLS-1$
			fn = fn.substring(1);
		}
		return fn;
	}
116037
function formDestPath (folderName, fileName) {
      var delimiter = '';
      if (folderName[folderName.length - 1] !== '/'){
        delimiter = '/';
      }
      return folderName + delimiter + path.basename(fileName);
    }
978124
def get_path(filename):
    
    path = abspath(filename) if os.path.isdir(filename) else dirname(abspath(filename))
    return path
359288
function getLines(filePath) {
  // if (path.isAbsolute(filePath)) throw new Error('Absolute file path is not allowed: ' + filePath);

  if (_.isArray(filePath)) {
    // If it's already lines, return the arg.
    return filePath;
  }

  if (!fileLines[filePath]) {
    // if the file is moved, find the real file path
    let realFilePath = _.findKey(mvs, s => s === filePath) || filePath;
    // if dir is moved, find the original file path
    Object.keys(mvDirs).forEach(oldDir => {
      if (_.startsWith(realFilePath, mvDirs[oldDir])) {
        realFilePath = realFilePath.replace(mvDirs[oldDir], oldDir);
      }
    });
    // console.log('real file path: ', Object.keys(fileLines), realFilePath);
    const absPath = path.isAbsolute(realFilePath) ? realFilePath : paths.map(realFilePath);
    if (!fs.existsSync(absPath)) {
      throw new Error("Can't find such file: " + realFilePath + '(' + absPath + ')');
    }
    fileLines[filePath] = fs
      .readFileSync(absPath)
      .toString()
      .split(/\r?\n/);
  }
  return fileLines[filePath];
}
560728
function toFileName(typeName) {
  var result = '';
  var wasLower = false;
  for (var i = 0; i < typeName.length; i++) {
    var c = typeName.charAt(i);
    var isLower = /[a-z]/.test(c);
    if (!isLower && wasLower) {
      result += '-';
    }
    result += c.toLowerCase();
    wasLower = isLower;
  }
  return result;
}
913026
function(fileName) {
            //Grab the path package here locally for clarity
            var _path = require('path');
            
            //'yada/yada/multi1.html' -> 'multi1'
            var name = _path
              .basename(
                fileName, 
                _path.extname(fileName));
                
            //'multi1' -> 'name_1'
            return 'name_'+name[5];
          }
851457
function (path) {
                var absolute = path.charAt(0) === '/', trailingSlash = path.slice(0 - 1) === '/';
                path = normalizeArray(splitPathToArray(path), !absolute).join('/');
                if (!path && !absolute) {
                    path = '.';
                }
                if (path && trailingSlash) {
                    path += '/';
                }
                return (absolute ? '/' : '') + path;
            }
599970
private static String getFilePath(String defaultPath, String filePath) {
		return defaultPath+File.separator+filePath;
	}
282943
@Override
    public String getPath() {
    	String result;

    	result = path.toString().substring(getRoot().getAbsolute().length());
    	return result.replace(File.separatorChar, Filesystem.SEPARATOR_CHAR);
    }