{"record":{"id":"f94251344835c16d","repo":"pentaho/pentaho-kettle","slug":"connectionfileobject-pvfsroot-unsupportedoperation","errorCode":"ConnectionFileObject.PVFSRoot.UnsupportedOperation","errorMessage":"ConnectionFileObject.PVFSRoot.UnsupportedOperation","messagePattern":"ConnectionFileObject\\.PVFSRoot\\.UnsupportedOperation","errorType":"exception","errorClass":"KettleVFSFileSystemException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/connections/vfs/provider/PvfsRootFileObject.java","lineNumber":46,"sourceCode":"class PvfsRootFileObject extends ConnectionFileObject {\n  public PvfsRootFileObject( @NonNull ConnectionFileName name, @NonNull ConnectionFileSystem fs ) {\n    super( name, fs );\n\n    if ( !name.isPvfsRoot() ) {\n      throw new IllegalArgumentException( \"Argument 'name' is not the PVFS root.\" );\n    }\n  }\n\n  @Override\n  @Nullable\n  public FileObject getResolvedFileObject() {\n    return null;\n  }\n\n  @Override\n  @NonNull\n  protected AbstractFileObject<?> requireResolvedFileObject() throws FileSystemException {\n    throw new KettleVFSFileSystemException( \"ConnectionFileObject.PVFSRoot.UnsupportedOperation\" );\n  }\n\n  @Override\n  public FileType getType() throws FileSystemException {\n    return FileType.FOLDER;\n  }\n\n  @Override\n  public boolean isAttached() {\n    return true;\n  }\n\n  @Override\n  public boolean isExecutable() throws FileSystemException {\n    return false;\n  }\n\n  @Override","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/connections/vfs/provider/PvfsRootFileObject.java#L28-L64","documentation":"PvfsRootFileObject is the root folder object of a Kettle connection-based VFS filesystem. The root pseudo-file does not wrap any real resolved file, so calling requireResolvedFileObject() — the internal operation that returns the concrete underlying AbstractFileObject — always throws KettleVFSFileSystemException with code ConnectionFileObject.PVFSRoot.UnsupportedOperation. It signals that the requested operation is not meaningful on the PVFS root itself.","triggerScenarios":"Calling any VFS file operation on the root of a connection-based filesystem (e.g. resolving 'pvfs:///' or the connection root name and then invoking doRename, doDelete, getContent, or similar methods that internally call requireResolvedFileObject on the root object).","commonSituations":"Code that iterates a VFS tree and mistakenly treats the root as a regular file; attempting to read/write/rename/delete the root of a named connection; generic VFS tooling that assumes every AbstractFileObject has a resolved backing file.","solutions":["Stop operating on the PVFS root; resolve a child path beneath the connection root instead","Check FileType first — getType() returns FOLDER for the root — and skip non-regular folders for read/write operations","Wrap the call in try-catch for KettleVFSFileSystemException and handle the root case explicitly"],"exampleFix":"// before\nFileObject root = KettleVFS.getFileObject(\"pvfs:myconnection\");\nInputStream in = root.getContent().getInputStream(); // throws\n// after\nFileObject root = KettleVFS.getFileObject(\"pvfs:myconnection\");\nif (root.getType() == FileType.FOLDER) {\n  FileObject child = root.resolveFile(\"data.csv\");\n  InputStream in = child.getContent().getInputStream();\n}","handlingStrategy":"type-guard","validationCode":"if (fileObject instanceof PvfsRootFileObject || fileObject.getName().getURI().equals(\"pvfs:/\")) { skipReadWriteOperations(); }","typeGuard":"boolean isPvfsRoot(FileObject fo) { return fo != null && \"pvfs\".equals(fo.getName().getScheme()) && fo.getParent() == null; }","tryCatchPattern":"try { requireResolvedFileObject(); } catch (KettleVFSFileSystemException e) { if (\"ConnectionFileObject.PVFSRoot.UnsupportedOperation\".equals(e.getCode())) { /* handle root case */ } else { throw e; } }","preventionTips":["Never perform read/write/delete/rename on a VFS root object","Check getType() (FOLDER for root) before file-content operations","Resolve concrete child paths beneath the connection root"],"tags":["vfs","unsupported-operation","pentaho-kettle"],"backgroundTag":"unsupported-operation","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"}