Class PhysicalFile
  
  Wrapper for the static class System.IO.File 
 
  
  
    Inheritance
    System.Object
    PhysicalFile
   
  
  
    Inherited Members
    
      System.Object.ToString()
    
    
      System.Object.Equals(System.Object)
    
    
      System.Object.Equals(System.Object, System.Object)
    
    
      System.Object.ReferenceEquals(System.Object, System.Object)
    
    
      System.Object.GetHashCode()
    
    
      System.Object.GetType()
    
    
      System.Object.MemberwiseClone()
    
   
  
  Assembly: EPiServer.Framework.dll
  Version: 8.11.0
  Syntax
  
    public class PhysicalFile : IFile
   
  Constructors
  
  
  
  
  PhysicalFile()
  
  
  Declaration
  
  Methods
  
  
  
  
  AppendAllLines(String, IEnumerable<String>)
  
  
  Declaration
  
    public void AppendAllLines(string path, IEnumerable<string> contents)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Collections.Generic.IEnumerable<System.String> | 
        contents | 
         | 
      
    
  
  
  
  
  AppendAllLines(String, IEnumerable<String>, Encoding)
  
  
  Declaration
  
    public void AppendAllLines(string path, IEnumerable<string> contents, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Collections.Generic.IEnumerable<System.String> | 
        contents | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  
  
  
  AppendAllText(String, String)
  
  
  Declaration
  
    public void AppendAllText(string path, string contents)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.String | 
        contents | 
         | 
      
    
  
  
  
  
  AppendAllText(String, String, Encoding)
  
  
  Declaration
  
    public void AppendAllText(string path, string contents, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.String | 
        contents | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  
  
  
  AppendText(String)
  
  
  Declaration
  
    public StreamWriter AppendText(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.StreamWriter | 
         | 
      
    
  
  
  
  
  Copy(String, String)
  
  
  Declaration
  
    public void Copy(string sourceFileName, string destinationFileName)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        sourceFileName | 
         | 
      
      
        | System.String | 
        destinationFileName | 
         | 
      
    
  
  
  
  
  Copy(String, String, Boolean)
  
  
  Declaration
  
    public void Copy(string sourceFileName, string destinationFileName, bool overwrite)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        sourceFileName | 
         | 
      
      
        | System.String | 
        destinationFileName | 
         | 
      
      
        | System.Boolean | 
        overwrite | 
         | 
      
    
  
  
  
  
  Create(String)
  
  
  Declaration
  
    public FileStream Create(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  Create(String, Int32)
  
  
  Declaration
  
    public FileStream Create(string path, int bufferSize)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Int32 | 
        bufferSize | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  Create(String, Int32, FileOptions)
  
  
  Declaration
  
    public FileStream Create(string path, int bufferSize, FileOptions options)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Int32 | 
        bufferSize | 
         | 
      
      
        | System.IO.FileOptions | 
        options | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  CreateText(String)
  
  
  Declaration
  
    public StreamWriter CreateText(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.StreamWriter | 
         | 
      
    
  
  
  
  
  Decrypt(String)
  
  
  Declaration
  
    public void Decrypt(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  
  
  
  Delete(String)
  
  
  Declaration
  
    public void Delete(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  
  
  
  Encrypt(String)
  
  
  Declaration
  
    public void Encrypt(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  
  
  
  Exists(String)
  
  
  Declaration
  
    public bool Exists(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Boolean | 
         | 
      
    
  
  
  
  
  GetAttributes(String)
  
  
  Declaration
  
    public FileAttributes GetAttributes(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileAttributes | 
         | 
      
    
  
  
  
  
  GetCreationTime(String)
  
  
  Declaration
  
    public DateTime GetCreationTime(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.DateTime | 
         | 
      
    
  
  
  
  
  GetCreationTimeUtc(String)
  
  
  Declaration
  
    public DateTime GetCreationTimeUtc(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.DateTime | 
         | 
      
    
  
  
  
  
  GetLastAccessTime(String)
  
  
  Declaration
  
    public DateTime GetLastAccessTime(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.DateTime | 
         | 
      
    
  
  
  
  
  GetLastAccessTimeUtc(String)
  
  
  Declaration
  
    public DateTime GetLastAccessTimeUtc(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.DateTime | 
         | 
      
    
  
  
  
  
  GetLastWriteTime(String)
  
  
  Declaration
  
    public DateTime GetLastWriteTime(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.DateTime | 
         | 
      
    
  
  
  
  
  GetLastWriteTimeUtc(String)
  
  
  Declaration
  
    public DateTime GetLastWriteTimeUtc(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.DateTime | 
         | 
      
    
  
  
  
  
  Move(String, String)
  
  
  Declaration
  
    public void Move(string sourceFileName, string destinationFileName)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        sourceFileName | 
         | 
      
      
        | System.String | 
        destinationFileName | 
         | 
      
    
  
  
  
  
  Open(String, FileMode)
  
  
  Declaration
  
    public FileStream Open(string path, FileMode mode)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.IO.FileMode | 
        mode | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  Open(String, FileMode, FileAccess)
  
  
  Declaration
  
    public FileStream Open(string path, FileMode mode, FileAccess access)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.IO.FileMode | 
        mode | 
         | 
      
      
        | System.IO.FileAccess | 
        access | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  Open(String, FileMode, FileAccess, FileShare)
  
  
  Declaration
  
    public FileStream Open(string path, FileMode mode, FileAccess access, FileShare share)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.IO.FileMode | 
        mode | 
         | 
      
      
        | System.IO.FileAccess | 
        access | 
         | 
      
      
        | System.IO.FileShare | 
        share | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  OpenRead(String)
  
  
  Declaration
  
    public FileStream OpenRead(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  OpenText(String)
  
  
  Declaration
  
    public StreamReader OpenText(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.StreamReader | 
         | 
      
    
  
  
  
  
  OpenWrite(String)
  
  
  Declaration
  
    public FileStream OpenWrite(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.IO.FileStream | 
         | 
      
    
  
  
  
  
  ReadAllBytes(String)
  
  
  Declaration
  
    public byte[] ReadAllBytes(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Byte[] | 
         | 
      
    
  
  
  
  
  ReadAllLines(String)
  
  
  Declaration
  
    public string[] ReadAllLines(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String[] | 
         | 
      
    
  
  
  
  
  ReadAllLines(String, Encoding)
  
  
  Declaration
  
    public string[] ReadAllLines(string path, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String[] | 
         | 
      
    
  
  
  
  
  ReadAllText(String)
  
  
  Declaration
  
    public string ReadAllText(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  ReadAllText(String, Encoding)
  
  
  Declaration
  
    public string ReadAllText(string path, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.String | 
         | 
      
    
  
  
  
  
  ReadLines(String)
  
  
  Declaration
  
    public IEnumerable<string> ReadLines(string path)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Collections.Generic.IEnumerable<System.String> | 
         | 
      
    
  
  
  
  
  ReadLines(String, Encoding)
  
  
  Declaration
  
    public IEnumerable<string> ReadLines(string path, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  Returns
  
    
      
        | Type | 
        Description | 
      
    
    
      
        | System.Collections.Generic.IEnumerable<System.String> | 
         | 
      
    
  
  
  
  
  Replace(String, String, String)
  
  
  Declaration
  
    public void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        sourceFileName | 
         | 
      
      
        | System.String | 
        destinationFileName | 
         | 
      
      
        | System.String | 
        destinationBackupFileName | 
         | 
      
    
  
  
  
  
  Replace(String, String, String, Boolean)
  
  
  Declaration
  
    public void Replace(string sourceFileName, string destinationFileName, string destinationBackupFileName, bool ignoreMetadataErrors)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        sourceFileName | 
         | 
      
      
        | System.String | 
        destinationFileName | 
         | 
      
      
        | System.String | 
        destinationBackupFileName | 
         | 
      
      
        | System.Boolean | 
        ignoreMetadataErrors | 
         | 
      
    
  
  
  
  
  SetAttributes(String, FileAttributes)
  
  
  Declaration
  
    public void SetAttributes(string path, FileAttributes fileAttributes)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.IO.FileAttributes | 
        fileAttributes | 
         | 
      
    
  
  
  
  
  SetCreationTime(String, DateTime)
  
  
  Declaration
  
    public void SetCreationTime(string path, DateTime creationTime)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.DateTime | 
        creationTime | 
         | 
      
    
  
  
  
  
  SetCreationTimeUtc(String, DateTime)
  
  
  Declaration
  
    public void SetCreationTimeUtc(string path, DateTime creationTimeUtc)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.DateTime | 
        creationTimeUtc | 
         | 
      
    
  
  
  
  
  SetLastAccessTime(String, DateTime)
  
  
  Declaration
  
    public void SetLastAccessTime(string path, DateTime lastAccessTime)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.DateTime | 
        lastAccessTime | 
         | 
      
    
  
  
  
  
  SetLastAccessTimeUtc(String, DateTime)
  
  
  Declaration
  
    public void SetLastAccessTimeUtc(string path, DateTime lastAccessTimeUtc)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.DateTime | 
        lastAccessTimeUtc | 
         | 
      
    
  
  
  
  
  SetLastWriteTime(String, DateTime)
  
  
  Declaration
  
    public void SetLastWriteTime(string path, DateTime lastWriteTime)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.DateTime | 
        lastWriteTime | 
         | 
      
    
  
  
  
  
  SetLastWriteTimeUtc(String, DateTime)
  
  
  Declaration
  
    public void SetLastWriteTimeUtc(string path, DateTime lastWriteTimeUtc)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.DateTime | 
        lastWriteTimeUtc | 
         | 
      
    
  
  
  
  
  WriteAllBytes(String, Byte[])
  
  
  Declaration
  
    public void WriteAllBytes(string path, byte[] bytes)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Byte[] | 
        bytes | 
         | 
      
    
  
  
  
  
  WriteAllLines(String, IEnumerable<String>)
  
  
  Declaration
  
    public void WriteAllLines(string path, IEnumerable<string> contents)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Collections.Generic.IEnumerable<System.String> | 
        contents | 
         | 
      
    
  
  
  
  
  WriteAllLines(String, IEnumerable<String>, Encoding)
  
  
  Declaration
  
    public void WriteAllLines(string path, IEnumerable<string> contents, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.Collections.Generic.IEnumerable<System.String> | 
        contents | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  
  
  
  WriteAllLines(String, String[])
  
  
  Declaration
  
    public void WriteAllLines(string path, string[] contents)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.String[] | 
        contents | 
         | 
      
    
  
  
  
  
  WriteAllLines(String, String[], Encoding)
  
  
  Declaration
  
    public void WriteAllLines(string path, string[] contents, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.String[] | 
        contents | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  
  
  
  WriteAllText(String, String)
  
  
  Declaration
  
    public void WriteAllText(string path, string contents)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.String | 
        contents | 
         | 
      
    
  
  
  
  
  WriteAllText(String, String, Encoding)
  
  
  Declaration
  
    public void WriteAllText(string path, string contents, Encoding encoding)
   
  Parameters
  
    
      
        | Type | 
        Name | 
        Description | 
      
    
    
      
        | System.String | 
        path | 
         | 
      
      
        | System.String | 
        contents | 
         | 
      
      
        | System.Text.Encoding | 
        encoding | 
         | 
      
    
  
  Implements