Amver / easymyp

Automatically exported from code.google.com/p/easymyp
0 stars 0 forks source link

Programatic file extraction broken #32

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call
HashDictionary hashDictionary = new HashDictionary();
hashDictionary.AddHash(0x3FE03665, 0x349E2A8C, "testFile", 00000000);
MYPHandler.MYPHandler mypHandler = new MYPHandler.MYPHandler(WARPath +
"\\data.myp", null, null, hashDictionary);
mypHandler.GetFileTable();
FileInArchive theFile = mypHandler.SearchForFile("testFile");
mypHandler.ExtractionPath = Application.StartupPath;
mypHandler.ExtractFile(theFile);
2.
on line MYPHandler_extraction.cs, line 204, boList is null, so extraction
fails.

What is the expected output? What do you see instead?
The file is extracted. Nothing got extracted.

Original issue reported on code.google.com by Hadrian....@googlemail.com on 6 Jul 2009 at 10:08

GoogleCodeExporter commented 9 years ago
Fixed:
* Renamed ExtractFileList to Extract
* Added the following code in the Extract method:
            List<FileInArchive> fileList = new List<FileInArchive>();
            if (obj.GetType() == typeof(List<FileInArchive>))
            {
                fileList = (List<FileInArchive>)obj;
            }
            else if (obj.GetType() == typeof(FileInArchive))
            {
                fileList.Add((FileInArchive)obj);
            }
            else if (obj.GetType() == typeof(string))
            {
                FileInArchive tmpFIA = this.SearchForFile((string)obj);
                if (tmpFIA == null)
                {
                    return;
                }
                fileList.Add(tmpFIA);
            }
* Rendered ExtractFile() private.

Original comment by ChryzoPh...@gmail.com on 7 Jul 2009 at 1:50