C# Class NuxeoClient.IOHelper

Provides helper methods for IO operations.
Show file Open project: nuxeo/nuxeo-dotnet-client

Public Methods

Method Description
AreFilesEqual ( string file1, string file2 ) : bool

Compares two files based on their contents. Source: https://support.microsoft.com/en-us/kb/320348

CreateTempFile ( ) : FileInfo

Creates a temporary file.

CreateTempFile ( Stream content ) : FileInfo

Creates a temporary file from a supplied Stream.

CreateTempFile ( string content ) : FileInfo

Creates a temporary file with the specified string as a content.

ReadText ( FileInfo file ) : string

Reads a file as a text file.

ReadText ( string path ) : string

Reads a file as a text file.

ReadTextAsync ( FileInfo file ) : Task

Reads a file as a text file asynchronously.

ReadTextAsync ( string path ) : Task

Reads a file as a text file asynchronously.

Method Details

AreFilesEqual() public static method

Compares two files based on their contents. Source: https://support.microsoft.com/en-us/kb/320348
public static AreFilesEqual ( string file1, string file2 ) : bool
file1 string One file to be compared.
file2 string Another file to be compared.
return bool

CreateTempFile() public static method

Creates a temporary file.
public static CreateTempFile ( ) : FileInfo
return System.IO.FileInfo

CreateTempFile() public static method

Creates a temporary file from a supplied Stream.
public static CreateTempFile ( Stream content ) : FileInfo
content System.IO.Stream The stream from which to create a file.
return System.IO.FileInfo

CreateTempFile() public static method

Creates a temporary file with the specified string as a content.
public static CreateTempFile ( string content ) : FileInfo
content string The file content.
return System.IO.FileInfo

ReadText() public static method

Reads a file as a text file.
public static ReadText ( FileInfo file ) : string
file System.IO.FileInfo The file's .
return string

ReadText() public static method

Reads a file as a text file.
public static ReadText ( string path ) : string
path string The file's path.
return string

ReadTextAsync() public static method

Reads a file as a text file asynchronously.
public static ReadTextAsync ( FileInfo file ) : Task
file System.IO.FileInfo The file's .
return Task

ReadTextAsync() public static method

Reads a file as a text file asynchronously.
public static ReadTextAsync ( string path ) : Task
path string The file's path.
return Task