pentaho/pentaho-kettle · error · KettleException

failed to check isFile in setPath()

Error message

failed to check isFile in setPath()

What it means

SelectionAdapterFileDialog.setPath checks fileObject.isFile() to decide whether to set the path on the FileDialogOperation. If the Apache VFS call throws FileSystemException (e.g. VFS cannot stat the file), it is wrapped in a KettleException 'failed to check isFile in setPath()'.

Solutions

  1. Read the wrapped FileSystemException cause to identify the VFS resolution problem and fix the URI/credentials.
  2. Verify the remote resource (network share/SFTP host) is reachable and credentials are valid before browsing.
  3. Re-resolve the FileObject freshly instead of reusing a cached one from an earlier listing.
  4. Catch the KettleException in the caller (constructFileDialogOperation path) and fall back to setting the raw filePath without the isFile check.

Example fix

// before
fileDialogOperation.setPath( fileObject.isFile() ? filePath : null );
// after
try {
  fileDialogOperation.setPath( fileObject.isFile() ? filePath : filePath );
} catch ( FileSystemException fse ) {
  fileDialogOperation.setPath( filePath );
}
Defensive patterns

Strategy: try-catch

Validate before calling

// ensure the VFS object can be resolved before isFile checks
boolean resolvable;
try {
  resolvable = fileObject.getContent() != null;
} catch ( FileSystemException e ) {
  resolvable = false;
}

Type guard

boolean fileObjectReadable( FileObject fo ) {
  try {
    return fo != null && fo.getType().hasChildren() != null;
  } catch ( FileSystemException e ) {
    return false;
  }
}

Try / catch

try {
  setPath( op, fileObject, filePath );
} catch ( KettleException e ) {
  logError( "VFS isFile check failed; defaulting path", e );
  op.setPath( filePath );
}

Prevention

When it happens

Trigger: Selecting a file in a file dialog backed by a VFS FileObject whose isFile() probe fails — network drive disconnected, inaccessible SFTP/HTTP resource, stale file handle, or unsupported/invalid VFS URI.

Common situations: Browsing files over SFTP/S3/HTTP VFS and the remote becomes unreachable; file deleted between listing and selection; wrong VFS scheme (e.g. malformed sftp:// URL) producing an unresolvable FileObject.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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

Appendix: source

Thrown at ui/src/main/java/org/pentaho/di/ui/core/events/dialog/SelectionAdapterFileDialog.java:243

      case SAVE:
        return new FileDialogOperation( bowl, FileDialogOperation.SAVE, FileDialogOperation.ORIGIN_SPOON );
      case SAVE_TO:
        return new FileDialogOperation( bowl, FileDialogOperation.SAVE_TO, FileDialogOperation.ORIGIN_SPOON );
      case SAVE_TO_FILE_FOLDER:
        return new FileDialogOperation( bowl, FileDialogOperation.SAVE_TO_FILE_FOLDER, FileDialogOperation.ORIGIN_SPOON );
      case OPEN:
        return new FileDialogOperation( bowl, FileDialogOperation.OPEN, FileDialogOperation.ORIGIN_SPOON );
      default:
        throw new IllegalArgumentException( "Unexpected SelectionOperation: " + selectionOperation );
    }

  }

  void setPath( FileDialogOperation fileDialogOperation, FileObject fileObject, String filePath ) throws KettleException {
    try {
      fileDialogOperation.setPath( fileObject.isFile() ? filePath : null  );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setPath()", fse );
    }
  }

  void setFilename( FileDialogOperation fileDialogOperation, FileObject fileObject ) throws KettleException {
    try {
      fileDialogOperation.setFilename( fileObject.isFile() ? fileObject.getName().getBaseName() : null );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setFilename()", fse );
    }
  }

  void setStartDir( FileDialogOperation fileDialogOperation, FileObject fileObject, String filePath ) throws KettleException {
    try {
      fileDialogOperation.setStartDir( fileObject.isFolder() ? filePath : null );
    } catch ( FileSystemException fse ) {
      throw new KettleException( "failed to check isFile in setStartDir()", fse );
    }
  }

View on GitHub (pinned to f3058517a1)