Gets the table name from a path, or null if the path is the root path.
509774
@Nullable
    public static String getTableName(Path rootPath, Path path) {
        path = qualified(rootPath, path);
        if (rootPath.equals(path)) {
            // Path is root, no table
            return null;
        }

        Path tablePath;
        Path parent = path.getParent();
        if (Objects.equals(parent, rootPath)) {
            // The path itself represents a table (e.g.; emodb://ci.us/mytable)
            tablePath = path;
        } else if (parent != null && Objects.equals(parent.getParent(), rootPath)) {
            // The path is a split (e.g.; emodb://ci.us/mytable/split-id)
            tablePath = parent;
        } else {
            throw new IllegalArgumentException(
                    format("Path does not represent a table, split, or root (path=%s, root=%s)", path, rootPath));
        }
        return decode(tablePath.getName());
    }
390719
public static Path getRootPath(Path path) {
    if (path.isRoot()) {
      return path;
    }
    return getRootPath(path.getParent());
  }
97656
String getParent(String path) {
    return path.substring(0, path.lastIndexOf(Path.SEPARATOR));
  }
536519
protected String getLocalePath (String path)
    {
        return (_localeHandler == null) ? null : _localeHandler.getLocalePath(path);
    }
546444
protected Optional<String> getDatabaseName(Path path) {
    if (!this.props.contains(HIVE_DATABASE_NAME) && !this.props.contains(HIVE_DATABASE_REGEX)) {
      return Optional.<String> absent();
    }

    return Optional.<String> of(
        this.dbNamePrefix + getDatabaseOrTableName(path, HIVE_DATABASE_NAME, HIVE_DATABASE_REGEX, this.dbNamePattern)
            + this.dbNameSuffix);
  }
554841
public Namespace getNamespaceForPath(String path) {
		for (Namespace nmspc : properties.values()) {
			if (nmspc.has(path)) {
				return nmspc;
			}
		}
		
		return null;
	}
1304832
protected String getRelativePath(String ancestor, String rootPath) {

        String result = rootPath.substring(ancestor.length());
        result = CmsStringUtil.joinPaths("/", result, "/");
        return result;
    }
768404
@GuardedBy("monitor")
  private /*@Nullable*/ TreeNode findNode(/*@Nullable*/ String path) {
    if (Strings.isNullOrEmpty(path) || "/".equals(path)) { // Go back to the root directory.
      return root;
    } else {
      List<String> dirs = PATH_SPLITTER.splitToList(path);
      TreeNode node = root;
      for (int i = 0; i < dirs.size(); i++) {
        String dir = dirs.get(i);
        if ("".equals(dir) && i == 0) {
          continue; // Skip the first "", the path of root node.
        }
        if (!node.children.containsKey(dir)) {
          return null;
        } else {
          node = node.children.get(dir);
        }
      }
      return node;
    }
  }
970396
public String getTableNames(boolean bAddQuotes)
    {
        return (m_tableName == null) ? Record.formatTableNames(FOLDER_FILE, bAddQuotes) : super.getTableNames(bAddQuotes);
    }
1167205
public static String basename(String path)
  {
    return path != null ? basename(new File(path)) : null;
  }
718148
private String getDbTableName(String schemaName) {
    Preconditions.checkArgument(schemaName.matches(".+_.+_.+"));
    return schemaName.replaceFirst("_", ".").substring(0, schemaName.lastIndexOf('_'));
  }
1269603
@Override
   public String getTrimmedPath(String path)
   {
      if (path == null)
      {
         return "/";
      }
      if (!path.startsWith("/"))
      {
         try
         {
            path = new URL(path).getPath();
         }
         catch (MalformedURLException ex)
         {
            // ignore
            Logger.getLogger(JBossWSDestinationRegistryImpl.class).trace(ex);
         }
         if (!path.startsWith("/")) {
            path = "/" + path;
         }
      }
      return path;
   }
1246831
private String getRootPath(String path, int rootLevel, ResourceResolver resourceResolver) {
    String rootPath = Path.getAbsoluteParent(path, rootLevel, resourceResolver);

    // strip off everything after first "." - root path may be passed with selectors/extension which is not relevant
    if (StringUtils.contains(rootPath, ".")) {
      rootPath = StringUtils.substringBefore(rootPath, ".");
    }

    return rootPath;
  }
798133
public static String getNodeFromPath(String path)
    {
        PathUtils.validatePath(path);
        int i = path.lastIndexOf(PATH_SEPARATOR);
        if ( i < 0 )
        {
            return path;
        }
        if ( (i + 1) >= path.length() )
        {
            return "";
        }
        return path.substring(i + 1);
    }
1374473
public String getAlias(String path)
    {
        if (m_allPathsAliased && m_attributePath.lastIndexOf(path) != -1)
        {
            return m_name;
        }
        Object retObj = m_mapping.get(path);
        if (retObj != null)
        {
            return (String) retObj;
        }
        return null;
    }
1068942
@Requires("pathName != null")
  @Ensures("result != null")
  public static String getRelativeName(String pathName) {
    int lastSep = pathName.lastIndexOf('.');
    if (lastSep == -1) {
      return pathName;
    } else {
      return pathName.substring(lastSep + 1);
    }
  }
510196
public static String getParentPath(String path) {
        if (path == null) return null;
        path = path.trim();
        if (path.endsWith(PATH_ROOT) && path.length() > 1) {
            path = path.substring(0, path.length() - 1);
        }
        int lastIndex = path.lastIndexOf(PATH_ROOT);
        if (path.length() > 1 && lastIndex > 0) {
            return path.substring(0, lastIndex);
        }
        return PATH_ROOT;
    }