Crisis.Ionic.Zip.ZipEntry.NameInArchive C# (CSharp) Метод

NameInArchive() статический приватный Метод

/// The text encoding actually used for this ZipEntry. ///
/// ///

/// This read-only property describes the encoding used by the /// ZipEntry. If the entry has been read in from an existing ZipFile, /// then it may take the value UTF-8, if the entry is coded to specify UTF-8. /// If the entry does not specify UTF-8, the typical case, then the encoding /// used is whatever the application specified in the call to /// ZipFile.Read(). If the application has used one of the overloads of /// ZipFile.Read() that does not accept an encoding parameter, then the /// encoding used is IBM437, which is the default encoding described in the /// ZIP specification.

/// ///

/// If the entry is being created, then the value of ActualEncoding is taken /// according to the logic described in the documentation for .

/// ///

/// An application might be interested in retrieving this property to see if /// an entry read in from a file has used Unicode (UTF-8).

/// ///
static private NameInArchive ( String filename, string directoryPathInArchive ) : string
filename String
directoryPathInArchive string
Результат string
        internal static string NameInArchive(String filename, string directoryPathInArchive)
        {
            string result = null;
            if (directoryPathInArchive == null)
                result = filename;

            else
            {
                if (String.IsNullOrEmpty(directoryPathInArchive))
                {
                    result = Path.GetFileName(filename);
                }
                else
                {
                    // explicitly specify a pathname for this file
                    result = Path.Combine(directoryPathInArchive, Path.GetFileName(filename));
                }
            }

            //result = Path.GetFullPath(result);
            result = SharedUtilities.NormalizePathForUseInZipFile(result);

            return result;
        }
ZipEntry