本文整理汇总了C#中ArchiveFormat类的典型用法代码示例。如果您正苦于以下问题:C# ArchiveFormat类的具体用法?C# ArchiveFormat怎么用?C# ArchiveFormat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArchiveFormat类属于命名空间,在下文中一共展示了ArchiveFormat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PscxSevenZipExtractor
internal PscxSevenZipExtractor(PscxCmdlet command, FileInfo file, bool passThru, ArchiveFormat format) :
base(command, file, format)
{
_passThru = passThru;
_entries = new List<ArchiveEntry>();
foreach (ArchiveEntry entry in this){
_entries.Add(entry);
}
}
示例2: Archive
// Archive object for creation
public Archive(ArchiveFormat format, string filename)
{
// Set up information
Name = null;
Extension = null;
Filename = filename;
Format = format;
InitalizePacker();
}
示例3: ArchiveEntry
internal ArchiveEntry(IArchiveEntry archiveEntry, string archivePath, ArchiveFormat archiveFormat)
{
Index = (uint) archiveEntry.Index;
Path = archiveEntry.FilePath;
Size = (ulong)archiveEntry.Size;
Name = System.IO.Path.GetFileName(archiveEntry.FilePath);
CompressedSize = 0; // Not supported in SevenZipSharp (yet)
ModifiedDate = archiveEntry.LastModifiedTime.GetValueOrDefault ();
IsEncrypted = archiveEntry.IsEncrypted;
IsFolder = archiveEntry.IsDirectory;
ArchivePath = archivePath;
Format = archiveFormat;
CRC = archiveEntry.Crc;
UnderlyingObject = archiveEntry;
}
示例4: GetArchiveLinkRequest
public GetArchiveLinkRequest(string accountName, string repositoryName, Revision revision, ArchiveFormat format = ArchiveFormat.Zipball)
{
#region Preconditions
if (accountName == null)
throw new ArgumentNullException(nameof(accountName));
if (repositoryName == null)
throw new ArgumentNullException(nameof(repositoryName));
#endregion
AccountName = accountName;
RepositoryName = repositoryName;
Revision = revision;
Format = format;
}
示例5: GetArchive
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <param name="timeout"> Time span until timeout </param>
/// <returns>The binary contents of the archive</returns>
public IObservable<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, TimeSpan timeout)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.GreaterThanZero(timeout, "timeout");
return _client.Repository.Content.GetArchive(owner, name, archiveFormat, reference, timeout).ToObservable();
}
示例6: GetArchiveLink
public IObservable<string> GetArchiveLink(string owner, string name, ArchiveFormat archiveFormat, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return _client.Repository.Content.GetArchiveLink(owner, name, archiveFormat, reference).ToObservable();
}
示例7: RepositoryArchiveLink
public static Uri RepositoryArchiveLink(string owner, string name, ArchiveFormat archiveFormat, string reference)
{
return "repos/{0}/{1}/{2}/{3}".FormatUri(owner, name, archiveFormat.ToParameter(), reference);
}
示例8: GetArchive
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <param name="timeout"> Time span until timeout </param>
/// <returns>The binary contents of the archive</returns>
public async Task<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference, TimeSpan timeout)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
Ensure.GreaterThanZero(timeout, "timeout");
var endpoint = ApiUrls.RepositoryArchiveLink(owner, name, archiveFormat, reference);
var response = await Connection.Get<byte[]>(endpoint, timeout).ConfigureAwait(false);
return response.Body;
}
示例9: GetArchiveLink
/// <summary>
/// This method will return a 302 to a URL to download a tarball or zipball archive for a repository.
/// Please make sure your HTTP framework is configured to follow redirects or you will need to use the
/// Location header to make a second GET request.
/// Note: For private repositories, these links are temporary and expire quickly.
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <returns></returns>
public Task<string> GetArchiveLink(string owner, string name, ArchiveFormat archiveFormat, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
return ApiConnection.GetRedirect(ApiUrls.RepositoryArchiveLink(owner, name, archiveFormat, reference));
}
示例10: GetArchive
/// <summary>
/// Get an archive of a given repository's contents, in a specific format
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="repositoryId">The Id of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <param name="timeout"> Time span until timeout </param>
public async Task<byte[]> GetArchive(int repositoryId, ArchiveFormat archiveFormat, string reference, TimeSpan timeout)
{
Ensure.ArgumentNotNull(reference, "reference");
Ensure.GreaterThanZero(timeout, "timeout");
var endpoint = ApiUrls.RepositoryArchiveLink(repositoryId, archiveFormat, reference);
var response = await Connection.Get<byte[]>(endpoint, timeout).ConfigureAwait(false);
return response.Body;
}
示例11: LuciArchive
public LuciArchive(ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, EncryptionScheme scheme, LpkInfo info)
: base(arc, impl, dir)
{
Info = info;
Scheme = scheme;
}
示例12: DxArchive
public DxArchive(ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, byte[] key)
: base(arc, impl, dir)
{
Key = key;
}
示例13: GetArchiveLinkRequest
public GetArchiveLinkRequest(string userName, string nameOfRepository, ArchiveFormat formatOfArchive, string @ref)
: base(string.Format("/repos/{0}/{1}/{2}/{3}", userName, nameOfRepository, formatOfArchive.ToString().ToLower(), @ref))
{
}
示例14: AzArchive
public AzArchive(ArcView arc, ArchiveFormat impl, ICollection<Entry> dir, uint syskey, uint regkey)
: base(arc, impl, dir)
{
SysenvKey = syskey;
RegularKey = regkey;
}
示例15: GetArchive
/// <summary>
/// Get an archive of a given repository's contents, using a specific format and reference
/// </summary>
/// <remarks>https://developer.github.com/v3/repos/contents/#get-archive-link</remarks>
/// <param name="owner">The owner of the repository</param>
/// <param name="name">The name of the repository</param>
/// <param name="archiveFormat">The format of the archive. Can be either tarball or zipball</param>
/// <param name="reference">A valid Git reference.</param>
/// <returns>The binary contents of the archive</returns>
public async Task<byte[]> GetArchive(string owner, string name, ArchiveFormat archiveFormat, string reference)
{
Ensure.ArgumentNotNullOrEmptyString(owner, "owner");
Ensure.ArgumentNotNullOrEmptyString(name, "name");
var endpoint = ApiUrls.RepositoryArchiveLink(owner, name, archiveFormat, reference);
var response = await Connection.Get<byte[]>(endpoint, TimeSpan.FromMinutes(60));
return response.Body;
}