Class MoveExistingFileStrategyUtils

java.lang.Object
org.apache.camel.component.file.MoveExistingFileStrategyUtils

public final class MoveExistingFileStrategyUtils extends Object
  • Method Details

    • completePartialRelativePath

      public static String completePartialRelativePath(String destinationPath, String fileOnlyName, String directoryName)
      This method manipulates the destinationPath in case of moveExisting parameter is expressed as file language expression subdirectory name of the directoryName adding directoryName on top and file name at the end. for example, a camel endpoint like that: file://data/file?fileExist=Moveinvalid input: '&moveExisting'=archive-${date:now:yyyyMMddHHmmssSSS}/ directoryName = data/file, fileOnlyName = whatever.ext, destinationPath = archive-20201110115125770 the outcome of this method would be data/file/archive-20201110115125770/whatever.ext
      Parameters:
      destinationPath - the destination path
      fileOnlyName - the file name without the path
      directoryName - the path of the file to be moved/renamed
      Returns:
      the full destination path