pentaho/pentaho-kettle · error · ContentIOException

Not File nor directory.

Error message

Not File nor directory.

What it means

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.

Solutions

  1. Verify the child resource actually exists before calling getEntry (use getEntryNames()/exists on the location).
  2. Check the path/name spelling and that the output directory pointed to by the step settings exists.
  3. If the child may legitimately be absent, catch ContentIOException and treat it as 'not found' to create the entry instead.

Example fix

// before
ContentItem item = location.getEntry("report.prpt");
// after
if (location.exists() && Arrays.asList(location.getEntryNames()).contains(NameBase.getFileName("report.prpt"))) {
  ContentItem item = location.getEntry("report.prpt");
} else {
  ContentItem item = location.createItem("report.prpt");
}
Defensive patterns

Strategy: try-catch

Validate before calling

boolean exists = location != null && location.exists()
    && Arrays.asList(location.getEntryNames()).contains(entryName);

Try / catch

try {
  ContentItem item = location.getEntry(name);
} catch (ContentIOException e) {
  // treat as not-found: check cause 'Not File nor directory.' and create or skip
}

Prevention

When it happens

Trigger: Calling getEntry(name) when the resolved FileObject neither isFile() nor isFolder() — typically when the named child does not exist in the backing filesystem.

Common situations: 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.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of pentaho/pentaho-kettle@f3058517a1 (2026-09-13). Data as JSON: /api/errors/ef6ae1a02a6357b3. Report an issue: GitHub.

Appendix: source

Thrown at plugins/pentaho-reporting/impl/src/main/java/org/pentaho/di/trans/steps/pentahoreporting/urlrepository/FileObjectContentLocation.java:132

   */
  public ContentEntity getEntry( final String name ) throws ContentIOException {
    try {
      if ( RepositoryUtilities.isInvalidPathName( name ) ) {
        throw new IllegalArgumentException( "The name given is not valid." );
      }

      final FileObject file = getBackend();
      final FileObject child = file.resolveFile( name );
      if ( child.exists() == false ) {
        throw new ContentIOException( "Not found:" + child );
      }

      if ( child.isFolder() ) {
        return new FileObjectContentLocation( this, child );
      } else if ( child.isFile() ) {
        return new FileObjectContentItem( this, child );
      } else {
        throw new ContentIOException( "Not File nor directory." );
      }
    } catch ( FileSystemException e ) {
      throw new RuntimeException( e );
    }
  }

  /**
   * Creates a new data item in the current location. This method must never return null. This method will fail if an
   * entity with the same name exists in this location.
   *
   * @param name the name of the new entity.
   * @return the newly created entity, never null.
   * @throws ContentCreationException if the item could not be created.
   */
  public ContentItem createItem( final String name ) throws ContentCreationException {
    String fileName = new File( name ).getName();
    if ( RepositoryUtilities.isInvalidPathName( fileName ) ) {
      throw new IllegalArgumentException( "The name given is not valid." );

View on GitHub (pinned to f3058517a1)