C# Class Azavea.NijPredictivePolicing.Common.FileUtilities

Afficher le fichier Open project: azavea/acs-alchemist

Méthodes publiques

Méthode Description
CleanPath ( string OutputFolder ) : string
FindFileNameInZipLike ( string zipFileName, string pattern ) : List

Uses Ionic.Zip library to search a compressed file for a given pattern

GetApplicationPath ( ) : string
PathCombine ( ) : string

Like Path.Combine(), only works for an arbitrary number of arguments

PathEnsure ( string basepath ) : string

Given a basepath and a list of names of subdirectories, creates the subdirectories if necessary. Throws exceptions on error.

SafePathEnsure ( string basepath ) : string

Wrapper around PathEnsure() that doesn't throw exceptions. Returns "" on error and prints an error message to _log

TryChangeCreationTime ( string filename, System.DateTime newTime ) : bool

Try changing the file's creation time without exceptions. Returns true on success, false on failure.

TryChangeLastWriteTime ( string filename, System.DateTime newTime ) : bool

Try changing the file's last write time without exceptions. Returns true on success, false on failure.

TryDelete ( string filename ) : bool

Delete without exceptions. Returns true on success, false on failure.

UnzipFileTo ( string basePath, string zipFileName ) : bool

Uses Ionic.Zip library to expand a file (without overwriting) to a given location

Method Details

CleanPath() public static méthode

public static CleanPath ( string OutputFolder ) : string
OutputFolder string
Résultat string

FindFileNameInZipLike() public static méthode

Uses Ionic.Zip library to search a compressed file for a given pattern
public static FindFileNameInZipLike ( string zipFileName, string pattern ) : List
zipFileName string
pattern string
Résultat List

GetApplicationPath() public static méthode

public static GetApplicationPath ( ) : string
Résultat string

PathCombine() public static méthode

Like Path.Combine(), only works for an arbitrary number of arguments
public static PathCombine ( ) : string
Résultat string

PathEnsure() public static méthode

Given a basepath and a list of names of subdirectories, creates the subdirectories if necessary. Throws exceptions on error.
public static PathEnsure ( string basepath ) : string
basepath string A path to a directory that already exists
Résultat string

SafePathEnsure() public static méthode

Wrapper around PathEnsure() that doesn't throw exceptions. Returns "" on error and prints an error message to _log
public static SafePathEnsure ( string basepath ) : string
basepath string
Résultat string

TryChangeCreationTime() public static méthode

Try changing the file's creation time without exceptions. Returns true on success, false on failure.
public static TryChangeCreationTime ( string filename, System.DateTime newTime ) : bool
filename string
newTime System.DateTime
Résultat bool

TryChangeLastWriteTime() public static méthode

Try changing the file's last write time without exceptions. Returns true on success, false on failure.
public static TryChangeLastWriteTime ( string filename, System.DateTime newTime ) : bool
filename string
newTime System.DateTime
Résultat bool

TryDelete() public static méthode

Delete without exceptions. Returns true on success, false on failure.
public static TryDelete ( string filename ) : bool
filename string
Résultat bool

UnzipFileTo() public static méthode

Uses Ionic.Zip library to expand a file (without overwriting) to a given location
public static UnzipFileTo ( string basePath, string zipFileName ) : bool
basePath string
zipFileName string
Résultat bool