aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJP Dillingham <jp@dillingham.me>2026-08-23 18:08:06 -0500
committerJP Dillingham <jp@dillingham.me>2026-08-23 18:08:06 -0500
commit8133ee872bfe07e859fc09bf6ea7062c08249ecb (patch)
treef42d10865a1325218fbc5a57064d371a46821be0 /src
parent91ad4826bbd0d89f69276ea0789e1498f2a92801 (diff)
downloadslskd-8133ee872bfe07e859fc09bf6ea7062c08249ecb.tar.gz
docs for GetFileContents
Diffstat (limited to 'src')
-rw-r--r--src/slskd/Files/FileService.cs10
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));