private void scanPath() {
        File folder = new File(path);
        File[] listOfFiles = folder.listFiles();
        if (parent == null) {
            ScanFolderTask.preventClosing();
        }
        for (File candidate : listOfFiles) {
            final String name = candidate.getName();
            if (candidate.isFile()) {
                if (_patImage.matcher(name).find()) {
                    LOG.log(Level.FINEST, "Queuing a task for image: {0}", name);
                    try {
                        photosToBeProcessed.add(candidate.getCanonicalPath());
                    } catch (IOException ex) {
                        LOG.log(Level.SEVERE, "Unable to retrieve absolute path for " + name, ex);
                    }
                }
            } else if (candidate.isDirectory() && !name.startsWith(".")) {
                try {
                    LOG.log(Level.FINEST, "Queuing a task for folder: {0}", name);
                    ScanFolderTask sft = new ScanFolderTask(candidate.getCanonicalPath(), this);
                    getQueue().execute(sft);
                } catch (IOException ex) {
                    LOG.log(Level.SEVERE, "Unable to retrieve absolute path for " + name, ex);
                }
            }
        }
        if (parent == null) {
            ScanFolderTask.allowClosing();
        }
    }