protected function getFiles()
    {
        if ($this->isSiteDeployment) {
            if ($this->deviceView != 'main' && !is_dir("{$this->viewDirectory}/{$this->context}/{$this->siteDomain}/{$this->deviceView}")) {
                $this->deviceView = 'main';
            }

            if ($this->design != 'default' && !is_dir("{$this->viewDirectory}/{$this->context}/{$this->siteDomain}/{$this->deviceView}/{$this->design}")) {
                $this->design = 'default';
            }
        }

        $list = array();
        if (!empty($this->viewDirectory))
            $list[] = $this->viewDirectory;

        // Build the list from all the plugin directorys, and the theme directory
        $list = array_merge($this->ApplicationContext->getEnabledPluginDirectories(),$list);

        if (count($list) > 0) {
            $files = array();
            foreach ($list as $tp) {
                if (is_dir($tp)) {
                    $paths = $this->getPathsToCheck($tp, $this->subject);
                    foreach ($paths as $basepath) {
                        if(!is_dir($basepath))
                            continue;

                        $cutoffDepth = null;
                        $objects     = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($basepath),
                                                                     RecursiveIteratorIterator::SELF_FIRST);

                        foreach ($objects as $name => $object) {
                            if($cutoffDepth !== null && $objects->getDepth() > $cutoffDepth)
                                continue;
                            else
                                $cutoffDepth = null;

                            if ($cutoffDepth === null && $object->isDir() && substr($object->getBasename(), 0, 1) == '.') {
                                $cutoffDepth = $objects->getDepth();
                                continue;
                            }

                            if (!$object->isFile() || substr($object->getBasename(), 0, 1) == '.')
                                continue;

                            $files[substr($name, strlen($basepath))] = $name;
                        }
                    }

                } else {
                    $this->Logger->warn('Directory does not exist: '.$tp);
                }
            }

            if(empty($files))
                return array(array(),null);

            $timestamps = array();
            foreach ($files as $relpath => $filename) {
                $timestamps[] = filemtime($filename);
            }

            $md5 = md5(serialize(array($files,$timestamps/*, $this->VersionService->getSystemVersion(), $this->VersionService->getDeploymentRevision()*/)));

            return array($files, $md5);
        }

        throw new Exception('No active themes or plugins.');
    }