jgalleryContextPath, folderPath, dBManager);
jgalleryContextPath, folderPath, imagePath, dBManager);
    private Folder createFolder(HttpSession session, String folderPath,            String folderRealPath, String jgalleryContextPath)            throws GalleryException    {        // No need to synchronize access to the Folders because they are per        // session. In the worst case if a user has several browser windows (that        // share the same session), there might be unnecessary creations of Folders.        Folder folder;        Configuration configuration = this.configuration;        File directory = new File(folderRealPath);        if (!directory.exists()) { throw new GalleryNotFoundException(                "directory does not exist: " + directory.toString()); }        File config = new File(directory, CONFIGFILE);        if (config.exists())        {            InputStream is;            try            {                is = new FileInputStream(config);            }            catch (FileNotFoundException e)            {                throw new GalleryException(e.getMessage());            }            try            {                Configuration conf = new Configuration(is, configuration);                configuration = conf;            }            catch (IOException e)            {                throw new GalleryException(e.getMessage());            }        }        folder = new Folder(directory, getServletContext(), configuration, version,                jgalleryContextPath, folderPath, dBManager);        Hashtable folders = getFolders(session);        folders.put(folderPath, folder);        return folder;    }