Пример #1
0
        static void Checkout(
            Node node,
            string path,
            ChangesTreeOperations changesTreeOperations)
        {
            changesTreeOperations.Checkout(CmPath.FromWindows(path));

            node.Checkout(3, new Codice.CM.Common.SEID("plasticdrive", false));
        }
Пример #2
0
 internal PlasticFileSystem(
     WorkspaceContent content,
     string cachePath,
     PlasticAPI plasticApi,
     FileHandles handles,
     WorkspaceLocalFiles tempStorage,
     VirtualFiles virtualFiles)
 {
     mWorkspaceContent      = content;
     mChangesTreeOperations = new ChangesTreeOperations(content);
     mLocalFilesPath        = cachePath;
     mFileCache             = new FileCache(mLocalFilesPath);
     mPlasticApi            = plasticApi;
     mHandles      = handles;
     mLocalFiles   = tempStorage;
     mVirtualFiles = virtualFiles;
 }
Пример #3
0
        static int Delete(
            Node root,
            string path,
            VirtualFiles virtualFiles,
            ChangesTreeOperations changesTreeOperations)
        {
            Node parent = WalkTree.Find(root, Path.GetDirectoryName(path));

            if (parent == null)
            {
                return(-DokanNet.ERROR_PATH_NOT_FOUND);
            }

            Node node = WalkTree.GetChildByName(parent.GetChildren(), Path.GetFileName(path));

            if (node == null)
            {
                return(-DokanNet.ERROR_FILE_NOT_FOUND);
            }

            IVirtualFile virtualFile = virtualFiles.Get(node.GetNodeId());

            if (virtualFile != null)
            {
                mLog.ErrorFormat("We don't allow deleting virtual files. [{0}]",
                                 node.GetName());

                return(-DokanNet.ERROR_ACCESS_DENIED);
            }

            if (node.IsControlled())
            {
                changesTreeOperations.Delete(CmPath.FromWindows(path));
            }

            if (parent.DeleteChild(node))
            {
                return(0);
            }

            return(-DokanNet.ERROR_FILE_NOT_FOUND);
        }