aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/WixToolset.Data/Common.cs40
-rw-r--r--src/WixToolset.Data/WixFileNotFoundException.cs43
2 files changed, 0 insertions, 83 deletions
diff --git a/src/WixToolset.Data/Common.cs b/src/WixToolset.Data/Common.cs
deleted file mode 100644
index f75ad33e..00000000
--- a/src/WixToolset.Data/Common.cs
+++ /dev/null
@@ -1,40 +0,0 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Data
4{
5 using System;
6 using System.IO;
7 using System.Security.Cryptography;
8 using System.Text;
9 using System.Text.RegularExpressions;
10 using System.Xml.Linq;
11
12 internal static class Common
13 {
14 public const int IntegerNotSet = Int32.MinValue;
15
16 internal static readonly XNamespace W3SchemaPrefix = "http://www.w3.org/";
17
18 internal static readonly string[] ReservedFileNames = { "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };
19
20 internal static string GetFileHash(FileInfo fileInfo)
21 {
22 byte[] hashBytes;
23 using (SHA1Managed managed = new SHA1Managed())
24 {
25 using (FileStream stream = fileInfo.OpenRead())
26 {
27 hashBytes = managed.ComputeHash(stream);
28 }
29 }
30
31 StringBuilder sb = new StringBuilder();
32 for (int i = 0; i < hashBytes.Length; i++)
33 {
34 sb.AppendFormat("{0:X2}", hashBytes[i]);
35 }
36
37 return sb.ToString();
38 }
39 }
40}
diff --git a/src/WixToolset.Data/WixFileNotFoundException.cs b/src/WixToolset.Data/WixFileNotFoundException.cs
deleted file mode 100644
index c497253c..00000000
--- a/src/WixToolset.Data/WixFileNotFoundException.cs
+++ /dev/null
@@ -1,43 +0,0 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3namespace WixToolset.Data
4{
5 using System;
6
7 /// <summary>
8 /// WixException thrown when a file cannot be found.
9 /// </summary>
10 [Serializable]
11 public sealed class WixFileNotFoundException : WixException
12 {
13 /// <summary>
14 /// Instantiate a new WixFileNotFoundException.
15 /// </summary>
16 /// <param name="sourceLineNumbers">Source line information pertaining to the file that cannot be found.</param>
17 /// <param name="file">The file that could not be found.</param>
18 public WixFileNotFoundException(SourceLineNumber sourceLineNumbers, string file) :
19 base(ErrorMessages.FileNotFound(sourceLineNumbers, file))
20 {
21 }
22
23 /// <summary>
24 /// Instantiate a new WixFileNotFoundException.
25 /// </summary>
26 /// <param name="file">The file that could not be found.</param>
27 /// <param name="fileType">The type of file that cannot be found.</param>
28 public WixFileNotFoundException(string file, string fileType) : this(null, file, fileType)
29 {
30 }
31
32 /// <summary>
33 /// Instantiate a new WixFileNotFoundException.
34 /// </summary>
35 /// <param name="sourceLineNumbers">Source line information pertaining to the file that cannot be found.</param>
36 /// <param name="file">The file that could not be found.</param>
37 /// <param name="fileType">The type of file that cannot be found.</param>
38 public WixFileNotFoundException(SourceLineNumber sourceLineNumbers, string file, string fileType) :
39 base(ErrorMessages.FileNotFound(sourceLineNumbers, file, fileType))
40 {
41 }
42 }
43}