Esempio n. 1
0
        public SPOFolder GetFolderByServerRelativeUrl(string serverRelativeUrl)
        {
            var folder = _web.GetFolderByServerRelativeUrl(serverRelativeUrl);

            SPOFolder.LoadFolder(SPOSiteContext.CurrentSiteContext.Context, folder, true, false);
            return(new SPOFolder(folder, false));
        }
Esempio n. 2
0
        public List <SPOFolder> GetFolders(bool detailed)
        {
            if (_folders != null)
            {
                return(_folders);
            }

            var ctx     = SPOSiteContext.CurrentSiteContext.Context;
            var folders = Web.Folders;

            ctx.Load(folders);
            ctx.ExecuteQuery();
            _folders = new List <SPOFolder>();
            foreach (Folder folder in folders)
            {
                SPOFolder.LoadFolder(ctx, folder, detailed, false);
                _folders.Add(new SPOFolder(folder, false));
            }
            return(_folders);
        }
        private void WriteFiles(string targetFolder, SPOFolder folder)
        {
            if (!Directory.Exists(targetFolder))
            {
                WriteVerbose(string.Format("Creating folder {0}...", targetFolder));
                Directory.CreateDirectory(targetFolder);
            }

            foreach (SPOFile file in folder.GetFiles())
            {
                WriteFile(targetFolder, file);
            }
            if (Recursive)
            {
                foreach (SPOFolder childFolder in folder.GetFolders(false))
                {
                    WriteFiles(Path.Combine(targetFolder, childFolder.Name), childFolder);
                }
            }
        }
 public SPOFolderPipeBind(SPOFolder folder)
 {
     _serverRelativeUrl = folder.ServerRelativeUrl;
 }
 public SPOPropertyBag(SPOFolder folder, PropertyValues properties)
 {
     _folder = folder;
     _pb     = properties;
 }