Click or drag to resize
AbstractFile Class
Abstract class for file providers.
Inheritance Hierarchy

Namespace: CMS.IO
Assembly: CMS.IO (in CMS.IO.dll) Version: 8.2.23
Syntax
C#
public abstract class AbstractFile

The AbstractFile type exposes the following members.

Constructors
  NameDescription
Protected methodAbstractFile
Top
Methods
  NameDescription
Public methodAppendAllText(String, String)
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
Public methodAppendAllText(String, String, Encoding)
Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file.
Public methodCopy(String, String)
Copies an existing file to a new file.
Public methodCopy(String, String, Boolean)
Copies an existing file to a new file. Overwriting a file of the same name is allowed.
Public methodCreate
Creates or overwrites a file in the specified path.
Public methodCreateText
Creates or opens a file for writing UTF-8 encoded text.
Public methodDelete
Deletes the specified file. An exception is not thrown if the specified file does not exist.
Public methodExists
Determines whether the specified file exists.
Public methodGetAccessControl
Gets a DirectorySecurity object that encapsulates the access control list (ACL) entries for a specified directory.
Public methodGetFileUrl
Returns URL to file. If can be accessed directly then direct URL is generated else URL with GetFile page is generated.
Public methodGetLastWriteTime
Returns the date and time the specified file or directory was last written to.
Public methodMove
Moves a specified file to a new location, providing the option to specify a new file name.
Public methodOpen
Opens a FileStream on the specified path, with the specified mode and access.
Public methodOpenRead
Opens an existing file for reading.
Public methodOpenText
Opens an existing UTF-8 encoded text file for reading.
Public methodReadAllBytes
Opens a binary file, reads the contents of the file into a byte array, and then closes the file.
Public methodReadAllText(String)
Opens a text file, reads all lines of the file, and then closes the file.
Public methodReadAllText(String, Encoding)
Opens a text file, reads all lines of the file, and then closes the file.
Public methodSetAttributes
Sets the specified FileAttributes of the file on the specified path.
Public methodSetLastWriteTime
Sets the date and time that the specified file was last written to.
Public methodSetLastWriteTimeUtc
Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to.
Public methodWriteAllBytes
Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten.
Public methodWriteAllText(String, String)
Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
Public methodWriteAllText(String, String, Encoding)
Creates a new file, write the contents to the file, and then closes the file. If the target file already exists, it is overwritten.
Top
Extension Methods
  NameDescription
Public Extension MethodAsValue
Converts object to a query value which can be used as a query parameter
(Defined by QueryExtensions.)
Public Extension MethodGetAPIString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodGetString
Gets the string by the specified resource key
(Defined by CoreExtensions.)
Public Extension MethodToBoolean
Returns the boolean representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDateTime
Returns the DateTime representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToDouble
Returns the double representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToGuid
Returns the Guid representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToInteger
Returns the integer representation of an object or default value if not.
(Defined by CoreExtensions.)
Public Extension MethodToString
Returns the string representation of an object or default value if not.
(Defined by CoreExtensions.)
Top
See Also