Gets the absolut path without the filename.

@param file
the file.
@return 's the absolut path without filename.
978909
public static String getAbsolutPathWithoutFilename(final File file)
	{
		final String absolutePath = file.getAbsolutePath();
		int lastSlash_index = absolutePath.lastIndexOf("/");
		if (lastSlash_index < 0)
		{
			lastSlash_index = absolutePath.lastIndexOf("\\");
		}
		return absolutePath.substring(0, lastSlash_index + 1);
	}
1288353
private static String getFileNameInPath(String path) {
        String fName;
        if (path.indexOf('/') != -1) {
            fName = path.substring(path.lastIndexOf('/') + 1);
        } else {
            fName = path;
        }
        return fName;
    }
1124116
public static String getExtension(File file)
    {
        Check.notNull(file);

        return getExtension(file.getName());
    }
1236381
public Path pathToCodeFile(@javax.annotation.Nonnull File file) throws IOException {
    return fileName.getCanonicalFile().toPath().relativize(file.getCanonicalFile().toPath());
  }
66724
public static String getRelativePath(File baseDir, File file){
		if(!baseDir.isDirectory()){
			throw new IllegalArgumentException("Base directory must be a directory.");
		}

		String dirPath = FilenameUtils.normalize(baseDir.getAbsolutePath(), true);
		String filePath = FilenameUtils.normalize(file.getAbsolutePath(), true);
		if(!dirPath.endsWith("/")){
			dirPath += "/";
		}

		if(filePath.startsWith(dirPath)){
			return filePath.substring(dirPath.length());
		}else {
			throw new IllegalArgumentException("File '" + file + "' not in base directory '" + baseDir + "'");
		}
	}
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;
    }
430254
public String getAbsoluteName(){
		if(this.isValid()){
			if(this.asFile()!=null){
				return this.file.getAbsolutePath();
			}
			else{
				return this.url.getPath();
			}
		}
		return null;
	}
383229
def _get_abs_filepath(self, ifile):
        
        assert ifile is not None
        ifile = ifile[7:] if ifile.startswith('file://') else ifile
        if ifile[0] != '/':
            basedir = os.path.abspath(os.path.dirname(self.config_file))
            ifile = os.path.join(basedir, ifile)
        return 'file://' + ifile
470978
public static boolean directoryOnlyIfNotIgnored(File file) {
        boolean accept = false;

        FilenameFilter ignoreFile = new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                return name.equalsIgnoreCase(".jbakeignore");
            }
        };

        accept = file.isDirectory() && (file.listFiles(ignoreFile).length == 0);

        return accept;
    }
247502
public static String extName(File file) {
		if (null == file) {
			return null;
		}
		if (file.isDirectory()) {
			return null;
		}
		return extName(file.getName());
	}
121128
public static String getGroupName(final File file) {
        if (OsValidator.WINDOWS) {
            logger.trace("Determining 'group' is skipped for file [{}] on [{}]", file, OsValidator.OS);
            return null;
        }
        try {
            final Path path = Paths.get(file.getAbsolutePath());
            final PosixFileAttributes posixFileAttributes = Files.getFileAttributeView(path, PosixFileAttributeView.class).readAttributes();
            return posixFileAttributes != null ? posixFileAttributes.group().getName() : null;
        } catch (Exception e) {
            logger.warn("Failed to determine 'group' of {}: {}", file, e.getMessage());
            return null;
        }
    }
651673
public static String getNmtAbsolutePath(String fullPath){
		String absolutePath = "";
		if (fullPath.startsWith("file://")){
			absolutePath = fullPath.replace("file://", "");
		} else {
			absolutePath = fullPath;
		}
		return absolutePath;
	}
225899
private Path getPath(String fileName)
      throws IOException, URISyntaxException {
    Path path;
    URL url = getClass().getClassLoader().getResource(fileName);
    if (url == null) {
      throw new IOException(String.format("File %s is not existing", fileName));
    }
    URI uri = url.toURI();
    Map<String, String> env = new HashMap<>();
    if (uri.toString().contains("!")) {
      String[] parts = uri.toString().split("!");
      if (fs == null) {
        fs = FileSystems.newFileSystem(URI.create(parts[0]), env);
      }
      path = fs.getPath(parts[1]);
    } else {
      path = Paths.get(uri);
    }
    return path;
  }
11479
public static String[] getCanonicalPathElements (File file)
        throws IOException
    {
        file = file.getCanonicalFile();

        // If we were a file, get its parent
        if (!file.isDirectory()) {
            file = file.getParentFile();
        }

        return file.getPath().split(File.separator);
    }
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;
	}
1361921
private static Path toPath(@Nonnull File file) throws IOException {
        try {
            return file.toPath();
        } catch (InvalidPathException e) {
            throw new IOException(e);
        }
    }
1343519
public static String path(String file) {
      if (StringUtils.isNullOrBlank(file)) {
         return StringUtils.EMPTY;
      }
      file = StringUtils.trim(file);
      int pos = indexOfLastSeparator(file);
      return pos == file.length() - 1 ? file.substring(0, file.length() - 1) : file;
   }