{"record":{"id":"ef6ae1a02a6357b3","repo":"pentaho/pentaho-kettle","slug":"not-file-nor-directory","errorCode":null,"errorMessage":"Not File nor directory.","messagePattern":"Not File nor directory\\.","errorType":"exception","errorClass":"ContentIOException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java","lineNumber":132,"sourceCode":"   */\n  public ContentEntity getEntry( final String name ) throws ContentIOException {\n    try {\n      if ( RepositoryUtilities.isInvalidPathName( name ) ) {\n        throw new IllegalArgumentException( \"The name given is not valid.\" );\n      }\n\n      final FileObject file = getBackend();\n      final FileObject child = file.resolveFile( name );\n      if ( child.exists() == false ) {\n        throw new ContentIOException( \"Not found:\" + child );\n      }\n\n      if ( child.isFolder() ) {\n        return new FileObjectContentLocation( this, child );\n      } else if ( child.isFile() ) {\n        return new FileObjectContentItem( this, child );\n      } else {\n        throw new ContentIOException( \"Not File nor directory.\" );\n      }\n    } catch ( FileSystemException e ) {\n      throw new RuntimeException( e );\n    }\n  }\n\n  /**\n   * Creates a new data item in the current location. This method must never return null. This method will fail if an\n   * entity with the same name exists in this location.\n   *\n   * @param name the name of the new entity.\n   * @return the newly created entity, never null.\n   * @throws ContentCreationException if the item could not be created.\n   */\n  public ContentItem createItem( final String name ) throws ContentCreationException {\n    String fileName = new File( name ).getName();\n    if ( RepositoryUtilities.isInvalidPathName( fileName ) ) {\n      throw new IllegalArgumentException( \"The name given is not valid.\" );","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java#L114-L150","documentation":"FileObjectContentLocation.getEntry resolves a child file object in the VFS-backed reporting repository and wraps it as either a ContentLocation (folder) or ContentItem (file). If the resolved child is neither folder nor file (e.g. it does not exist or is in an undefined state in commons-vfs), a ContentIOException with 'Not File nor directory.' is thrown.","triggerScenarios":"Calling getEntry(name) when the resolved FileObject neither isFile() nor isFolder() — typically when the named child does not exist in the backing filesystem.","commonSituations":"Looking up a report/resource name that was never written, a typo in the resource path, or a stale file handle after the underlying temp directory was cleaned while a Kettle pentaho-reporting output step is running.","solutions":["Verify the child resource actually exists before calling getEntry (use getEntryNames()/exists on the location).","Check the path/name spelling and that the output directory pointed to by the step settings exists.","If the child may legitimately be absent, catch ContentIOException and treat it as 'not found' to create the entry instead."],"exampleFix":"// before\nContentItem item = location.getEntry(\"report.prpt\");\n// after\nif (location.exists() && Arrays.asList(location.getEntryNames()).contains(NameBase.getFileName(\"report.prpt\"))) {\n  ContentItem item = location.getEntry(\"report.prpt\");\n} else {\n  ContentItem item = location.createItem(\"report.prpt\");\n}","handlingStrategy":"try-catch","validationCode":"boolean exists = location != null && location.exists()\n    && Arrays.asList(location.getEntryNames()).contains(entryName);","typeGuard":null,"tryCatchPattern":"try {\n  ContentItem item = location.getEntry(name);\n} catch (ContentIOException e) {\n  // treat as not-found: check cause 'Not File nor directory.' and create or skip\n}","preventionTips":["Check entry existence via getEntryNames() before getEntry.","Validate user-supplied resource names against the location listing.","Keep output directories stable for the lifetime of the transformation run."],"tags":["vfs","content-repository","resource-not-found"],"backgroundTag":"resource-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"}