SalesForceBackup/Backup.cs
/// <summary>
/// Renames a file to match the required backup storage pattern.
/// </summary>
/// <param name="file">The file to rename.</param>
/// <returns>The full name and filepath of the new file.</returns>
/// <remarks>Uses the following pattern: salesforce/YYYY-MM-DD_HH-MM.* </remarks>
Renames a file to match the required backup storage pattern.
Renames a file to match the required backup storage pattern .
private string RenameFile(string file)
        {
            var i = -1;
            string newFile;
            do
            {
                newFile = String.Join(Path.DirectorySeparatorChar.ToString(CultureInfo.InvariantCulture),
                    new[] { Path.GetDirectoryName(file), FormatFileName(Path.GetExtension(file), ++i) });
            } while (File.Exists(newFile));
            File.Move(file, newFile);
            return newFile;
        }
private string RenameFile ( string file ) { var i = - 1 ; string newFile ; do { newFile = String . Join ( Path . DirectorySeparatorChar . ToString ( CultureInfo . InvariantCulture ) , new [ ] { Path . GetDirectoryName ( file ) , FormatFileName ( Path . GetExtension ( file ) , ++ i ) } ) ; } while ( File . Exists ( newFile ) ) ; File . Move ( file , newFile ) ; return newFile ; }
Renames a file to match the required backup storage pattern.
Renames a file to match the required backup storage pattern .
The full name and filepath of the new file.
The full name and filepath of the new file .
file
string
The file to rename.
The file to rename .
remarks
Uses the following pattern: salesforce/YYYY-MM-DD_HH-MM.
Uses the following pattern : salesforce / YYYY - MM - DD_HH - MM .