legacy/src/main/java/thredds/crawlabledataset/CrawlableDatasetFactory.java
public static String normalizePath( String path )
  {
    // Replace any occurance of a backslash ("\") with a slash ("/").
    // NOTE: Both String and Pattern escape backslash, so need four backslashes to find one.
    // NOTE: No longer replace multiple backslashes with one slash, which allows for UNC pathnames (Windows LAN addresses).
    //       Was path.replaceAll( "\\\\+", "/");
    String newPath = path.replaceAll( "\\\\", "/");

    // Remove trailing slashes.
    while ( newPath.endsWith( "/") && ! newPath.equals("/") )
      newPath = newPath.substring( 0, newPath.length() - 1 );

    return newPath;
  }
public static String normalizePath( String path )
  {
    // Replace any occurance of a backslash ("\") with a slash ("/").
    // NOTE: Both String and Pattern escape backslash, so need four backslashes to find one.
    // NOTE: No longer replace multiple backslashes with one slash, which allows for UNC pathnames (Windows LAN addresses).
    //       Was path.replaceAll( "\\\\+", "/");
    String newPath = path.replaceAll( "\\\\", "/");

    // Remove trailing slashes.
    while ( newPath.endsWith( "/") && ! newPath.equals("/") )
      newPath = newPath.substring( 0, newPath.length() - 1 );

    return newPath;
  }
public static String normalizePath ( String path ) { // Replace any occurance of a backslash ("\") with a slash ("/"). // NOTE: Both String and Pattern escape backslash, so need four backslashes to find one. // NOTE: No longer replace multiple backslashes with one slash, which allows for UNC pathnames (Windows LAN addresses). //       Was path.replaceAll( "\\\\+", "/"); String newPath = path . replaceAll ( "\\\\" , "/" ) ; // Remove trailing slashes. while ( newPath . endsWith ( "/" ) && ! newPath . equals ( "/" ) ) newPath = newPath . substring ( 0 , newPath . length ( ) - 1 ) ; return newPath ; }
Normalize the given path so that it can be used in the creation of a CrawlableDataset.
This method can be used on absolute or relative paths.

Normal uses slashes ("/") as path seperator, not backslashes ("\"), and does
not use trailing slashes. This function allows users to specify Windows
pathnames and UNC pathnames in there normal manner.

@param path the path to be normalized.
@return the normalized path.
@throws NullPointerException if path is null.
Normalize the given path so that it can be used in the creation of a CrawlableDataset . This method can be used on absolute or relative paths .