pentaho/pentaho-kettle · error · NotImplementedException

Append file in repository is not possible

Error message

Append file in repository is not possible

What it means

RepositoryVfsFileContent.getOutputStream(bAppend) throws NotImplementedException when bAppend is true, because the underlying unified repository output stream cannot append to existing repository files. Append false delegates to the normal getOutputStream().

Solutions

  1. Open the file in overwrite mode (append=false).
  2. Read existing content, rewrite the full (old + new) content with overwrite.
  3. Use a versioned set of files instead of appending to one repository file.
  4. Redirect append-style output to a local file and upload the final result.

Example fix

// before
OutputStream out = fileObject.getContent().getOutputStream(true); // append
// after
OutputStream out = fileObject.getContent().getOutputStream(); // overwrite mode
// or: read old content, concatenate, write once in overwrite mode
Defensive patterns

Strategy: validation

Validate before calling

if (uri.startsWith("repo://") && appendMode) {
  throw new IllegalArgumentException("repo:// does not support append; use overwrite");
}

Try / catch

try {
  out = content.getOutputStream(append);
} catch (NotImplementedException e) {
  out = content.getOutputStream(); // overwrite fallback
}

Prevention

When it happens

Trigger: commons-vfs resolving an output stream with append semantics — calling getOutputStream(RandomAccessMode/append=true) or code that opens repo:// files in append mode.

Common situations: Log-style or incremental writers appending to repo:// files; frameworks (e.g. some VFS-based exporters) that default to append=true when reopening existing files.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at plugins/pentaho-repository-vfs/core/src/main/java/org/pentaho/repositoryvfs/vfs/RepositoryVfsFileContent.java:120

      return null;
    }
  }

  @Override
  public OutputStream getOutputStream() throws FileSystemException {
    IUnifiedRepository repo = source.provider.getRepo().getUnderlyingRepository();
    return new RepositoryFileOutputStream( source.path, false, false, repo, false );
  }

  @Override
  public RandomAccessContent getRandomAccessContent( RandomAccessMode mode ) throws FileSystemException {
    throw new NotImplementedException( "Random access to file in repository is not possible" );
  }

  @Override
  public OutputStream getOutputStream( boolean bAppend ) throws FileSystemException {
    if ( bAppend ) {
      throw new NotImplementedException( "Append file in repository is not possible" );
    } else {
      return getOutputStream();
    }
  }

  @Override
  public void close() throws FileSystemException {
    throw new NotImplementedException();
  }

  @Override
  public FileContentInfo getContentInfo() throws FileSystemException {
    throw new NotImplementedException();
  }

  @Override
  public boolean isOpen() {
    throw new NotImplementedException();

View on GitHub (pinned to f3058517a1)