/// <summary> /// Lists all folders in the given folder /// </summary> /// <returns>All folders found in the folder</returns> /// <param name='localFolderPath'>The folder to examinate</param> protected override string[] ListFolders(string localFolderPath) { string[] tmp = SystemIO.IO_WIN.GetDirectories(SystemIOWindows.AddExtendedDevicePathPrefix(localFolderPath)); string[] res = new string[tmp.Length]; for (int i = 0; i < tmp.Length; i++) { res[i] = SystemIOWindows.RemoveExtendedDevicePathPrefix(tmp[i]); } return(res); }
/// <summary> /// A callback function that takes a non-shadow path to a folder, /// and returns all folders found in a non-shadow path format. /// </summary> /// <param name="localFolderPath">The non-shadow path of the folder to list</param> /// <returns>A list of non-shadow paths</returns> protected override string[] ListFolders(string localFolderPath) { string[] tmp = null; var spath = ConvertToSnapshotPath(localFolderPath); tmp = SystemIO.IO_WIN.GetDirectories(spath); var root = Util.AppendDirSeparator(SystemIO.IO_WIN.GetPathRoot(localFolderPath)); var volumePath = Util.AppendDirSeparator(ConvertToSnapshotPath(root)); volumePath = SystemIOWindows.AddExtendedDevicePathPrefix(volumePath); for (var i = 0; i < tmp.Length; i++) { tmp[i] = root + SystemIOWindows.AddExtendedDevicePathPrefix(tmp[i]).Substring(volumePath.Length); } return(tmp); }
/// <summary> /// A callback function that takes a non-shadow path to a folder, /// and returns all files found in a non-shadow path format. /// </summary> /// <param name="localFolderPath">The non-shadow path of the folder to list</param> /// <returns>A list of non-shadow paths</returns> protected override string[] ListFiles(string localFolderPath) { string[] files = null; var spath = ConvertToSnapshotPath(localFolderPath); files = SystemIO.IO_WIN.GetFiles(spath); // convert back to non-shadow, i.e., non-vss version var root = Util.AppendDirSeparator(SystemIO.IO_WIN.GetPathRoot(localFolderPath)); var volumePath = Util.AppendDirSeparator(ConvertToSnapshotPath(root)); volumePath = SystemIOWindows.AddExtendedDevicePathPrefix(volumePath); for (var i = 0; i < files.Length; i++) { files[i] = root + SystemIOWindows.AddExtendedDevicePathPrefix(files[i]).Substring(volumePath.Length); } return(files); }
/// <summary> /// Gets the creation of a given file in UTC /// </summary> /// <param name="localPath">The full path to the file in non-shadow format</param> /// <returns>The last write time of the file</returns> public override DateTime GetCreationTimeUtc(string localPath) { var spath = ConvertToSnapshotPath(localPath); return(SystemIO.IO_WIN.GetCreationTimeUtc(SystemIOWindows.AddExtendedDevicePathPrefix(spath))); }