legacy/src/main/java/thredds/crawlabledataset/CrawlableDatasetUtils.java
public static String stepDownRelativePath(String[] pathSegments) {
    if ( !CrawlableDatasetUtils.isValidRelativePath(pathSegments))
      throw new IllegalArgumentException( "Path segments not a valid relative path.");
    if ( pathSegments.length < 2 )
      throw new IllegalArgumentException( "Number of path segments must be > 1.");

    StringBuilder sb = new StringBuilder();
    for ( int i = 1; i < pathSegments.length - 1; i++ ) {
      sb.append( pathSegments[i]).append("/");
    }
    sb.append( pathSegments[pathSegments.length - 1]);
    return sb.toString();
  }
public static String stepDownRelativePath(String[] pathSegments) {
    if ( !CrawlableDatasetUtils.isValidRelativePath(pathSegments))
      throw new IllegalArgumentException( "Path segments not a valid relative path.");
    if ( pathSegments.length < 2 )
      throw new IllegalArgumentException( "Number of path segments must be > 1.");

    StringBuilder sb = new StringBuilder();
    for ( int i = 1; i < pathSegments.length - 1; i++ ) {
      sb.append( pathSegments[i]).append("/");
    }
    sb.append( pathSegments[pathSegments.length - 1]);
    return sb.toString();
  }
public static String stepDownRelativePath ( String [ ] pathSegments ) { if ( ! CrawlableDatasetUtils . isValidRelativePath ( pathSegments ) ) throw new IllegalArgumentException ( "Path segments not a valid relative path." ) ; if ( pathSegments . length < 2 ) throw new IllegalArgumentException ( "Number of path segments must be > 1." ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 1 ; i < pathSegments . length - 1 ; i ++ ) { sb . append ( pathSegments [ i ] ) . append ( "/" ) ; } sb . append ( pathSegments [ pathSegments . length - 1 ] ) ; return sb . toString ( ) ; }
Given a relative path as an array of path segments (see {@link #getPathSegments(String)},
return the path relative to the first path segment.

I.e., drop the first segmentRejoin the given path segments after dropping the first path segment.

@param pathSegments a string array of a relative path as returned by getPathSegments()
@return the path relative to the first path segment.
Given a relative path as an array of path segments ( see { @link #getPathSegments ( String ) } return the path relative to the first path segment .