private List processMainDirectory() throws Exception
    {
        m_logger.info("Processing directories");
        
        List returnList = new ArrayList();
        
        //Process the directory
        File directory = new File(m_directoryToTraverse);
       
        if(m_validator != null)
        {
            m_logger.info("Starting validation");
            m_validator.setExcludedFolders(m_excludedFolders);
            m_validator.setFolderToProcess(directory);
            m_validator.setFailOnError(m_failOnValidation);
            m_validator.process();
            m_logger.info("Finished validation");
        }


        //Allow folder exclusion
        File[] modules = directory.listFiles(new FilenameFilter() {

            public boolean accept(File file, String fileToCheck)
            {
                m_logger.debug("Checking module ["+fileToCheck+"]");
                //if not in list, then accept. If in list, then reject the folder
                if(m_excludedFolders == null || m_excludedFolders.isEmpty())
                    return true;
                else
                    if(m_excludedFolders.contains(fileToCheck))
                    {
                        m_logger.debug("Skipping excluded folder ["+fileToCheck+"]");
                        //Put these files in the list with an excluded reason
                        m_ignoredFiles.put(file.getAbsolutePath()+File.separator+fileToCheck,PodCastConstants.FILE_EXCLUDED);
                        return false;
                    }
                    else return true;
            }
        } );

        for (int i=0; i< modules.length; i++)
        {
            if(modules[i].isDirectory())
            {
                String category = modules[i].getName();

                m_logger.info("Processing module ["+category+"]");

                File categoryDirectory = new File(modules[i].getAbsolutePath());
                File[] originalFiles = categoryDirectory.listFiles();
                PodCastFile[] podcastFiles = new PodCastFile[originalFiles.length];
                Map parentDirectoryProperties = processInfoFile(categoryDirectory);


                //Convert all the files to PodCastFiles in the array.
                for(int counter=0;counter<podcastFiles.length;counter++)
                {
                    //Create a podcast file with a construct of file path (preconverted to UTF8).
                    //That way all files should exist, even if they have weird characters and every getName will
                    //also contain the right characters!
                    podcastFiles[counter] = new PodCastFile(PodCastUtils.convertToUTF8(originalFiles[counter].getAbsolutePath()));
                    podcastFiles[counter].setParentProperties(parentDirectoryProperties);
                    fileResolver.formatFile(podcastFiles[counter]);
                    
                }
                
               
                for (int p=0; p<podcastFiles.length;p++)
                { 
                    if(!podcastFiles[p].isValid())
                    {
                        m_logger.warn("Ignoring hidden/unresolved or info file ["+podcastFiles[p].getName()+"]");
                        m_ignoredFiles.put(podcastFiles[p].getAbsolutePath(),podcastFiles[p].getProperty(PodCastFileProperties.INVALID_REASON));

                    }
                    else
                        returnList.add(processFile(podcastFiles[p],category, parentDirectoryProperties));
                }

            }
            else m_logger.info("Skipping Loose File ["+modules[i]+"]");
        }
        
        return returnList;
           
    }