Get the path name for the VirtualFile.

@param file the virtual file
@return the path name
968727
protected String getPathName(VirtualFile file) {
        try {
            // prefer the URI, as the pathName might
            // return an empty string for temp virtual files
            return file.toURI().toString();
        } catch (Exception e) {
            return file.getPathName();
        }
    }
1316214
public static String getFileExtension(File file) {
        if (file == null) {
            return null;
        }

        String fileName = file.getName();
        int dotPos = fileName.lastIndexOf('.');
        return dotPos == -1 ? null : fileName.substring(dotPos + 1);
    }
1282119
public static String parent(String file) {
      if (StringUtils.isNullOrBlank(file)) {
         return StringUtils.EMPTY;
      }
      file = StringUtils.trim(file);
      String path = path(file);
      int index = indexOfLastSeparator(path);
      if (index <= 0) {
         return SystemInfo.isUnix() ? Character.toString(UNIX_SEPARATOR) : Character.toString(WINDOWS_SEPARATOR);
      }
      return path.substring(0, index);
   }
915779
public static String fileAsString(File file) {
    try {
      return inputStreamAsString(new FileInputStream(file));
    } catch(FileNotFoundException e) {
      throw LOG.fileNotFoundException(file.getAbsolutePath(), e);
    }
  }
840157
public static String getOwnerName(final File file) {
        try {
            final Path path = Paths.get(file.getAbsolutePath());
            final FileOwnerAttributeView ownerAttributeView = Files.getFileAttributeView(path, FileOwnerAttributeView.class);
            return ownerAttributeView != null ? ownerAttributeView.getOwner().getName() : null;
        }
        catch(Exception e) {
            logger.warn("Failed to determine 'owner' of {}: {}", file, e.getMessage());
            return null;
        }
    }
1245977
private static List<String> getPathList(File file) throws IOException {
        //Make sure the canonical file is being parsed
        file = file.getCanonicalFile();

        //Build a List of the parts of the path
        final List<String> pathParts = new LinkedList<String>();
        while (file != null) {
            pathParts.add(file.getName());
            file = file.getParentFile();
        }
        
        return pathParts;
    }
1172108
public static Uri getFileUri(Context context, File file) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            return FileProvider.getUriForFile(context, context.getPackageName() + ".file.path.share", file);
        }
        return Uri.fromFile(file);
    }
981638
private String getPolicyFileHome(File file) {
        if (file == null || !file.exists()) {
            return null;
        }
        return file.getAbsoluteFile().getParent();
    }
1041206
private String getSourceSetNameFromFile(File file) {
    Path absolutePath = Paths.get(file.getAbsolutePath());
    Path basePath = Paths.get(task.getProject().file("src").getAbsolutePath());

    return basePath.relativize(absolutePath).toString().split(Matcher.quoteReplacement(File.separator))[0];
  }
970724
static String getVersionForFile(final File file)  {
        try {
            final PluginMeta pluginMeta = loadMeta(file);
            return pluginMeta.getVersion();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
1232819
public static String getFilename(String path) throws IllegalArgumentException {
        if (Pattern.matches(sPatternUrl, path))
            return getURLFilename(path);

        return new File(path).getName();
    }
626000
private String getFilenameInVfs(File res) {

        String resname = res.getAbsolutePath();
        if (res.isDirectory()) {
            resname += "/";
        }
        // translate the folder separator if necessary
        resname = resname.replace(File.separatorChar, '/');
        return resname.substring(m_destinationPathInRfs.length());
    }
934406
public String getExtension(final File file) {
		if (file != null) {
			final String fileName = file.getName();
			final int i = fileName.lastIndexOf('.');
			if (i > 0 && i < fileName.length() - 1) {
				return fileName.substring(i + 1).toLowerCase(Locale.getDefault());
			}
		}
		return null;
	}
647665
public static File getPathWithoutFilename(File file) {
        if (file != null) {
            if (file.isDirectory()) {
                // no file to be split off. Return everything
                return file;
            } else {
                String filename = file.getName();
                String filepath = file.getAbsolutePath();

                // Construct path without file name.
                String pathwithoutname = filepath.substring(0,
                        filepath.length() - filename.length());
                if (pathwithoutname.endsWith("/")) {
                    pathwithoutname = pathwithoutname.substring(0, pathwithoutname.length() - 1);
                }
                return new File(pathwithoutname);
            }
        }
        return null;
    }
1022334
private String filename(final File aFile) {
		try {
			return aFile.getCanonicalPath();
		} catch (IOException ex) {
			recordException(ex);
			return "UNKNOWN FILE";
		}
	}
504500
public static String getFileName(String filePath) {
		if (filePath == null) {
			return filePath;
		}
		int index = filePath.lastIndexOf(File.separator);
		if (index == -1) {
			return filePath;
		}
		return filePath.substring(index + 1);
	}
97625
public static String getFileExtension(File file) {
		return com.google.common.io.Files.getFileExtension(file.getName());
	}