Will be returned relative path {name}/{name}.xml for all OS.

@param path
String, path to
@param backupDirCanonicalPath
String, path to backup dir
@return String
Will be returned relative path {name}/{name}.xml for all OS
@throws MalformedURLException
350428
public static String getRelativePath(String path, String backupDirCanonicalPath) throws MalformedURLException
   {
      URL urlPath = new URL(resolveFileURL("file:" + path));
      URL urlBackupDir = new URL(resolveFileURL("file:" + backupDirCanonicalPath));

      return urlPath.toString().replace(urlBackupDir.toString() + "/", "");
   }
1330465
def _relativePath(self, fullPath):
        
        if fullPath is None:
            return None

        assert fullPath.startswith("/"), fullPath

        path = os.path.relpath(fullPath, self.userPath)

        if not path.startswith("../"):
            return path
        elif self.ignoreExtraVolumes:
            return None
        else:
            return fullPath
476162
public void getLink(String path, final I_CmsStringCallback callback) {

        m_apiRoot.getRpcHelper().executeRpc(CmsXmlContentUgcApi.SERVICE.getLink(path, new AsyncCallback<String>() {

            @SuppressWarnings("synthetic-access")
            public void onFailure(Throwable caught) {

                m_apiRoot.handleError(caught, null);
            }

            public void onSuccess(String result) {

                callback.call(result);
            }
        }));
    }
243888
private static String getRelativePathForPath(final String relativePath, final String sep) {
        final StringTokenizer tokenizer = new StringTokenizer(relativePath.replace(WINDOWS_SEPARATOR, UNIX_SEPARATOR), UNIX_SEPARATOR);
        final StringBuilder buffer = new StringBuilder();
        if (tokenizer.countTokens() == 1) {
            return null;
        } else {
            while(tokenizer.countTokens() > 1) {
                tokenizer.nextToken();
                buffer.append("..");
                buffer.append(sep);
            }
            return buffer.toString();
        }
    }
344589
public static String getRelativePathName(Path root, Path path) {
        Path relative = root.relativize(path);
        return Files.isDirectory(path) && !relative.toString().endsWith("/") ? String.format("%s/", relative.toString()) : relative.toString();
    }
166225
public static String asPath(String path) {
        if (path == null) {
            return null;
        }

        // On windows we have to replace the backslash
        if (!File.separator.equals(FileUtil.URI_SEPARATOR_CHAR)) {
            return path.replace(File.separator, FileUtil.URI_SEPARATOR_CHAR);
        } else {
            return path;
        }
    }
839213
private String getRealPath( String path )
            throws IOException
    {

        URL fileURL = _servletContext.getResource( path );

        File tempDir = (File) _servletContext.getAttribute( "javax.servlet.context.tempdir" );

        // download file into temp dir
        if ( fileURL != null )
        {
            File newFile = File.createTempFile( "temp", ".jar", tempDir );
            if ( download( fileURL, newFile ) )
            {
                String filePath = newFile.getPath();
                return filePath;
            }
        }
        return null;
    }
152611
public File getBackupFile(String path) {

		String rootDir = tempDir + JawrConstant.SPRITE_BACKUP_GENERATED_CSS_DIR;
		String fPath = null;
		if (jawrConfig.isWorkingDirectoryInWebApp()) {
			fPath = jawrConfig.getContext().getRealPath(rootDir + getCssPath(path));
		} else {
			fPath = rootDir + getCssPath(path);
		}

		return new File(fPath);
	}
1047735
private URL getRelativePath(FacesContext facesContext, String path) throws IOException
    {
        URL url = (URL) _relativePaths.get(path);
        if (url == null)
        {
            url = _factory.resolveURL(facesContext, _src, path);
            if (url != null)
            {
                ViewResource viewResource = (ViewResource) facesContext.getAttributes().get(
                    FaceletFactory.LAST_RESOURCE_RESOLVED);
                if (viewResource != null)
                {
                    // If a view resource has been used to resolve a resource, the cache is in
                    // the ResourceHandler implementation. No need to cache in _relativeLocations.
                }
                else
                {
                    _relativePaths.put(path, url);
                }
            }
        }
        return url;
    }
1203651
public static boolean walkPath(File appRoot, String relativePath) throws IOException {
        // Walk the path from the app root
        String[] relativePathElements = relativePath.replace(File.separatorChar, '/').split("/");
        File currentPath = new File(appRoot.getCanonicalPath());
        for (int i = 0; i < relativePathElements.length; i++) {        	
    		// Handle urls which start with a "/" in whoich case split  
    		if (!relativePathElements[i].equals("")) {
                String[] entries = currentPath.list(new StrictFileNameFilter(relativePathElements[i]));
                if (entries==null || entries.length != 1) {
                    if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) 
                        logger.logp(Level.FINE, CLASS_NAME,"uriCaseCheck",relativePathElements[i] + " not found.");
                    return false;
                }
                currentPath = new File(currentPath, relativePathElements[i]);
    		}    
        }
        return true;
    }
538302
@Override
	public String getFilePath(String resourcePath) {
		String path = getResolver().getResourcePath(resourcePath);
		return rsBrowser.getFilePath(path);
	}
769519
public static synchronized String getAbsolutePath(String path) {
		try {
			if (rootDir == null) {
				Class<?> parentClass = getParentClass();
				String classFile = parentClass.getName().replace('.', '/') + ".class";
				URL url = parentClass.getResource("/" + classFile);
				if (url == null) {
					return null;
				}
				if (url.getProtocol().equals("jar")) {
					rootDir = url.getPath();
					int i = rootDir.lastIndexOf('!');
					if (i >= 0) {
						rootDir = rootDir.substring(0, i);
					}
					rootDir = new File(new URL(rootDir).toURI()).getParent();
				} else {
					rootDir = new File(url.toURI()).getPath();
					rootDir = rootDir.substring(0, rootDir.length() - classFile.length());
					if (rootDir.endsWith(File.separator)) {
						rootDir = rootDir.substring(0, rootDir.length() - 1);
					}
				}
				rootDir = new File(rootDir).getParent();
			}
			return new File(rootDir + File.separator + path).getCanonicalPath();
		} catch (IOException | URISyntaxException e) {
			throw new RuntimeException(e);
		}
	}
1039549
@Pure
	@SuppressWarnings({"checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
	public static URL getParentURL(URL url) throws MalformedURLException {
		if (url == null) {
			return url;
		}
		String path = url.getPath();
		final String prefix;
		final String parentStr;

		switch (URISchemeType.getSchemeType(url)) {
		case JAR:
			final int index = path.indexOf(JAR_URL_FILE_ROOT);
			assert index > 0;
			prefix = path.substring(0, index + 1);
			path = path.substring(index + 1);
			parentStr = URL_PATH_SEPARATOR;
			break;
		case FILE:
			prefix = null;
			parentStr = ".." + URL_PATH_SEPARATOR; //$NON-NLS-1$
			break;
			//$CASES-OMITTED$
		default:
			prefix = null;
			parentStr = URL_PATH_SEPARATOR;
		}

		if (path == null || "".equals(path)) { //$NON-NLS-1$
			path = parentStr;
		}
		int index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR);
		if (index == -1) {
			path = parentStr;
		} else if (index == path.length() - 1) {
			index = path.lastIndexOf(URL_PATH_SEPARATOR_CHAR, index - 1);
			if (index == -1) {
				path = parentStr;
			} else {
				path = path.substring(0, index + 1);
			}
		} else {
			path = path.substring(0, index + 1);
		}

		if (prefix != null) {
			path = prefix + path;
		}

		return new URL(url.getProtocol(), url.getHost(), url.getPort(), path);
	}
890698
public static String getParentDirPath(final String path, final char separator) {
        final int lastSlashIdx = path.lastIndexOf(separator);
        if (lastSlashIdx <= 0) {
            return "";
        }
        return path.substring(0, lastSlashIdx);
    }
1213678
@Nullable
  static SourceFile getRelativePath(String baseFilePath, String relativePath) {
    return SourceFile.fromPath(
        FileSystems.getDefault().getPath(baseFilePath).resolveSibling(relativePath).normalize(),
        UTF_8);
  }
1063232
private String getSlashyPath(final String path) {
        String changedPath = path;
        if (File.separatorChar != '/')
            changedPath = changedPath.replace(File.separatorChar, '/');

        return changedPath;
    }
10397
public static  String convertToExternalPath(final String path) {
        String newPath = replaceOnce(path, "/" + CONTAINER_WEBAC_ACL, "/" + FCR_ACL);

        newPath = replaceOnce(newPath, "/" + LDPCV_TIME_MAP, "/" + FCR_VERSIONS);

        newPath = replaceOnce(newPath, "/" + FEDORA_DESCRIPTION, "/" + FCR_METADATA);

        return newPath;
    }