Java Path Normalize normalizePathname(String pathname)

Here you can find the source of normalizePathname(String pathname)

Description

Replaces all backslashes with slash char.

License

BSD License

Parameter

Parameter Description
original the path to normalize.

Return

the normalized path

Declaration

public static String normalizePathname(String pathname) 

Method Source Code

//package com.java2s;
/* Copyright ? 2015 Gerald Rosenberg.
 * Use of this source code is governed by a BSD-style
 * license that can be found in the License.md file.
 *///w w  w .  j a v a  2 s  .  co  m

public class Main {
    /**
     * Replaces all backslashes with slash char. Throws NPE if the original path is null.
     * 
     * @param original the path to normalize.
     * @return the normalized path
     */
    public static String normalizePathname(String pathname) {
        return pathname.replaceAll("\\\\", "/");
    }
}

Related

  1. normalizePath(String path, String oldFileSeperator, String newFileSeparator)
  2. normalizePath(String path, String separator)
  3. normalizePath(String pathFragment)
  4. normalizePath(String pathname)
  5. normalizePathElement(String name)
  6. normalizePathPart(final String path)
  7. normalizePaths(String path)
  8. normalizePathSeparator(final String path)
  9. normalizeRegex(String path)