C# Class FileIOHelper, TabMigrate

Helper for file io
Datei anzeigen Open project: tableau/TabMigrate Class Usage Examples

Public Methods

Method Description
CreatePathIfNeeded ( string localPath ) : void

Ensures the specified path exists

EnsureProjectBasedPath ( string basePath, IProjectsList projectList, IHasProjectId project, TaskStatusLogs, statusLog ) : string

If we have Project Mapping information, generate a project based path for the download

FilenameWithDateTimeUnique ( string baseName, Nullable when = null ) : string

Gives us a high probability unqique file name

GenerateWindowsSafeFilename ( string fileNameIn ) : string

Take any text in an munge it into name that is valid on windows

PathDateTimeSubdirectory ( string basePath, bool createDirectory, string newDirectoryPrefix = "", Nullable when = null ) : string

Creates a high-probabilty-unique path based on the current date-time

Undo_GenerateWindowsSafeFilename ( string fileNameIn ) : string

Reverses 'GenerateWindowsSafeFilename_Reverse'

Private Methods

Method Description
GetFilenameSwapValues ( ) : string>>.List

Method Details

CreatePathIfNeeded() public static method

Ensures the specified path exists
public static CreatePathIfNeeded ( string localPath ) : void
localPath string
return void

EnsureProjectBasedPath() public static method

If we have Project Mapping information, generate a project based path for the download
public static EnsureProjectBasedPath ( string basePath, IProjectsList projectList, IHasProjectId project, TaskStatusLogs, statusLog ) : string
basePath string
projectList IProjectsList
project IHasProjectId
statusLog TaskStatusLogs,
return string

FilenameWithDateTimeUnique() public static method

Gives us a high probability unqique file name
public static FilenameWithDateTimeUnique ( string baseName, Nullable when = null ) : string
baseName string
when Nullable
return string

GenerateWindowsSafeFilename() public static method

Take any text in an munge it into name that is valid on windows
public static GenerateWindowsSafeFilename ( string fileNameIn ) : string
fileNameIn string
return string

PathDateTimeSubdirectory() public static method

Creates a high-probabilty-unique path based on the current date-time
public static PathDateTimeSubdirectory ( string basePath, bool createDirectory, string newDirectoryPrefix = "", Nullable when = null ) : string
basePath string
createDirectory bool
newDirectoryPrefix string
when Nullable
return string

Undo_GenerateWindowsSafeFilename() public static method

Reverses 'GenerateWindowsSafeFilename_Reverse'
public static Undo_GenerateWindowsSafeFilename ( string fileNameIn ) : string
fileNameIn string
return string