src/BloomExe/CollectionTab/LibraryModel.cs
/// <summary>
/// Zip up the book folder, excluding .pdf, .bloombookorder, .map, .bloompack, .db files.
/// The resulting file should have a .bloomSource extension, but this depends on properly
/// setting the value of destFileName before calling this method.  TeamCollection still
/// uses the .bloom extension until we can figure out how to safely migrate teams as a
/// whole to using .bloomSource.
/// </summary>
/// <param name="exception">any exception which occurs when trying to save the file</param>
/// <returns>true if file was saved successfully; false otherwise</returns>
/// <remarks>if return value is false, exception is non-null and vice versa</remarks>
Zip up the book folder, excluding .pdf, .bloombookorder, .map, .bloompack, .db files.
The resulting file should have a .bloomSource extension, but this depends on properly
setting the value of destFileName before calling this method.  TeamCollection still
uses the .bloom extension until we can figure out how to safely migrate teams as a
whole to using .bloomSource.
Zip up the book folder excluding . pdf . bloombookorder . map . bloompack . db files . The resulting file should have a . bloomSource extension but this depends on properly setting the value of destFileName before calling this method . TeamCollection still uses the . bloom extension until we can figure out how to safely migrate teams as a whole to using . bloomSource .
public static bool SaveAsBloomSourceFile(string srcFolderName, string destFileName, out Exception exception)
		{
			exception = null;
			try
			{
				var excludedExtensions = new[] { ".pdf", ".bloombookorder", ".map", ".bloompack", ".db" };
				Logger.WriteEvent("Zipping up {0} ...", destFileName);
				var zipFile = new BloomZipFile(destFileName);
				zipFile.AddDirectoryContents(srcFolderName, excludedExtensions);
				Logger.WriteEvent("Saving {0} ...", destFileName);
				zipFile.Save();
				if (destFileName.EndsWith(".bloom"))
					Logger.WriteEvent("Finished writing .bloom file.");
				else
					Logger.WriteEvent("Finished writing .bloomSource file.");
			}
			catch (Exception e)
			{
				exception = e;
				return false;
			}
			return true;
		}
public static bool SaveAsBloomSourceFile ( string srcFolderName , string destFileName , out Exception exception ) { exception = null ; try { var excludedExtensions = new [ ] { " " , " " , " " , " " , " " } ; Logger . WriteEvent ( " " , destFileName ) ; var zipFile = new BloomZipFile ( destFileName ) ; zipFile . AddDirectoryContents ( srcFolderName , excludedExtensions ) ; Logger . WriteEvent ( " " , destFileName ) ; zipFile . Save ( ) ; if ( destFileName . EndsWith ( " " ) ) Logger . WriteEvent ( " " ) ; else Logger . WriteEvent ( " " ) ; } catch ( Exception e ) { exception = e ; return false ; } return true ; }
Zip up the book folder, excluding .pdf, .bloombookorder, .map, .bloompack, .db files.
Zip up the book folder excluding . pdf . bloombookorder . map . bloompack . db files .
true if file was saved successfully; false otherwise
true if file was saved successfully ; false otherwise
srcFolderName
string
destFileName
string
Exception
out
exception
any exception which occurs when trying to save the file
any exception which occurs when trying to save the file
remarks
if return value is false, exception is non-null and vice versa
if return value is false exception is non - null and vice versa