![]() |
fCraft
0.638
Custom Minecraft Server
|
Contains fCraft path settings, and some filesystem-related utilities. More...
Static Public Member Functions | |
| static void | MoveOrReplaceFile ([NotNull] string source,[NotNull] string destination) |
| Moves file from source to destination, overwriting destination if it exists, as safely as possible. File.Replace, File.Copy/File.Delete, or File.Move is used depending on circumstances. | |
| static bool | TestDirectory ([NotNull] string pathLabel,[NotNull] string path, bool checkForWriteAccess) |
| Makes sure that the path format is valid, that it exists, that it is accessible and writeable. | |
| static bool | TestFile ([NotNull] string fileLabel,[NotNull] string fileName, bool createIfDoesNotExist, FileAccess neededAccess) |
| Makes sure that the path format is valid, and optionally whether it is readable/writeable. | |
| static bool | Compare ([NotNull] string path1,[NotNull] string path2) |
| Checks whether two paths/file names reference the exact same filesystem location. Accounts for filesystem quirks. | |
| static bool | Compare ([NotNull] string path1,[NotNull] string path2, bool caseSensitive) |
| Checks whether two paths/file names reference the exact same filesystem location. Allows specifying whether comparison should be case-sensitive or not. | |
| static bool | IsValidPath (string path) |
| Checks whether the given path is valid. Does NOT check for existence of the file/directory at the given path. | |
| static bool | Contains ([NotNull] string parentPath,[NotNull] string childPath) |
| Checks whether childPath is inside parentPath. Accounts for filesystem quirks. | |
| static bool | Contains ([NotNull] string parentPath,[NotNull] string childPath, bool caseSensitive) |
| Checks whether childPath is inside parentPath. | |
| static bool | FileExists ([NotNull] string fileName, bool caseSensitive) |
| Checks whether the file exists in a specified way (case-sensitive or case-insensitive) | |
| static bool | Exists ([NotNull] this FileInfo fileInfo, bool caseSensitive) |
| Checks whether the file exists in a specified way (case-sensitive or case-insensitive). | |
| static string | GetDirectoryNameOrRoot ([NotNull] string fileOrDirName) |
| Gets full directory name for a given path, or path root for directory-less paths. Uses either Path.GetDirectoryName or Path.GetPathRoot to get the result. | |
| static void | ForceRename ([NotNull] string originalFullFileName,[NotNull] string newFileName) |
| Allows making changes to file name capitalization on case-insensitive filesystems. | |
| static FileInfo[] | FindFiles ([NotNull] string fullFileName) |
| Find files that match the name in a case-insensitive way. | |
| static bool | IsProtectedFileName ([NotNull] string fileName) |
| Checks whether the given file is on a list of protected file names. Protected file names include all fCraft binaries, configuration files, and data files. | |
Public Attributes | |
| const string | MapPathDefault = "maps" |
| const string | PlayerDBFileName = "PlayerDB.txt" |
| const string | IPBanListFileName = "ipbans.txt" |
| const string | GreetingFileName = "greeting.txt" |
| const string | AnnouncementsFileName = "announcements.txt" |
| const string | RulesFileName = "rules.txt" |
| const string | RulesDirectory = "rules" |
| const string | HeartbeatDataFileName = "heartbeatdata.txt" |
| const string | UpdaterFileName = "UpdateInstaller.exe" |
| const string | WorldListFileName = "worlds.xml" |
| const string | AutoRankFileName = "autorank.xml" |
| const string | BlockDBDirectory = "blockdb" |
| const string | DataBackupDirectory = "databackups" |
| const string | DataBackupFileNameFormat = "fCraftData_{0:yyyyMMdd'_'HH'-'mm'-'ss}.zip" |
Static Public Attributes | |
| static readonly string | WorkingPathDefault |
Properties | |
| static bool | IgnoreMapPathConfigKey [get, set] |
| Whether fCraft should parse ConfigKey.MapPath when loading config.xml This is set to "false" by Server if –mappath command-line argument was given. | |
| static string | MapPath [get, set] |
| Path to save maps to (default: .) Can be overridden at startup via command-line argument "–mappath=", or via "MapPath" ConfigKey | |
| static string | WorkingPath [get, set] |
| Working path (default: whatever directory fCraft.dll is located in) Can be overridden at startup via command line argument "–path=" | |
| static string | LogPath [get, set] |
| Path to save logs to (default: .) Can be overridden at startup via command-line argument "–logpath=" | |
| static string | ConfigFileName [get, set] |
| Path to load/save config to/from (default: ..xml) Can be overridden at startup via command-line argument "–config=" | |
| static string | BlockDBPath [get] |
| Directory where block database files (.fbdb) are stored. | |
| static string | RulesPath [get] |
| Directory where rule sections are stored. | |
| static string | BackupPath [get] |
| Path where map backups are stored. | |
Contains fCraft path settings, and some filesystem-related utilities.
|
static |
Checks whether two paths/file names reference the exact same filesystem location. Accounts for filesystem quirks.
| ArgumentNullException | path1 or path2 is null. |
|
static |
Checks whether two paths/file names reference the exact same filesystem location. Allows specifying whether comparison should be case-sensitive or not.
| ArgumentNullException | path1 or path2 is null. |
|
static |
Checks whether childPath is inside parentPath. Accounts for filesystem quirks.
| parentPath | Path that is supposed to contain childPath. |
| childPath | Path that is supposed to be contained within parentPath. |
|
static |
Checks whether childPath is inside parentPath.
| parentPath | Path that is supposed to contain childPath. |
| childPath | Path that is supposed to be contained within parentPath. |
| caseSensitive | Whether check should be case-sensitive or case-insensitive. |
|
static |
Checks whether the file exists in a specified way (case-sensitive or case-insensitive).
| fileInfo | FileInfo object in question. |
| caseSensitive | Whether check should be case-sensitive or case-insensitive. |
| ArgumentNullException | fileInfo is null. |
|
static |
Checks whether the file exists in a specified way (case-sensitive or case-insensitive)
| fileName | File name/path to check. |
| caseSensitive | Whether check should be case-sensitive or case-insensitive. |
|
static |
Find files that match the name in a case-insensitive way.
| fullFileName | Case-insensitive file name to look for. |
| ArgumentNullException | fullFileName is null. |
|
static |
Allows making changes to file name capitalization on case-insensitive filesystems.
| originalFullFileName | Full path to the original file name |
| newFileName | New file name (do not include the full path) |
| ArgumentNullException | originalFullFileName or newFileName is null. |
|
static |
Gets full directory name for a given path, or path root for directory-less paths. Uses either Path.GetDirectoryName or Path.GetPathRoot to get the result.
| ArgumentNullException | fileOrDirName is null. |
|
static |
Checks whether the given file is on a list of protected file names. Protected file names include all fCraft binaries, configuration files, and data files.
| fileName | File name/path to check. |
| ArgumentNullException | fileName is null. |
|
static |
Checks whether the given path is valid. Does NOT check for existence of the file/directory at the given path.
| path | Path to check. |
|
static |
Moves file from source to destination, overwriting destination if it exists, as safely as possible. File.Replace, File.Copy/File.Delete, or File.Move is used depending on circumstances.
| source | File to be moved. |
| destination | Destination file name. If this file exists, it will be replaced. |
| ArgumentNullException | source or destination is used. |
|
static |
Makes sure that the path format is valid, that it exists, that it is accessible and writeable.
| pathLabel | Name of the path that's being tested (e.g. "map path"). Used for logging. |
| path | Full or partial path. |
| checkForWriteAccess | If set, tries to write to the given directory. |
| ArgumentNullException | pathLabel or path is null. |
|
static |
Makes sure that the path format is valid, and optionally whether it is readable/writeable.
| fileLabel | Name of the path that's being tested (e.g. "map path"). Used for logging. |
| fileName | Full or partial path of the file. |
| createIfDoesNotExist | If target file is missing and this option is OFF, TestFile returns true. If target file is missing and this option is ON, TestFile tries to create a file and returns whether it succeeded. |
| neededAccess | If file is present, type of access to test. |
| ArgumentNullException | fileLabel or fileName is null. |
| const string fCraft.Paths.AnnouncementsFileName = "announcements.txt" |
| const string fCraft.Paths.AutoRankFileName = "autorank.xml" |
| const string fCraft.Paths.BlockDBDirectory = "blockdb" |
| const string fCraft.Paths.DataBackupDirectory = "databackups" |
| const string fCraft.Paths.DataBackupFileNameFormat = "fCraftData_{0:yyyyMMdd'_'HH'-'mm'-'ss}.zip" |
| const string fCraft.Paths.GreetingFileName = "greeting.txt" |
| const string fCraft.Paths.HeartbeatDataFileName = "heartbeatdata.txt" |
| const string fCraft.Paths.IPBanListFileName = "ipbans.txt" |
| const string fCraft.Paths.MapPathDefault = "maps" |
| const string fCraft.Paths.PlayerDBFileName = "PlayerDB.txt" |
| const string fCraft.Paths.RulesDirectory = "rules" |
| const string fCraft.Paths.RulesFileName = "rules.txt" |
| const string fCraft.Paths.UpdaterFileName = "UpdateInstaller.exe" |
|
static |
| const string fCraft.Paths.WorldListFileName = "worlds.xml" |
|
staticget |
Path where map backups are stored.
|
staticget |
Directory where block database files (.fbdb) are stored.
|
staticgetset |
Path to load/save config to/from (default: ..xml) Can be overridden at startup via command-line argument "–config="
|
staticgetset |
|
staticgetset |
Path to save logs to (default: .) Can be overridden at startup via command-line argument "–logpath="
|
staticgetset |
Path to save maps to (default: .) Can be overridden at startup via command-line argument "–mappath=", or via "MapPath" ConfigKey
|
staticget |
Directory where rule sections are stored.
|
staticgetset |
Working path (default: whatever directory fCraft.dll is located in) Can be overridden at startup via command line argument "–path="