{"record":{"id":"fe582541cda616e4","repo":"pentaho/pentaho-kettle","slug":"purrepository-invalidrepositorydirectory","errorCode":"PurRepository.invalidRepositoryDirectory","errorMessage":"PurRepository.invalidRepositoryDirectory","messagePattern":"PurRepository\\.invalidRepositoryDirectory","errorType":"error_code","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java","lineNumber":409,"sourceCode":"\n  @Override public int countNrStepAttributes( ObjectId idStep, String code ) throws KettleException {\n    // implemented by RepositoryProxy\n    throw new UnsupportedOperationException();\n  }\n\n  @Override\n  public RepositoryDirectoryInterface createRepositoryDirectory( final RepositoryDirectoryInterface parentDirectory,\n                                                                 final String directoryPath ) throws KettleException {\n    // allow new folders only inside Home and Public directory, else - provide UI message\n    try {\n      // if parentDirectory is root then we have to check if the defined directory is valid ( only Public and Home folders are allowed )\n      if ( parentDirectory.isRoot()\n        &&\n          ( directoryPath.equals( Import.ROOT_DIRECTORY )\n            ||\n          ( !directoryPath.startsWith( Import.HOME_DIRECTORY ) && !directoryPath.startsWith( Import.PUBLIC_DIRECTORY ) )\n          ) ) {\n        throw new KettleException( BaseMessages.getString( PKG, \"PurRepository.invalidRepositoryDirectory\", directoryPath ) );\n      }\n\n      RepositoryDirectoryInterface refreshedParentDir = findDirectory( parentDirectory.getPath() );\n\n      // update the passed in repository directory with the children recently loaded from the repo\n      parentDirectory.setChildren( refreshedParentDir.getChildren() );\n      String[] path = Const.splitPath( directoryPath, RepositoryDirectory.DIRECTORY_SEPARATOR );\n\n      RepositoryDirectoryInterface follow = parentDirectory;\n\n      for ( int level = 0; level < path.length; level++ ) {\n        RepositoryDirectoryInterface child = follow.findChild( path[level] );\n        if ( child == null ) {\n          // create this one\n          child = new RepositoryDirectory( follow, path[level] );\n          saveRepositoryDirectory( child );\n          // link this with the parent directory\n          follow.addSubdirectory( child );","sourceCodeStart":391,"sourceCodeEnd":427,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pur/core/src/main/java/org/pentaho/di/repository/pur/PurRepository.java#L391-L427","documentation":"PurRepository.createRepositoryDirectory validates that a directory created directly under the repository root is either the special /home or /public subtree; anything else at root level is rejected with a localized KettleException keyed by PurRepository.invalidRepositoryDirectory.","triggerScenarios":"Calling repository.createRepositoryDirectory(rootDir, dir) where dir's path does not start with /home or /public and the parent is the root — e.g. creating \"/myfolder\" at the repository root.","commonSituations":"Scripts or integrations that mimic the file-repository convention and create arbitrary top-level folders; migrating directory trees that have root-level folders not valid in the PUR (enterprise) repository layout.","solutions":["Create new folders under /home/<user> or /public instead of the repository root.","Change directoryPath to start with Import.HOME_DIRECTORY (\"/home\") or Import.PUBLIC_DIRECTORY (\"/public\").","If a root-level folder is genuinely needed, create it via the Pentaho User Console / JCR admin tooling, not this API."],"exampleFix":"// before\nrepo.createRepositoryDirectory(rootDir, new RepositoryDirectory(rootDir, \"myfolder\"));\n// after\nRepositoryDirectory pub = repo.findDirectory(Import.PUBLIC_DIRECTORY);\nrepo.createRepositoryDirectory(pub, new RepositoryDirectory(pub, \"myfolder\"));","handlingStrategy":"validation","validationCode":"boolean ok = path.startsWith(\"/home/\") || path.startsWith(\"/public/\"); if (parent.isRoot() && !ok) throw new IllegalArgumentException(\"root-level folders must be under /home or /public: \" + path);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never create folders directly under the repository root","Anchor all new folders under /home or /public","Mirror the Import.HOME_DIRECTORY/Import.PUBLIC_DIRECTORY constants"],"tags":["pentaho","repository","directory"],"backgroundTag":"invalid-argument-value","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"}