Java Path Normalize normalizePaths(String path)

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

Description

Normalizes the input path in the windows and unix world to the Java Representation

License

Open Source License

Parameter

Parameter Description
path The Path in the Windows/Linux World

Return

the normalized Path in the Java World

Declaration

public static String normalizePaths(String path) 

Method Source Code

//package com.java2s;
/*******************************************************************************
* This file is part of the Coporate Semantic Web Project.
*
* This work has been partially supported by the ``InnoProfile-Corporate Semantic Web" project funded by the German Federal
* Ministry of Education and Research (BMBF) and the BMBF Innovation Initiative for the New German Laender - Entrepreneurial Regions.
*
* http://www.corporate-semantic-web.de///from   w  w w.  j a  v  a 2 s .  c  o m
*
*
* Freie Universitaet Berlin
* Copyright (c) 2007-2013
*
*
* Institut fuer Informatik
* Working Group Coporate Semantic Web
* Koenigin-Luise-Strasse 24-26
* 14195 Berlin
*
* http://www.mi.fu-berlin.de/en/inf/groups/ag-csw/
*
*
*
* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA or see <http://www.gnu.org/licenses/>
******************************************************************************/

public class Main {
    /**
     * Normalizes the input path in the windows and unix world to the Java
     * Representation
     * 
     * @param path
     *            The Path in the Windows/Linux World
     * @return the normalized Path in the Java World
     */
    public static String normalizePaths(String path) {
        return path.replaceAll("\\\\", "/");

    }
}

Related

  1. normalizePath(String pathFragment)
  2. normalizePath(String pathname)
  3. normalizePathElement(String name)
  4. normalizePathname(String pathname)
  5. normalizePathPart(final String path)
  6. normalizePathSeparator(final String path)
  7. normalizeRegex(String path)
  8. normalizeRegex(String pathPattern)
  9. normalizeResourcesPath(final String path)