Solid Framework SDK 10.0.12602
SDK for converting and extracting value from PDFs
Static Public Member Functions | List of all members
SolidFramework.Plumbing.Utilities Class Reference

Represents Utilities More...

Static Public Member Functions

static String ConvertToMD5String (String source)
 Converts to Md5 string. More...
 
static string ConvertUTF7toUCS2 (string original)
 UTF-7 is used to transfer strings (like unicode paths) via the console without needing to care about the code page of the console (since only 0..127 are used) More...
 
static string ConvertUCS2toUTF7 (string original)
 UTF-7 is used to transfer strings (like unicode paths) via the console without needing to care about the code page of the console (since only 0..127 are used) More...
 
static String GetWorkerTempFolder (int pid)
 Gets the worker temp folder. More...
 
static bool IsDirectoryReadWrite (string dirPath, bool throwIfFails=false)
 Checks if a directory is read/write by the current user. More...
 
static String CreateUniqueTempFileName (String extension)
 Creates the name of the unique temp file. More...
 
static String CreateUniqueTempFolder ()
 Creates the name of the unique temp folder. More...
 
static String ConvertBytesToString (long bytes)
 Converts the bytes to string. More...
 
static void FileDelete (String path)
 Files the delete. More...
 
static void FileCopy (string source, string destination)
 Files the copy. More...
 
static void FileCopy (string source, string destination, bool overwrite)
 Files the copy. More...
 
static String ProcessResourceTags (String value, String arg1, String arg2)
 Replace two placeholders in a string, and converts any {n}, {CR} and {amp} tags. More...
 
static String ProcessResourceTags (String value, String arg1)
 Replace a single placeholder in a string, and converts any {n}, {CR} and {amp} tags. More...
 
static String ProcessResourceTags (String value)
 Replaces {n}, {CR} and {amp} tags in the string value with NewLine or Ampersand. More...
 
static void RotateLogFile (String path, long rotateFileSize)
 Utility method for changing the logfile when it becomes larger than the specified size. In that event, the logfile will be renamed from [filename] to [filename_1], with any file with that name being renamed as [filename_2]. If there are already two existing log files, so that a file exists that is already called [filename_2], then that will be deleted. More...
 
static String ValidationModeToString (ValidationMode mode)
 Returns a string representation of the ValidationMode. More...
 

Detailed Description

Represents Utilities

Member Function Documentation

◆ ConvertBytesToString()

static String SolidFramework.Plumbing.Utilities.ConvertBytesToString ( long  bytes)
static

Converts the bytes to string.

Parameters
bytesThe bytes.
Returns

◆ ConvertToMD5String()

static String SolidFramework.Plumbing.Utilities.ConvertToMD5String ( String  source)
static

Converts to Md5 string.

Parameters
sourceThe source.
Returns
MD5 hash

◆ ConvertUCS2toUTF7()

static string SolidFramework.Plumbing.Utilities.ConvertUCS2toUTF7 ( string  original)
static

UTF-7 is used to transfer strings (like unicode paths) via the console without needing to care about the code page of the console (since only 0..127 are used)

Parameters
originalThe original.
Returns

◆ ConvertUTF7toUCS2()

static string SolidFramework.Plumbing.Utilities.ConvertUTF7toUCS2 ( string  original)
static

UTF-7 is used to transfer strings (like unicode paths) via the console without needing to care about the code page of the console (since only 0..127 are used)

Parameters
originalThe original.
Returns

◆ CreateUniqueTempFileName()

static String SolidFramework.Plumbing.Utilities.CreateUniqueTempFileName ( String  extension)
static

Creates the name of the unique temp file.

Parameters
extensionThe extension.
Returns
File name

◆ CreateUniqueTempFolder()

static String SolidFramework.Plumbing.Utilities.CreateUniqueTempFolder ( )
static

Creates the name of the unique temp folder.

Returns
Folder name

◆ FileCopy() [1/2]

static void SolidFramework.Plumbing.Utilities.FileCopy ( string  source,
string  destination 
)
static

Files the copy.

Parameters
sourceThe source.
destinationThe destination.

◆ FileCopy() [2/2]

static void SolidFramework.Plumbing.Utilities.FileCopy ( string  source,
string  destination,
bool  overwrite 
)
static

Files the copy.

Parameters
sourceThe source.
destinationThe destination.
overwriteif set to true [overwrite].
Exceptions
System.InvalidOperationException

◆ FileDelete()

static void SolidFramework.Plumbing.Utilities.FileDelete ( String  path)
static

Files the delete.

Parameters
pathThe path.

◆ GetWorkerTempFolder()

static String SolidFramework.Plumbing.Utilities.GetWorkerTempFolder ( int  pid)
static

Gets the worker temp folder.

Parameters
pidThe pid.
Returns

◆ IsDirectoryReadWrite()

static bool SolidFramework.Plumbing.Utilities.IsDirectoryReadWrite ( string  dirPath,
bool  throwIfFails = false 
)
static

Checks if a directory is read/write by the current user.

Parameters
dirPathPath to check read/write access.
throwIfFailsThrow exception if not writable when true.
Returns
True if path is writable, else false or throws exception.

◆ ProcessResourceTags() [1/3]

static String SolidFramework.Plumbing.Utilities.ProcessResourceTags ( String  value)
static

Replaces {n}, {CR} and {amp} tags in the string value with NewLine or Ampersand.

Parameters
valueA string that may contain resource tags.
Returns
A string where the tags have been converted.

◆ ProcessResourceTags() [2/3]

static String SolidFramework.Plumbing.Utilities.ProcessResourceTags ( String  value,
String  arg1 
)
static

Replace a single placeholder in a string, and converts any {n}, {CR} and {amp} tags.

Parameters
valueA string that may contain a placeholder in the format "{0}".
arg1A string that should be used to replace the placeholder "{0}".
Returns
A string where the replacements have been made.

◆ ProcessResourceTags() [3/3]

static String SolidFramework.Plumbing.Utilities.ProcessResourceTags ( String  value,
String  arg1,
String  arg2 
)
static

Replace two placeholders in a string, and converts any {n}, {CR} and {amp} tags.

Parameters
valueA string that may contain a placeholder in the format "{1}" and {2}.
arg1A string that should be used to replace the placeholder "{1}".
arg2A string that should be used to replace the placeholder "{2}".
Returns
A string where the replacements have been made.

If the string contains a placeholder in the format {0}, then only the second placeholder will be converted. This may not be the expected behaviour. This method appears to not be used.

◆ RotateLogFile()

static void SolidFramework.Plumbing.Utilities.RotateLogFile ( String  path,
long  rotateFileSize 
)
static

Utility method for changing the logfile when it becomes larger than the specified size. In that event, the logfile will be renamed from [filename] to [filename_1], with any file with that name being renamed as [filename_2]. If there are already two existing log files, so that a file exists that is already called [filename_2], then that will be deleted.

Parameters
pathPath to the file
rotateFileSizeThe size of the file, in bytes, which if exceeded when this method is called, will cause the file names to be incremented.

◆ ValidationModeToString()

static String SolidFramework.Plumbing.Utilities.ValidationModeToString ( ValidationMode  mode)
static

Returns a string representation of the ValidationMode.

Parameters
modeThe ValidationMode that is to be converted.
Returns
A string that represents the mode .
Exceptions
NotImplementedExceptionOccurs if mode is not a supported type.