Class FileLocations
Some utils for managing the location of files
Inheritance
Namespace:Dapplo.Addons.Bootstrapper.Resolving
Assembly:Dapplo.Addons.Bootstrapper.dll
Syntax
public static class FileLocations : object
Properties
| Improve this Doc View SourceStartupDirectory
Get the startup location, which is either the location of the entry assemby, or the executing assembly
Declaration
public static string StartupDirectory { get; }
Property Value
Type | Description |
---|---|
System.String | string with the directory of where the running code/applicationName was started |
Methods
| Improve this Doc View SourceDirectoriesFor(String, Boolean)
For the given directory this will return possible location. It might be that multiple are returned, also normalization is made
Declaration
public static IEnumerable<string> DirectoriesFor(string directory, bool allowCurrentDirectory = true)
Parameters
Type | Name | Description |
---|---|---|
System.String | directory | A absolute or relative directory |
System.Boolean | allowCurrentDirectory | true to allow relative to current working directory |
Returns
Type | Description |
---|---|
IEnumerable<System.String> | IEnumerable with possible directories |
RoamingAppDataDirectory(String)
Get the roaming AppData directory
Declaration
public static string RoamingAppDataDirectory(string applicationName)
Parameters
Type | Name | Description |
---|---|---|
System.String | applicationName |
Returns
Type | Description |
---|---|
System.String | string with the directory the appdata roaming directory |
Scan(IEnumerable<String>, Regex, SearchOption)
Scan the supplied directories for files which match the passed file pattern
Declaration
public static IEnumerable<Tuple<string, Match>> Scan(IEnumerable<string> directories, Regex filePattern, SearchOption searchOption = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | directories | |
Regex | filePattern | Regular expression for the filename |
SearchOption | searchOption | Makes it possible to specify if the search is recursive, SearchOption.AllDirectories is default, use SearchOption.TopDirectoryOnly for non recursive |
Returns
Type | Description |
---|---|
IEnumerable<Tuple<System.String, Match>> | IEnumerable with paths |
Scan(IEnumerable<String>, String, SearchOption)
Scan the supplied directories for files which match the passed file pattern
Declaration
public static IEnumerable<string> Scan(IEnumerable<string> directories, string simplePattern, SearchOption searchOption = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<System.String> | directories | |
System.String | simplePattern | |
SearchOption | searchOption | Makes it possible to specify if the search is recursive, SearchOption.AllDirectories is default, use SearchOption.TopDirectoryOnly for non recursive |
Returns
Type | Description |
---|---|
IEnumerable<System.String> | IEnumerable with paths |