Java Path Normalize normalizedPath(String original)

Here you can find the source of normalizedPath(String original)

Description

Replaces all backslashes with slash char.

License

Apache License

Parameter

Parameter Description
original the path to normalize.

Return

the normalized path

Declaration

public static String normalizedPath(String original) 

Method Source Code

//package com.java2s;
/*//from  w  ww .j av  a2s. c  o  m
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

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 normalizedPath(String original) {
        return original.replaceAll("\\\\", "/");
    }
}

Related

  1. normalize_color_path(int eff_color_path)
  2. normalizeAllSeparators(String path)
  3. normalizeBasePath(String basePath)
  4. normalizeDbPath(String databasePath)
  5. normalizeDotSegment(String path)
  6. normalizeFileSystemPath(String path)
  7. normalizeFullPath(String path)
  8. normalizeLocalPath(final String localPath)
  9. normalizeMediaPath(String hrefBaseUrl, String localMediaPath, String href)