{"record":{"id":"c103dbc8468f3ae2","repo":"pentaho/pentaho-kettle","slug":"append-file-in-repository-is-not-possible","errorCode":null,"errorMessage":"Append file in repository is not possible","messagePattern":"Append file in repository is not possible","errorType":"exception","errorClass":"NotImplementedException","httpStatus":null,"severity":"error","filePath":"plugins/pentaho-repository-vfs/core/src/main/java/org/pentaho/repositoryvfs/vfs/RepositoryVfsFileContent.java","lineNumber":120,"sourceCode":"      return null;\n    }\n  }\n\n  @Override\n  public OutputStream getOutputStream() throws FileSystemException {\n    IUnifiedRepository repo = source.provider.getRepo().getUnderlyingRepository();\n    return new RepositoryFileOutputStream( source.path, false, false, repo, false );\n  }\n\n  @Override\n  public RandomAccessContent getRandomAccessContent( RandomAccessMode mode ) throws FileSystemException {\n    throw new NotImplementedException( \"Random access to file in repository is not possible\" );\n  }\n\n  @Override\n  public OutputStream getOutputStream( boolean bAppend ) throws FileSystemException {\n    if ( bAppend ) {\n      throw new NotImplementedException( \"Append file in repository is not possible\" );\n    } else {\n      return getOutputStream();\n    }\n  }\n\n  @Override\n  public void close() throws FileSystemException {\n    throw new NotImplementedException();\n  }\n\n  @Override\n  public FileContentInfo getContentInfo() throws FileSystemException {\n    throw new NotImplementedException();\n  }\n\n  @Override\n  public boolean isOpen() {\n    throw new NotImplementedException();","sourceCodeStart":102,"sourceCodeEnd":138,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/plugins/pentaho-repository-vfs/core/src/main/java/org/pentaho/repositoryvfs/vfs/RepositoryVfsFileContent.java#L102-L138","documentation":"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().","triggerScenarios":"commons-vfs resolving an output stream with append semantics — calling getOutputStream(RandomAccessMode/append=true) or code that opens repo:// files in append mode.","commonSituations":"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.","solutions":["Open the file in overwrite mode (append=false).","Read existing content, rewrite the full (old + new) content with overwrite.","Use a versioned set of files instead of appending to one repository file.","Redirect append-style output to a local file and upload the final result."],"exampleFix":"// before\nOutputStream out = fileObject.getContent().getOutputStream(true); // append\n// after\nOutputStream out = fileObject.getContent().getOutputStream(); // overwrite mode\n// or: read old content, concatenate, write once in overwrite mode","handlingStrategy":"validation","validationCode":"if (uri.startsWith(\"repo://\") && appendMode) {\n  throw new IllegalArgumentException(\"repo:// does not support append; use overwrite\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  out = content.getOutputStream(append);\n} catch (NotImplementedException e) {\n  out = content.getOutputStream(); // overwrite fallback\n}","preventionTips":["Always open repository files in overwrite mode.","Rewrite full content (old + appended) in one pass instead of appending.","Route append-style logging to local files, then upload once."],"tags":["vfs","repository","append","unsupported-operation"],"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"}