azure-lib/src/main/java/com/streamsets/pipeline/stage/destination/datalake/writer/DataLakeGeneratorManager.java
public String getFilePath(
      String dirPathTemplate,
      Record record,
      Date recordTime
  ) throws StageException {
    String dirPath;
    // get directory path
    if (dirPathTemplateInHeader) {
      dirPath = record.getHeader().getAttribute(DataLakeTarget.TARGET_DIRECTORY_HEADER);
      Utils.checkArgument(!(dirPath == null || dirPath.isEmpty()), "Directory Path cannot be null");
    } else {
      dirPath = resolvePath(dirPathTemplateEval, dirPathTemplateVars, dirPathTemplate, recordTime, record);
    }

    // SDC-5492: replace "//" to "/" in file path
    dirPath = dirPath.replaceAll("/+","/");
    if (dirPath.endsWith("/")) {
      dirPath = dirPath.substring(0, dirPath.length()-1);
    }

    return outputStreamHelper.getTempFilePath(dirPath, record, recordTime);
  }
public String getFilePath(
      String dirPathTemplate,
      Record record,
      Date recordTime
  ) throws StageException {
    String dirPath;
    // get directory path
    if (dirPathTemplateInHeader) {
      dirPath = record.getHeader().getAttribute(DataLakeTarget.TARGET_DIRECTORY_HEADER);
      Utils.checkArgument(!(dirPath == null || dirPath.isEmpty()), "Directory Path cannot be null");
    } else {
      dirPath = resolvePath(dirPathTemplateEval, dirPathTemplateVars, dirPathTemplate, recordTime, record);
    }

    // SDC-5492: replace "//" to "/" in file path
    dirPath = dirPath.replaceAll("/+","/");
    if (dirPath.endsWith("/")) {
      dirPath = dirPath.substring(0, dirPath.length()-1);
    }

    return outputStreamHelper.getTempFilePath(dirPath, record, recordTime);
  }
public String getFilePath ( String dirPathTemplate , Record record , Date recordTime ) throws StageException { String dirPath ; // get directory path if ( dirPathTemplateInHeader ) { dirPath = record . getHeader ( ) . getAttribute ( DataLakeTarget . TARGET_DIRECTORY_HEADER ) ; Utils . checkArgument ( ! ( dirPath == null || dirPath . isEmpty ( ) ) , "Directory Path cannot be null" ) ; } else { dirPath = resolvePath ( dirPathTemplateEval , dirPathTemplateVars , dirPathTemplate , recordTime , record ) ; } // SDC-5492: replace "//" to "/" in file path dirPath = dirPath . replaceAll ( "/+" , "/" ) ; if ( dirPath . endsWith ( "/" ) ) { dirPath = dirPath . substring ( 0 , dirPath . length ( ) - 1 ) ; } return outputStreamHelper . getTempFilePath ( dirPath , record , recordTime ) ; }
Returns the temp file path to write records to
@param dirPathTemplate Directory Template
@param record Record for which file path is calculated
@param recordTime Record time
@return Temporary File Path to write records to
@throws StageException
Returns the temp file path to write records to