C# Class Warehouse.Utils

Mostra file Open project: Starcounter/Warehouse

Public Methods

Method Description
AddSampleData ( ) : void

Add sample data

AssureAdminSystemUserGroupAndPermissions ( ) : void
AssureUniqueFilename ( string folder, string fileName, string &newFile ) : void

Assure the a file is unique in a folder by assiging a counting number at the end of the file.

CalculateHash ( string file ) : string
CreateDirectory ( string path ) : string

Create Directory structure

DeleteAll ( ) : void

Delete all used tables

GeneratePasswordHash ( string userId, string password, string &hashedPassword ) : void
GetRequestProtocolVersion ( Request request ) : int

Parse out the protocol version number from the header

GetUniqueFilename ( string destination, string extention, string &fileName ) : void
IsDirectoryEmpty ( string folder ) : bool

Check if directory is empty

SanitizeName ( string folder ) : string

Sanitize Name Assure valid file or folder name

WriteToLocalLog ( string message ) : void

Private Methods

Method Description
CreateDepot ( string name, Organization org ) : Depot
CreateOrganization ( string name ) : Organization
CreateSalt ( int size ) : byte[]
GenerateSaltedHash ( byte plainText, byte salt ) : byte[]
GetBytes ( string str ) : byte[]
GetString ( byte bytes ) : string
IsClassLoaded ( string fullName ) : bool

Method Details

AddSampleData() public static method

Add sample data
public static AddSampleData ( ) : void
return void

AssureAdminSystemUserGroupAndPermissions() public static method

public static AssureAdminSystemUserGroupAndPermissions ( ) : void
return void

AssureUniqueFilename() public static method

Assure the a file is unique in a folder by assiging a counting number at the end of the file.
public static AssureUniqueFilename ( string folder, string fileName, string &newFile ) : void
folder string
fileName string
newFile string
return void

CalculateHash() public static method

public static CalculateHash ( string file ) : string
file string
return string

CreateDirectory() public static method

Create Directory structure
public static CreateDirectory ( string path ) : string
path string
return string

DeleteAll() public static method

Delete all used tables
public static DeleteAll ( ) : void
return void

GeneratePasswordHash() public static method

public static GeneratePasswordHash ( string userId, string password, string &hashedPassword ) : void
userId string
password string
hashedPassword string
return void

GetRequestProtocolVersion() public static method

Parse out the protocol version number from the header
public static GetRequestProtocolVersion ( Request request ) : int
request Request
return int

GetUniqueFilename() public static method

public static GetUniqueFilename ( string destination, string extention, string &fileName ) : void
destination string
extention string
fileName string
return void

IsDirectoryEmpty() public static method

Check if directory is empty
public static IsDirectoryEmpty ( string folder ) : bool
folder string
return bool

SanitizeName() public static method

Sanitize Name Assure valid file or folder name
public static SanitizeName ( string folder ) : string
folder string
return string

WriteToLocalLog() public static method

public static WriteToLocalLog ( string message ) : void
message string
return void