diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-08-23 18:08:06 -0500 |
|---|---|---|
| committer | JP Dillingham <jp@dillingham.me> | 2026-08-23 18:08:06 -0500 |
| commit | 8133ee872bfe07e859fc09bf6ea7062c08249ecb (patch) | |
| tree | f42d10865a1325218fbc5a57064d371a46821be0 | |
| parent | 91ad4826bbd0d89f69276ea0789e1498f2a92801 (diff) | |
| download | slskd-8133ee872bfe07e859fc09bf6ea7062c08249ecb.tar.gz | |
docs for GetFileContents
| -rw-r--r-- | src/slskd/Files/FileService.cs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/slskd/Files/FileService.cs b/src/slskd/Files/FileService.cs index a78d4dd4..c100c7e9 100644 --- a/src/slskd/Files/FileService.cs +++ b/src/slskd/Files/FileService.cs @@ -365,6 +365,16 @@ namespace slskd.Files }); } + /// <summary> + /// Retrieves the contents of the specified <paramref name="filename"/> as a stream. + /// </summary> + /// <param name="filename">The file for which contents are to be retrieved.</param> + /// <returns>A Stream containing the contents of the file.</returns> + /// <exception cref="ArgumentNullException">Thrown if the specified filename is null or contains only whitespace.</exception> + /// <exception cref="ArgumentException">Thrown if the specified filename contains path traversal segments.</exception> + /// <exception cref="UnauthorizedException">Thrown if the specified file is not within an allowed directory.</exception> + /// <exception cref="NotFoundException">Thrown if the specified file does not exist.</exception> + /// <exception cref="IOException">Thrown if the file can't be opened for some reason.</exception> public virtual Stream GetFileContents(string filename) { ArgumentNullException.ThrowIfNullOrWhiteSpace(filename, nameof(filename)); |
