Java Path Normalize normalizeSlashes(String path)

Here you can find the source of normalizeSlashes(String path)

Description

Replace '\' with '/' from the given path because tsserver normalize it like this.

License

Open Source License

Parameter

Parameter Description
path a parameter

Declaration

public static String normalizeSlashes(String path) 

Method Source Code

//package com.java2s;
/**//from   ww  w. j a  v  a2s .  c  o m
 *  Copyright (c) 2015-2016 Angelo ZERR
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */

public class Main {
    /**
     * Replace '\' with '/' from the given path because tsserver normalize it
     * like this.
     * 
     * @param path
     * @return
     */
    public static String normalizeSlashes(String path) {
        return path.replaceAll("\\\\", "/");
    }
}

Related

  1. normalizeRegex(String path)
  2. normalizeRegex(String pathPattern)
  3. normalizeResourcesPath(final String path)
  4. normalizeRootPath(String rootPath)
  5. normalizeSlashes(final String path)
  6. normalizeToDir(CharSequence path)
  7. normalizeURI(String prefix, String relativePath)
  8. normalizeUriPath(String path)
  9. normalizeUrlPath(String name)