Ejemplo n.º 1
0
        /// <summary>
        /// called during the ctor of the base-class, here we fetch the data from the server to have the same
        /// </summary>
        internal override void SetupWorkDirectory(object initParam)
        {
            Logger.Debug("basic stuff");
            base.SetupWorkDirectory(initParam);

            // because we only sync to the server and just copy the stuff everytime we
            // sync, we only need to use a temp-directory
            serverPath = cachePath;

            // refresh these variables because they would be wrong else
            lockPath     = System.IO.Path.Combine(serverPath, "lock");
            manifestPath = System.IO.Path.Combine(serverPath, "manifest.xml");


            Logger.Debug("getting webdav interface");
            // this must be the webdav interface (not very nice way to do it, but did't know any other way)
            webdavserver = initParam as WebDAVInterface;

            Logger.Debug("deleting local files");
            // make our local sync dir empty
            Util.DelelteFilesInDirectory(serverPath);

            Logger.Debug("checking for remote lockfile");
            // fetch data from server
            if (webdavserver.CheckForLockFile())
            {
                Logger.Debug("downloading lockfile");
                webdavserver.DownloadLockFile(lockPath);
            }
            Logger.Debug("downloading notes");
            webdavserver.DownloadNotes(serverPath);
            Logger.Debug("workdir setup done");
        }
Ejemplo n.º 2
0
 /// <summary>
 /// executed when lockfile gets deleted
 /// </summary>
 /// <param name="path"></param>
 internal override void RemoveLockFile(string path)
 {
     base.RemoveLockFile(path);
     // on server
     try
     {
         if (webdavserver.CheckForLockFile())
         {
             webdavserver.RemoveLock();
         }
     }
     catch (Exception e)
     {
         Logger.Warn("Error deleting servers lock: {1}", e.Message);
     }
 }
        /// <summary>
        /// called during the ctor of the base-class, here we fetch the data from the server to have the same 
        /// </summary>
        internal override void SetupWorkDirectory(object initParam)
        {
            Logger.Debug("basic stuff");
            base.SetupWorkDirectory(initParam);

            // because we only sync to the server and just copy the stuff everytime we
            // sync, we only need to use a temp-directory
            serverPath = cachePath;

            // refresh these variables because they would be wrong else
            lockPath = System.IO.Path.Combine(serverPath, "lock");
            manifestPath = System.IO.Path.Combine(serverPath, "manifest.xml");

            Logger.Debug("getting webdav interface");
            // this must be the webdav interface (not very nice way to do it, but did't know any other way)
            webdavserver = initParam as WebDAVInterface;

            Logger.Debug("deleting local files");
            // make our local sync dir empty
            Util.DelelteFilesInDirectory(serverPath);

            Logger.Debug("checking for remote lockfile");
            // fetch data from server
            if (webdavserver.CheckForLockFile())
            {
                Logger.Debug("downloading lockfile");
                webdavserver.DownloadLockFile(lockPath);
            }
            Logger.Debug("downloading notes");
            webdavserver.DownloadNotes(serverPath);
            Logger.Debug("workdir setup done");
        }