q.setDate(q.getDate() + files[i].getName() + " " + myDriver.patchNumbers[j]);
q.setDate(q.getDate() + files[i].getName() + " " + pn[j]);
    public void doImport (int putName, boolean extract,File directory)    {        File []files = directory.listFiles ();        try        {            for (int i=0;i<files.length;i++)            {                FileInputStream fileIn=null;                byte [] buffer =new byte [(int)files[i].length ()];                try                {                    fileIn= new FileInputStream (files[i]);                    fileIn.read (buffer);                    fileIn.close ();                }                catch (Exception e)                {                    buffer=new byte[1];                }                if (buffer.length>16)                {                    Patch p = new Patch (buffer);                    // NEW CODE                    Patch[] patarray=p.dissect ();                    for (int k=0;k<patarray.length;k++) // Loop over all found sub-patches                    {			Patch pk = patarray[k];                        if (putName==1) pk.setDate(pk.getDate() + files[i].getName());                        if (putName==2) pk.setAuthor(pk.getAuthor() + files[i].getName());                        if (myModel.includeDevice[pk.getDriver().getDeviceNum()].booleanValue ())                        {                            if (extract && (pk.getDriver() instanceof BankDriver))                            {                                BankDriver myDriver=((BankDriver) pk.getDriver());                                for (int j=0;j<myDriver.getNumPatches();j++)                                {                                    Patch q=(myDriver.getPatch (pk,j));                                    if (putName==1)                                        q.setDate(q.getDate() + files[i].getName() + " " + myDriver.patchNumbers[j]);                                    if (putName==2)                                        q.setAuthor(q.getAuthor() + files[i].getName() + " " + myDriver.patchNumbers[j]);                                    ((LibraryFrame)JSLDesktop.getSelectedFrame ()).PastePatch (q);                                }                            }                            else                            {                                ((LibraryFrame)JSLDesktop.getSelectedFrame ()).PastePatch (pk);                            }                        }                    }                }            }        } catch (Exception e)        {e.printStackTrace ();         ErrorMsg.reportError ("Error", "Unable to Import Patches",e);return;}    }