public SessionRecordingPathsBuilder(string path, SessionRecording session) { string sessionFolder = FilenameHelper.ReplaceInvalidFileNameChars(session.Id); var rootPath = Path.Combine(path, sessionFolder); _rootDirectory = new DirectoryInfo(rootPath.TrimEnd()); }
public string BuildDeviceFilePath(DeviceType deviceType, string tag, string extension) { string filename = $"{deviceType.Code}_{tag}.{extension.Trim('.')}"; string path = Path.Combine(RootPath, FilenameHelper.ReplaceInvalidFileNameChars(filename)); _paths.Add(path); return(path); }
public string BuildFilePath(string name, string format) { string filename = $"{name}.{format.Trim('.')}"; string path = Path.Combine(RootPath, FilenameHelper.ReplaceInvalidFileNameChars(filename)); _paths.Add(path); return(path); }
private static string PrepareDirectoryForUploadSegments(SessionRecordingData recording) { string sessionIdentifier = Path.GetFileName(recording.Path); //string sessionIdentifier = $"{recording.StartTime.ToString(SESSION_FOLDER_TIMESTAMP_FORMAT)} {recording.SessionName}"; string sessionDirectoryName = FilenameHelper.ReplaceInvalidFileNameChars(sessionIdentifier); string sessionDirectory = Path.Combine(Directories.UploadFolderPath, sessionDirectoryName); if (Directory.Exists(sessionDirectory)) { Directory.Delete(sessionDirectory, true); } Directories.EnsureDirectoryExists(sessionDirectory); return(sessionDirectory); }