Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
17fdb6e
Throw ArgumentException on unsupported tar entry type
carlossanlop Aug 30, 2022
151797a
Adjust tests
carlossanlop Aug 30, 2022
6b42246
Also change exception type for internal TarEntry conversion construct…
carlossanlop Aug 30, 2022
7b8a909
LinkName setter null check.
carlossanlop Aug 31, 2022
61010d8
Internal constructors SeekableSubReadStream and SubReadStream unseeka…
carlossanlop Aug 31, 2022
f51806e
DataStream setter for regular file should throw ArgumentException if …
carlossanlop Aug 31, 2022
0f9d96c
TarFile CreateFromDirectory unwritable destination change exception t…
carlossanlop Aug 31, 2022
5faad2c
Change to ArgumentException when ExtractToDirectory is an unreadable …
carlossanlop Aug 31, 2022
6094b2f
Add some missing exception docs for TarEntry.
carlossanlop Aug 31, 2022
2775c07
Change TarReader constructor exception if unreadable stream. Close te…
carlossanlop Aug 31, 2022
b116660
Change TarWriter exception for unwritable stream to ArgumentException…
carlossanlop Aug 31, 2022
18292b7
Add missing documentation for exceptions in constructors.
carlossanlop Aug 31, 2022
2f615e9
Change wording of conversion constructors comment when passing a Pax …
carlossanlop Aug 31, 2022
74747ea
Apply suggestions by Jozkee
carlossanlop Aug 31, 2022
3927c72
Add exception to LinkName if the entry type is hard/symlink and the u…
carlossanlop Aug 31, 2022
dd15f10
Convert all FormatException to InvalidDataException
carlossanlop Aug 31, 2022
eb4aebf
Address more suggestions
carlossanlop Aug 31, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add some missing exception docs for TarEntry.
  • Loading branch information
carlossanlop authored and github-actions committed Aug 31, 2022
commit 6094b2ff65416573516436352ee2dca89946ef38
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public int Gid
/// A timestamps that represents the last time the contents of the file represented by this entry were modified.
/// </summary>
/// <remarks>In Unix platforms, this timestamp is commonly known as <c>mtime</c>.</remarks>
/// <exception cref="ArgumentOutOfRangeException">Cannot set a value larger than <see cref="DateTimeOffset.UnixEpoch"/>.</exception>
public DateTimeOffset ModificationTime
{
get => _header._mTime;
Expand All @@ -115,6 +116,7 @@ public DateTimeOffset ModificationTime
/// When the <see cref="EntryType"/> indicates a <see cref="TarEntryType.SymbolicLink"/> or a <see cref="TarEntryType.HardLink"/>, this property returns the link target path of such link.
/// </summary>
/// <exception cref="InvalidOperationException">Cannot set the link name if the entry type is not <see cref="TarEntryType.HardLink"/> or <see cref="TarEntryType.SymbolicLink"/>.</exception>
/// <exception cref="ArgumentNullException">Cannot set a <see langword="null"/> link name.</exception>
public string LinkName
{
get => _header._linkName ?? string.Empty;
Expand Down Expand Up @@ -178,7 +180,8 @@ public int Uid
/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para>
/// <para>Symbolic links can be recreated using <see cref="File.CreateSymbolicLink(string, string)"/>, <see cref="Directory.CreateSymbolicLink(string, string)"/> or <see cref="FileSystemInfo.CreateAsSymbolicLink(string)"/>.</para>
/// <para>Hard links can only be extracted when using <see cref="TarFile.ExtractToDirectory(Stream, string, bool)"/> or <see cref="TarFile.ExtractToDirectory(string, string, bool)"/>.</para></remarks>
/// <exception cref="ArgumentException"><paramref name="destinationFileName"/> is <see langword="null"/> or empty.</exception>
/// <exception cref="ArgumentNullException"><paramref name="destinationFileName"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException"><paramref name="destinationFileName"/> is empty.</exception>
/// <exception cref="IOException"><para>The parent directory of <paramref name="destinationFileName"/> does not exist.</para>
/// <para>-or-</para>
/// <para><paramref name="overwrite"/> is <see langword="false"/> and a file already exists in <paramref name="destinationFileName"/>.</para>
Expand Down Expand Up @@ -207,7 +210,8 @@ public void ExtractToFile(string destinationFileName, bool overwrite)
/// <returns>A task that represents the asynchronous extraction operation.</returns>
/// <remarks><para>Files of type <see cref="TarEntryType.BlockDevice"/>, <see cref="TarEntryType.CharacterDevice"/> or <see cref="TarEntryType.Fifo"/> can only be extracted in Unix platforms.</para>
/// <para>Elevation is required to extract a <see cref="TarEntryType.BlockDevice"/> or <see cref="TarEntryType.CharacterDevice"/> to disk.</para></remarks>
/// <exception cref="ArgumentException"><paramref name="destinationFileName"/> is <see langword="null"/> or empty.</exception>
/// <exception cref="ArgumentNullException"><paramref name="destinationFileName"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException"><paramref name="destinationFileName"/> is empty.</exception>
/// <exception cref="IOException"><para>The parent directory of <paramref name="destinationFileName"/> does not exist.</para>
/// <para>-or-</para>
/// <para><paramref name="overwrite"/> is <see langword="false"/> and a file already exists in <paramref name="destinationFileName"/>.</para>
Expand Down Expand Up @@ -238,9 +242,8 @@ public Task ExtractToFileAsync(string destinationFileName, bool overwrite, Cance
/// <para>Sets a new stream that represents the data section, if it makes sense for the <see cref="EntryType"/> to contain data; if a stream already existed, the old stream gets disposed before substituting it with the new stream. Setting a <see langword="null"/> stream is allowed.</para></value>
/// <remarks>If you write data to this data stream, make sure to rewind it to the desired start position before writing this entry into an archive using <see cref="TarWriter.WriteEntry(TarEntry)"/>.</remarks>
/// <exception cref="InvalidOperationException">Setting a data section is not supported because the <see cref="EntryType"/> is not <see cref="TarEntryType.RegularFile"/> (or <see cref="TarEntryType.V7RegularFile"/> for an archive of <see cref="TarEntryFormat.V7"/> format).</exception>
/// <exception cref="IOException"><para>Cannot set an unreadable stream.</para>
/// <para>-or-</para>
/// <para>An I/O problem occurred.</para></exception>
/// <exception cref="ArgumentException">Cannot set an unreadable stream.</exception>
/// <exception cref="IOException">An I/O problem occurred.</exception>
public Stream? DataStream
{
get => _header._dataStream;
Expand Down