Craig's Utility Library  4.0 Beta
Utilities.IO.FileSystem.Interfaces.IFile Interface Reference

Represents an individual file More...

Inheritance diagram for Utilities.IO.FileSystem.Interfaces.IFile:
Utilities.IO.FileInfo Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >

Public Member Functions

IFile CopyTo (IDirectory Directory, bool Overwrite)
 Copies the file to another directory More...
 
string Delete ()
 Deletes the file More...
 
void MoveTo (IDirectory Directory)
 Moves the file to another directory More...
 
string Read ()
 Reads the file to the end as a string More...
 
byte[] ReadBinary ()
 Reads the file to the end as a byte array More...
 
void Rename (string NewName)
 Renames the file More...
 
string Write (string Content, FileMode Mode=FileMode.Create, Encoding Encoding=null)
 Writes content to the file More...
 
byte[] Write (byte[] Content, FileMode Mode=FileMode.Create)
 Writes content to the file More...
 

Properties

DateTime Accessed [get]
 Last time the file was accessed More...
 
DateTime Created [get]
 When the file was created More...
 
IDirectory Directory [get]
 Directory the file is in More...
 
bool Exists [get]
 Does the file exist currently More...
 
string Extension [get]
 File extension More...
 
string FullName [get]
 Full path to the file More...
 
long Length [get]
 Size of the file in bytes More...
 
DateTime Modified [get]
 When the file was last modified More...
 
string Name [get]
 File name More...
 

Detailed Description

Represents an individual file

Definition at line 34 of file IFile.cs.

Member Function Documentation

IFile Utilities.IO.FileSystem.Interfaces.IFile.CopyTo ( IDirectory  Directory,
bool  Overwrite 
)

Copies the file to another directory

Parameters
DirectoryDirectory to copy the file to
OverwriteShould the file overwrite another file if found
Returns
The newly created file

Implemented in Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >, and Utilities.IO.FileInfo.

string Utilities.IO.FileSystem.Interfaces.IFile.Delete ( )

Deletes the file

Returns
Any response for deleting the resource (usually FTP, HTTP, etc)

Implemented in Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >, and Utilities.IO.FileInfo.

void Utilities.IO.FileSystem.Interfaces.IFile.MoveTo ( IDirectory  Directory)

Moves the file to another directory

Parameters
DirectoryDirectory to move the file to

Implemented in Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >, and Utilities.IO.FileInfo.

string Utilities.IO.FileSystem.Interfaces.IFile.Read ( )

Reads the file to the end as a string

Returns
A string containing the contents of the file

Implemented in Utilities.IO.FileInfo, and Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >.

byte [] Utilities.IO.FileSystem.Interfaces.IFile.ReadBinary ( )

Reads the file to the end as a byte array

Returns
A byte array containing the contents of the file

Implemented in Utilities.IO.FileInfo, and Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >.

void Utilities.IO.FileSystem.Interfaces.IFile.Rename ( string  NewName)

Renames the file

Parameters
NewNameNew file name

Implemented in Utilities.IO.FileInfo, and Utilities.IO.FileSystem.BaseClasses.FileBase< InternalFileType, FileType >.

string Utilities.IO.FileSystem.Interfaces.IFile.Write ( string  Content,
FileMode  Mode = FileMode.Create,
Encoding  Encoding = null 
)

Writes content to the file

Parameters
ContentContent to write
ModeFile mode
EncodingEncoding that the content should be saved as (default is UTF8)
Returns
The result of the write or original content
byte [] Utilities.IO.FileSystem.Interfaces.IFile.Write ( byte[]  Content,
FileMode  Mode = FileMode.Create 
)

Writes content to the file

Parameters
ContentContent to write
ModeFile mode
Returns
The result of the write or original content

Property Documentation

DateTime Utilities.IO.FileSystem.Interfaces.IFile.Accessed
get

Last time the file was accessed

Definition at line 39 of file IFile.cs.

DateTime Utilities.IO.FileSystem.Interfaces.IFile.Created
get

When the file was created

Definition at line 44 of file IFile.cs.

IDirectory Utilities.IO.FileSystem.Interfaces.IFile.Directory
get

Directory the file is in

Definition at line 49 of file IFile.cs.

bool Utilities.IO.FileSystem.Interfaces.IFile.Exists
get

Does the file exist currently

Definition at line 54 of file IFile.cs.

string Utilities.IO.FileSystem.Interfaces.IFile.Extension
get

File extension

Definition at line 59 of file IFile.cs.

string Utilities.IO.FileSystem.Interfaces.IFile.FullName
get

Full path to the file

Definition at line 64 of file IFile.cs.

long Utilities.IO.FileSystem.Interfaces.IFile.Length
get

Size of the file in bytes

Definition at line 69 of file IFile.cs.

DateTime Utilities.IO.FileSystem.Interfaces.IFile.Modified
get

When the file was last modified

Definition at line 74 of file IFile.cs.

string Utilities.IO.FileSystem.Interfaces.IFile.Name
get

File name

Definition at line 79 of file IFile.cs.


The documentation for this interface was generated from the following file: