SetValueDefaults() static private method

Set defaults for values used when constructing a TarHeader instance.
static private SetValueDefaults ( int userId, string userName, int groupId, string groupName ) : void
userId int Value to apply as a default for userId.
userName string Value to apply as a default for userName.
groupId int Value to apply as a default for groupId.
groupName string Value to apply as a default for groupName.
return void
        /// <summary>
        /// Write an entry to the archive. This method will call the putNextEntry
        /// and then write the contents of the entry, and finally call closeEntry()
        /// for entries that are files. For directories, it will call putNextEntry(),
        /// and then, if the recurse flag is true, process each entry that is a
        /// child of the directory.
        /// </summary>
        /// <param name="sourceEntry">
        /// The TarEntry representing the entry to write to the archive.
        /// </param>
        /// <param name="recurse">
        /// If true, process the children of directory entries.
        /// </param>
        public void WriteEntry(TarEntry sourceEntry, bool recurse)
        {
            if (sourceEntry == null)
            {
                throw new ArgumentNullException("sourceEntry");
            }

            if (isDisposed)
            {
                throw new ObjectDisposedException("TarArchive");
            }

            try
            {
                if (recurse)
                {
                    TarHeader.SetValueDefaults(sourceEntry.UserId, sourceEntry.UserName,
                                               sourceEntry.GroupId, sourceEntry.GroupName);
                }
                WriteEntryCore(sourceEntry, recurse);
            }
            finally
            {
                if (recurse)
                {
                    TarHeader.RestoreSetValues();
                }
            }
        }
Example #2
0
 public void WriteEntry(TarEntry sourceEntry, bool recurse)
 {
     //IL_0008: Unknown result type (might be due to invalid IL or missing references)
     //IL_001b: Unknown result type (might be due to invalid IL or missing references)
     if (sourceEntry == null)
     {
         throw new ArgumentNullException("sourceEntry");
     }
     if (isDisposed)
     {
         throw new ObjectDisposedException("TarArchive");
     }
     try
     {
         if (recurse)
         {
             TarHeader.SetValueDefaults(sourceEntry.UserId, sourceEntry.UserName, sourceEntry.GroupId, sourceEntry.GroupName);
         }
         WriteEntryCore(sourceEntry, recurse);
     }
     finally
     {
         if (recurse)
         {
             TarHeader.RestoreSetValues();
         }
     }
 }
 public void WriteEntry(TarEntry sourceEntry, bool recurse)
 {
     try
     {
         if (recurse)
         {
             TarHeader.SetValueDefaults(sourceEntry.UserId, sourceEntry.UserName, sourceEntry.GroupId, sourceEntry.GroupName);
         }
         this.InternalWriteEntry(sourceEntry, recurse);
     }
     finally
     {
         if (recurse)
         {
             TarHeader.RestoreSetValues();
         }
     }
 }