Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
295613c
Add tests that verify we handle unseekable streams correctly.
carlossanlop Apr 3, 2023
d627497
Add expected data field locations for all supported formats.
carlossanlop Apr 3, 2023
018f709
Add exception message for when attempting to write an unseekable data…
carlossanlop Apr 3, 2023
9092cb4
Add seekability validation in public TarWriter entry writing methods.
carlossanlop Apr 3, 2023
6c460eb
Add TarFile stream roundtrip tests for unseekable streams.
carlossanlop Apr 4, 2023
6ea8e0f
Add missing async TarFile roundtrip tests.
carlossanlop Apr 4, 2023
f87b9e9
Support unseekable streams in TarHeader.Write.
carlossanlop Apr 4, 2023
e94fefb
Reuse and simplify the code.
carlossanlop Apr 4, 2023
15523ac
More reuse, remove unused and not needed.
carlossanlop Apr 4, 2023
5979be9
Remove TarFile.CreateFromDirectoryAsync.File.Roundtrip.cs. Submit it …
carlossanlop Apr 4, 2023
b702a44
Remove unnecessary resx comments.
carlossanlop May 23, 2023
625a619
Dedicated method for writing fields to buffer depending on the format.
carlossanlop May 23, 2023
4f702c4
Specify `Data` in name of method that expects unseekable data stream.…
carlossanlop May 23, 2023
0054f99
Delete unnecessary method.
carlossanlop May 23, 2023
2fc23de
Rename WritePadding to WriteEmptyPadding
carlossanlop May 23, 2023
d81b5a8
Rename test variables
carlossanlop May 24, 2023
796d542
Merge identical test arrays into one
carlossanlop May 24, 2023
94157b0
Invert if else to be more clear about conditions
carlossanlop May 24, 2023
1557885
remove size assign comment
carlossanlop May 24, 2023
943988b
Remove redundant debug assert
carlossanlop May 24, 2023
abff5c0
Async padding byte array creation simplification
carlossanlop May 24, 2023
66dc094
Apply suggestions from code review
adamsitnik May 25, 2023
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 exception message for when attempting to write an unseekable data…
… stream into an unseekable archive stream.
  • Loading branch information
carlossanlop committed May 23, 2023
commit 018f709561c9bba5db5cd468f7072fc84f43ec92
59 changes: 31 additions & 28 deletions src/libraries/System.Formats.Tar/src/Resources/Strings.resx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
<!--
Microsoft ResX Schema

Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes

The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.

Example:

... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
Expand All @@ -26,36 +26,36 @@
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple

There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the

Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not

The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can

Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.

mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.

mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
Expand Down Expand Up @@ -270,4 +270,7 @@
<data name="TarExtAttrDisallowedValueChar" xml:space="preserve">
<value>The value of the extended attribute key '{0}' contains a disallowed '{1}' character.</value>
</data>
</root>
<data name="TarStreamSeekabilityUnsupportedCombination" xml:space="preserve">
<value>Cannot write the unseekable data stream of entry '{0}' into an unseekable archive stream.</value>
</data>
</root>