/// <summary> /// Renames the specified file/folder, which is available in given path. /// </summary> /// <param name="path">Parent folder path of renaming item.</param> /// <param name="oldName">Existing name.</param> /// <param name="newName">New name.</param> /// <param name="commonFiles">Specifies existing files list, which contains same name, type and parent path as given in new file</param> /// <returns>System.Object.</returns> /// <exception cref="ArgumentException">' + path + oldName + ' is not accessible. Access is denied.</exception> public virtual object Rename(string path = null, string oldName = null, string newName = null, IEnumerable <CommonFileDetails> commonFiles = null, IEnumerable <object> selectedItems = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); sqlObj.Rename(path, oldName, newName, commonFiles, selectedItems); return(null); }
/// <summary> /// Removes the specified items from given path. /// </summary> /// <param name="names">Removable item names.</param> /// <param name="path">Parent folder path of removable items.</param> /// <returns>System.Object.</returns> /// <exception cref="ArgumentException">' + path + names[i] + ' is not accessible. Access is denied.</exception> public virtual object Remove(string[] names = null, string path = null, IEnumerable <object> selectedItems = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); sqlObj.Remove(names, path, selectedItems); return(null); }
/// <summary> /// Copy or moves the specified files/ directories from one location to another location. /// </summary> /// <param name="sourceDir">Source directory path.</param> /// <param name="backupDir">Target directory path.</param> /// <param name="names">Name of file/ folders, which are going to be pasted in destination folder.</param> /// <param name="option">Operation type “move” or “copy”.</param> /// <param name="commonFiles">Existing files list, which contains same name, type and parent path as given in new file.</param> /// <returns>System.Object.</returns> /// <exception cref="ArgumentException">' + sourceDir + names[i] + ' is not accessible. Access is denied. /// or /// ' + backupDir + ' is not accessible. Access is denied.</exception> public virtual object Paste(string sourceDir = null, string backupDir = null, string[] names = null, string option = null, IEnumerable <CommonFileDetails> commonFiles = null, IEnumerable <object> selectedItems = null, IEnumerable <object> targetFolder = null, string locationFrom = null, string locationTo = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); sqlObj.Paste(sourceDir, backupDir, names, option, commonFiles, selectedItems, targetFolder); return(null); }
public SQLFileAccessOperations(string connectionString, string tableName, SQLFileAccessInfo rule, int rootNodeId = 1) { connectionStr = connectionString; AccessRules = rule; TableName = tableName; RootNode = rootNodeId; Connection.ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings[connectionString].ConnectionString; Connection.Open(); operation = new SQLFileExplorerOperations(connectionString, tableName); }
/// <summary> /// Searches the matched files and sub-folders in the given folder path using search string. /// </summary> /// <param name="path">Directory path.</param> /// <param name="filter">File types to filter.</param> /// <param name="searchString">The search string.</param> /// <param name="caseSensitive">If set to <c>true</c> [case sensitive].</param> /// <returns>System.Object.</returns> /// <exception cref="ArgumentException">' + path + ' is not accessible. Access is denied.</exception> public virtual object Search(string path = null, string filter = null, string searchString = null, bool caseSensitive = false, IEnumerable <object> selectedItems = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); return(sqlObj.Search(path, filter, searchString, caseSensitive, selectedItems)); }
/// <summary> /// Downloads the specified files. /// </summary> /// <param name="path">Parent directory path of selected files, which is going to be download.</param> /// <param name="names">Name of files that is need to be downloaded.</param> /// <exception cref="ArgumentNullException">' + path + names[i] + ' is not accessible. Access is denied.</exception> public virtual void Download(string path, string[] names) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode);; sqlObj.Download(path, names); }
/// <summary> /// Uploads the specified files to given path. /// </summary> /// <param name="files">Uploading file details.</param> /// <param name="path">Path of destination directory, where the files need to be uploaded.</param> /// <exception cref="ArgumentNullException">' + path + ' is not accessible. Access is denied.</exception> public virtual void Upload(IEnumerable <HttpPostedFileBase> files = null, string path = null, IEnumerable <object> selectedItems = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); sqlObj.Upload(files, path, selectedItems); }
/// <summary> /// Gets the details about specified file or directory. /// </summary> /// <param name="path">Parent directory path of selected file.</param> /// <param name="names">File or folder name.</param> /// <returns>System.Object.</returns> public virtual object GetDetails(string path = null, string[] names = null, IEnumerable <object> selectedItems = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); return(sqlObj.GetDetails(path, names, selectedItems)); }
/// <summary> /// Creates a new folder in given path with specified name. /// </summary> /// <param name="path">Parent folder path.</param> /// <param name="name">Name of the new folder.</param> /// <returns>System.Object.</returns> /// <exception cref="ArgumentException">' + path + ' is not accessible. Access is denied.</exception> public virtual object CreateFolder(string path = null, string name = null, IEnumerable <object> selectedItems = null) { SQLFileExplorerOperations sqlObj = new SQLFileExplorerOperations(connectionStr, TableName, RootNode); return(sqlObj.CreateFolder(path, name, selectedItems)); }