-
Notifications
You must be signed in to change notification settings - Fork 0
Solid.Http.Extensions.SharpCompress Initialization
HX-Rd edited this page May 30, 2018
·
11 revisions
HXRd.Solid.Http.Extensions.SharpCompress is designed to work with Solid.Http and Solid.Http.Core.
-
ReaderOptionsThis is theSharpCompress.Readers.ReaderOptionsand will be used when the archives are constructed -
TarArchivesAreGzipedIt's so common that when we are working with tars, we have a compressed tar, tar.gz. So the default is that if the requested archive is aTarAchiveit's assumed that it is a tar.gz. However you can change this default behavior when working with plain tar by setting this property tofalse -
useDefaultMimeTypesSeeMimeTypeshere below for the default mimetype list. If this is set to false, there are no default mimetypes. If this is property is set to false, make sure to include at least one mimetype in theMimeTypelist or you will get an error. -
MimeTypesThe mimetypes that are associated with the extension. If the mimetypes are encountered, the extension will try to create the requested Archive. There are some default mimetypes that are provided by default. These are
"application/zip",
"application/x-rar-compressed",
"application/x-tar",
"application/x-7z-compressed"public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddSolidHttpCore()
.AddSharpCompress();
}
}public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddSolidHttpCore()
.AddSharpCompress(
new SharpCompressOptions(
options: new ReaderOptions
{
LookForHeader = false
},
mimeTypes: new List<string>()
{
"application/octet-stream"
},
useDefaultMimeTypes: false,
tarArchivesAreGziped: false
)
);
}
}public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddSolidHttp()
.AddSharpCompress();
}
}public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services
.AddSolidHttp()
.AddSharpCompress(
new SharpCompressOptions(
options: new ReaderOptions
{
LookForHeader = false
},
mimeTypes: new List<string>()
{
"application/octet-stream"
},
useDefaultMimeTypes: false,
tarArchivesAreGziped: false
)
);
}
}