예제 #1
0
        public LibraryDB(WebLibraryDetail web_library_detail)
        {
            base_path    = web_library_detail.LIBRARY_BASE_PATH;
            library_path = LibraryDB.GetLibraryDBPath(base_path);
            string db_syncref_path = IntranetLibraryTools.GetLibraryMetadataPath(base_path);

            // Copy a library into place...
            // but only if this is not a Internet sync directory/DB!
            if (File.Exists(db_syncref_path))
            {
                throw new Exception(String.Format("MUST NOT attempt to create a regular Qiqqa library in the Qiqqa Internet/Intranet Sync directory: '{0}'", base_path));
            }
            if (!File.Exists(library_path))
            {
                Logging.Warn($"Library db for '{web_library_detail.Id}' does not exist so copying the template to '{library_path}'");
                string library_template_path = LibraryDB.GetLibraryDBTemplatePath();
                File.Copy(library_template_path, library_path);
            }
        }
예제 #2
0
        public LibraryDB(string base_path)
        {
            this.base_path = base_path;
            library_path   = LibraryDB.GetLibraryDBPath(base_path);
            string db_syncref_path = IntranetLibraryTools.GetLibraryMetadataPath(base_path);

            // Copy a library into place...
            // but only if this is not a Internet sync directory/DB!
            if (File.Exists(db_syncref_path))
            {
                throw new Exception(String.Format("MUST NOT attempt to create a regular Qiqqa library in the Qiqqa Internet/Intranet Sync directory: '{0}'", base_path));
            }
            if (!File.Exists(library_path))
            {
                Logging.Warn("Library db does not exist so copying the template to {0}", library_path);
                string library_template_path = LibraryDB.GetLibraryDBTemplatePath();
                File.Copy(library_template_path, library_path);
            }
        }