{"record":{"id":"5b2ce7c000abd2da","repo":"pentaho/pentaho-kettle","slug":"jobftps-error-movingfiletofolder","errorCode":"JobFTPS.Error.MovingFileToFolder","errorMessage":"JobFTPS.Error.MovingFileToFolder","messagePattern":"JobFTPS\\.Error\\.MovingFileToFolder","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/ftps/impl/src/main/java/org/pentaho/di/job/entries/ftpsget/FTPSConnection.java","lineNumber":555,"sourceCode":"      throw new KettleException( BaseMessages.getString( PKG, \"JobFTPS.Error.DeletingFile\", filename ), e );\n    }\n  }\n\n  /**\n   *\n   * this method is used to move a file to remote directory\n   *\n   * @param fromFile\n   *          File on remote host to move\n   * @param targetFoldername\n   *          Target remote folder\n   * @throws KettleException\n   */\n  public void moveToFolder( FTPFile fromFile, String targetFoldername ) throws KettleException {\n    try {\n      this.connection.renameFile( fromFile, new FTPFile( targetFoldername, fromFile.getName() ) );\n    } catch ( Exception e ) {\n      throw new KettleException( BaseMessages.getString( PKG, \"JobFTPS.Error.MovingFileToFolder\", fromFile\n        .getName(), targetFoldername ), e );\n    }\n  }\n\n  /**\n   *\n   * Checks if a directory exists\n   *\n   * @return true if the directory exists\n   *\n   */\n  public boolean isDirectoryExists( String directory ) {\n    String currectDirectory = null;\n    boolean retval = false;\n    try {\n      // Before save current directory\n      currectDirectory = this.connection.getWorkDirectory();\n      // Change directory","sourceCodeStart":537,"sourceCodeEnd":573,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/ftps/impl/src/main/java/org/pentaho/di/job/entries/ftpsget/FTPSConnection.java#L537-L573","documentation":"FTP client failure in FTPSConnection.moveToFolder (called from downloadFiles): renaming the remote file into the target folder failed. The localized message wraps the cause, commonly a missing destination folder or insufficient permissions on the remote host.","triggerScenarios":"downloadFiles -> moveToFolder(fromFile, targetFoldername) when RNFR/RNTO fails: target folder missing, a file with the same name exists there, permissions, or connection loss","commonSituations":"'move to folder' job setting points to a directory that was never created; target filename collision; server does not allow rename across directories","solutions":["Ensure the target folder exists first (call createDirectory on it)","Check for and remove/rename name collisions in the target folder","Verify the FTPS user has rename/write permissions in both source and target folders","Test RNFR/RNTO manually with an FTPS client to see the exact server reply"],"exampleFix":"// before\nconnection.moveToFolder(file, \"/data/processed\");\n// after\nconnection.createDirectory(\"/data/processed\"); // ensure target exists\nconnection.moveToFolder(file, \"/data/processed\");","handlingStrategy":"validation","validationCode":"try {\n  connection.createDirectory(targetFoldername); // idempotent-ish; ensure target exists\n} catch (KettleException e) {\n  // ignore 'already exists' style replies\n}","typeGuard":null,"tryCatchPattern":"try {\n  connection.moveToFolder(file, target);\n} catch (KettleException e) {\n  logError(\"Move of \" + file.getName() + \" to \" + target + \" failed\", e);\n  throw e;\n}","preventionTips":["Create the target folder in job setup before moving files","Clear or uniquify filename collisions in the target","Verify rename permissions on both folders"],"tags":["ftps","file-move","rename"],"backgroundTag":"file-not-found","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}