{"record":{"id":"2515df60bc95e1d0","repo":"pentaho/pentaho-kettle","slug":"fixedinput-log-onlylocalfilesaresupported","errorCode":"FixedInput.Log.OnlyLocalFilesAreSupported","errorMessage":"FixedInput.Log.OnlyLocalFilesAreSupported","messagePattern":"FixedInput\\.Log\\.OnlyLocalFilesAreSupported","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/pentaho/di/core/vfs/KettleVFS.java","lineNumber":501,"sourceCode":"    };\n  }\n\n  /**\n   * Get a FileInputStream for a local file. Local files can be read with NIO.\n   *\n   * @param fileObject\n   * @return a FileInputStream\n   * @throws IOException\n   * @deprecated because of API change in Apache VFS. As a workaround use FileObject.getName().getPathDecoded(); Then\n   * use a regular File() object to create a File Input stream.\n   */\n  @Deprecated\n  public static FileInputStream getFileInputStream( FileObject fileObject ) throws IOException {\n\n    if ( !( fileObject instanceof LocalFile ) ) {\n      // We can only use NIO on local files at the moment, so that's what we limit ourselves to.\n      //\n      throw new IOException( BaseMessages.getString( PKG, \"FixedInput.Log.OnlyLocalFilesAreSupported\" ) );\n    }\n\n    return new FileInputStream( fileObject.getName().getPathDecoded() );\n  }\n\n  /**\n   * Check if filename starts with one of the known protocols like file: zip: ram: smb: jar: etc.\n   * If yes, return true otherwise return false\n   *\n   * @param vfsFileName\n   * @return boolean\n   */\n  public static boolean startsWithScheme( String vfsFileName ) {\n    FileSystemManager fsManager = getInstance().getFileSystemManager();\n\n    boolean found = false;\n    String[] schemes = fsManager.getSchemes();\n    for (int i = 0; i < schemes.length; i++) {","sourceCodeStart":483,"sourceCodeEnd":519,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/core/src/main/java/org/pentaho/di/core/vfs/KettleVFS.java#L483-L519","documentation":"The deprecated KettleVFS.getFileInputStream(FileObject) only works on local files because it relies on NIO FileInputStream; if the VFS FileObject is not a commons-vfs LocalFile (e.g. SFTP, HTTP, S3, or a compressed archive entry), it throws an IOException carrying the localized message key FixedInput.Log.OnlyLocalFilesAreSupported.","triggerScenarios":"Calling KettleVFS.getFileInputStream on a FileObject obtained from a non-local scheme (sftp://, http://, s3://, zip:..., etc.) — typically via the Fixed Input step or code reading a remote/virtual file with this legacy API.","commonSituations":"Migrating a transformation that previously read local files to a remote source; pointing the Fixed Input step at an SFTP or HDFS URL; passing an archive entry (zip:file:///x.zip!/inner.csv) where a plain local path was expected.","solutions":["Copy/download the remote file to a local temp path first, then open it locally.","Read the FileObject content generically: fileObject.getContent().getInputStream() instead of the deprecated method.","Use KettleVFS.getInputStream(FileObject) / the non-deprecated API which supports any VFS scheme.","If the file must be local, verify the filename has no scheme or archive prefix."],"exampleFix":"// before\nInputStream in = KettleVFS.getFileInputStream(KettleVFS.getFileObject(\"sftp://host/data.csv\", space));\n// after\nInputStream in = KettleVFS.getInputStream(KettleVFS.getFileObject(\"sftp://host/data.csv\", space));","handlingStrategy":"type-guard","validationCode":"if (!(fileObject instanceof org.apache.commons.vfs2.provider.local.LocalFile)) {\n  // use generic content input stream instead\n}","typeGuard":"boolean isLocalFile(FileObject fo) { return fo instanceof org.apache.commons.vfs2.provider.local.LocalFile; }","tryCatchPattern":"try {\n  in = KettleVFS.getFileInputStream(fo);\n} catch (IOException e) {\n  if (e.getMessage().contains(\"OnlyLocalFilesAreSupported\")) {\n    in = fo.getContent().getInputStream(); // generic VFS fallback\n  } else throw e;\n}","preventionTips":["Avoid the deprecated getFileInputStream; use KettleVFS.getInputStream for all schemes.","Check the URI scheme before choosing an I/O strategy.","Download remote files to a temp dir when NIO semantics are required."],"tags":["vfs","io","unsupported-operation","local-files"],"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"}