legacy/src/main/java/thredds/catalog/InvDatasetScan.java
public String translatePathToLocation( String dsPath )
  {
    if ( dsPath == null ) return null;

    if ( dsPath.length() > 0 )
      if ( dsPath.startsWith( "/" ) )
        dsPath = dsPath.substring( 1 );

    if ( ! dsPath.startsWith( this.getPath()))
      return null;

    // remove the matching part, the rest is the "data directory"
    String dataDir = dsPath.substring( this.getPath().length() );
    if ( dataDir.startsWith( "/" ) )
      dataDir = dataDir.substring( 1 );

    CrawlableDataset curCrDs = scanLocationCrDs.getDescendant( dataDir);

    if ( log.isDebugEnabled() ) log.debug( "translatePathToLocation(): url dsPath= " + dsPath + " to dataset dsPath= " + curCrDs.getPath() );

    return curCrDs.getPath();
  }
public String translatePathToLocation( String dsPath )
  {
    if ( dsPath == null ) return null;

    if ( dsPath.length() > 0 )
      if ( dsPath.startsWith( "/" ) )
        dsPath = dsPath.substring( 1 );

    if ( ! dsPath.startsWith( this.getPath()))
      return null;

    // remove the matching part, the rest is the "data directory"
    String dataDir = dsPath.substring( this.getPath().length() );
    if ( dataDir.startsWith( "/" ) )
      dataDir = dataDir.substring( 1 );

    CrawlableDataset curCrDs = scanLocationCrDs.getDescendant( dataDir);

    if ( log.isDebugEnabled() ) log.debug( "translatePathToLocation(): url dsPath= " + dsPath + " to dataset dsPath= " + curCrDs.getPath() );

    return curCrDs.getPath();
  }
public String translatePathToLocation ( String dsPath ) { if ( dsPath == null ) return null ; if ( dsPath . length ( ) > 0 ) if ( dsPath . startsWith ( "/" ) ) dsPath = dsPath . substring ( 1 ) ; if ( ! dsPath . startsWith ( this . getPath ( ) ) ) return null ; // remove the matching part, the rest is the "data directory" String dataDir = dsPath . substring ( this . getPath ( ) . length ( ) ) ; if ( dataDir . startsWith ( "/" ) ) dataDir = dataDir . substring ( 1 ) ; CrawlableDataset curCrDs = scanLocationCrDs . getDescendant ( dataDir ) ; if ( log . isDebugEnabled ( ) ) log . debug ( "translatePathToLocation(): url dsPath= " + dsPath + " to dataset dsPath= " + curCrDs . getPath ( ) ) ; return curCrDs . getPath ( ) ; }
Return the CrawlableDataset path/location that corresponds to the
given dataset path. The given dataset path must start with the
datasetScan path for this InvDatasetScan, if not, a null is returned.

@param dsPath a datasetScan dsPath that
@return the CrawlableDataset path that corresponds to the given dataset path or null.
Return the CrawlableDataset path / location that corresponds to the given dataset path . The given dataset path must start with the datasetScan path for this InvDatasetScan if not a null is returned .