JDBC Driver for GitHub

Build 25.0.9434

DownloadFile

Enables downloading specific files from a repository, facilitating local inspection or offline use.

Sample

The 'Path' parameter is required, and must be relative to the repository root without a preceding '/'.

EXECUTE [Repository_MyRepository].[DownloadFile] LocalPath = '/tmp/file.txt', Branch = 'main', Path = 'ReadMe.md'

Alternatively, set the connection property Schema to the desired repository.

EXECUTE [DownloadFile] LocalPath = 'C:/Users/CData/Desktop/file.txt', Branch = 'main', Path = 'src/Main.java'

Input

Name Type Accepts Output Streams Description
Path String False The relative file path from the root of the repository.
Branch String False The name of the branch from which to download the file. Defaults to 'main' if not specified.

The default value is main.

LocalPath String False The absolute local path where the file is saved once downloaded.
OutputStream Binary True An instance of an output stream to which the file data is written. This is used only if the LocalPath is not provided.

Result Set Columns

Name Type Description
Success Boolean Indicates whether the operation completed successfully (true or false).
Details String Additional information or status about the execution of the operation.
FileData String The content of the file in BASE64 format, output only if both LocalPath and OutputStream are not specified.

Copyright (c) 2025 CData Software, Inc. - All rights reserved.
Build 25.0.9434