Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
removed Delimon and Added AlphaFS
  • Loading branch information
prestoncooper authored Dec 18, 2023
1 parent 739bb7b commit 6c17c2f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 30 deletions.
Binary file added ContentDetectorLibrary/AlphaFS.dll
Binary file not shown.
24 changes: 12 additions & 12 deletions ContentDetectorLibrary/Common.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ public FileResult()
Deleted = false;
}

public FileResult(Delimon.Win32.IO.DirectoryInfo ddir)
public FileResult(Alphaleonis.Win32.Filesystem.DirectoryInfo ddir)
{
FileResultContructor(ddir, "", "");
}

public FileResult(Delimon.Win32.IO.DirectoryInfo ddir, string strComment)
public FileResult(Alphaleonis.Win32.Filesystem.DirectoryInfo ddir, string strComment)
{
FileResultContructor(ddir, strComment, "");
}

private void FileResultContructor(Delimon.Win32.IO.DirectoryInfo ddir, string strComment, string strFileFilterSearched)
private void FileResultContructor(Alphaleonis.Win32.Filesystem.DirectoryInfo ddir, string strComment, string strFileFilterSearched)
{
Name = ddir.Name;
FullPath = ddir.FullName;
Expand All @@ -82,22 +82,22 @@ private void FileResultContructor(Delimon.Win32.IO.DirectoryInfo ddir, string st
Deleted = false;
}

public FileResult(Delimon.Win32.IO.DirectoryInfo ddir, string strComment, string strFileFilterSearched)
public FileResult(Alphaleonis.Win32.Filesystem.DirectoryInfo ddir, string strComment, string strFileFilterSearched)
{
FileResultContructor(ddir, strComment, strFileFilterSearched);
}

public FileResult(Delimon.Win32.IO.FileInfo dfile)
public FileResult(Alphaleonis.Win32.Filesystem.FileInfo dfile)
{
FileResultContructor(dfile, "", "");
}

public FileResult(Delimon.Win32.IO.FileInfo dfile, string strComment)
public FileResult(Alphaleonis.Win32.Filesystem.FileInfo dfile, string strComment)
{
FileResultContructor(dfile, strComment, "");
}

private void FileResultContructor(Delimon.Win32.IO.FileInfo dfile, string strComment, string strFileFilterSearched)
private void FileResultContructor(Alphaleonis.Win32.Filesystem.FileInfo dfile, string strComment, string strFileFilterSearched)
{
Name = dfile.Name;
FullPath = dfile.FullName;
Expand All @@ -113,7 +113,7 @@ private void FileResultContructor(Delimon.Win32.IO.FileInfo dfile, string strCom
Deleted = false;
}

public FileResult(Delimon.Win32.IO.FileInfo dfile, string strComment, string strFileFilterSearched)
public FileResult(Alphaleonis.Win32.Filesystem.FileInfo dfile, string strComment, string strFileFilterSearched)
{
FileResultContructor(dfile, strComment, strFileFilterSearched);

Expand Down Expand Up @@ -339,7 +339,7 @@ public static string GetPathToHTMLAnchor(string strpath)
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static bool IsFileLocked(Delimon.Win32.IO.FileInfo file)
public static bool IsFileLocked(Alphaleonis.Win32.Filesystem.FileInfo file)
{
FileStream stream = null;
try
Expand Down Expand Up @@ -383,7 +383,7 @@ public static bool IsFileLocked(Delimon.Win32.IO.FileInfo file)
/// </summary>
/// <param name="file"></param>
/// <returns></returns>
public static Delimon.Win32.IO.FileInfo RefreshFileInfo(Delimon.Win32.IO.FileInfo file)
public static Alphaleonis.Win32.Filesystem.FileInfo RefreshFileInfo(Alphaleonis.Win32.Filesystem.FileInfo file)
{
FileStream fs = null;
try
Expand Down Expand Up @@ -435,7 +435,7 @@ public static bool DirectoryExists(string strPath)
try
{
strPath = WindowsPathClean(strPath);
blSuccess = Delimon.Win32.IO.Directory.Exists(strPath);
blSuccess = Alphaleonis.Win32.Filesystem.Directory.Exists(strPath);
}
catch (Exception)
{
Expand All @@ -450,7 +450,7 @@ public static bool FileExists(string strPath)
try
{
strPath = WindowsPathClean(strPath);
blSuccess = Delimon.Win32.IO.File.Exists(strPath);
blSuccess = Alphaleonis.Win32.Filesystem.File.Exists(strPath);
}
catch (Exception)
{
Expand Down
28 changes: 14 additions & 14 deletions ContentDetectorLibrary/ContentDetectorEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public static DataTable init_dtSignature()
/// <param name="filePath">The file path.</param>
/// <returns></returns>
private bool ContainsProhibitedFileContent(
Delimon.Win32.IO.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
Alphaleonis.Win32.Filesystem.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
{
WriteError(string.Format(
@"Audit Folder ContentDetectorEngine: Processing content of file '{0}' ({1:0,0} bytes).",
Expand Down Expand Up @@ -355,7 +355,7 @@ private bool ContainsProhibitedFileContent(
}

public void ContainsFolderVerifyContent(
Delimon.Win32.IO.DirectoryInfo folderPath,
Alphaleonis.Win32.Filesystem.DirectoryInfo folderPath,
bool recursive,
ref List<FileResult> verifiedFiles,
ref List<FileResult> unVerifiedFiles,
Expand Down Expand Up @@ -383,7 +383,7 @@ bool blProhibitedFilesIgnoreFileExtensions
/// [the specified folder path]; otherwise, <c>false</c>.
/// </returns>
public void ContainsFolderVerifyContent(
Delimon.Win32.IO.DirectoryInfo folderPath,
Alphaleonis.Win32.Filesystem.DirectoryInfo folderPath,
bool recursive,
ref List<FileResult> verifiedFiles,
ref List<FileResult> unVerifiedFiles,
Expand Down Expand Up @@ -450,7 +450,7 @@ bool blProhibitedFilesIgnoreFileExtensions
/// [the specified folder path]; otherwise, <c>false</c>.
/// </returns>
private void containsFolderVerifyContent(
Delimon.Win32.IO.DirectoryInfo folderPath,
Alphaleonis.Win32.Filesystem.DirectoryInfo folderPath,
bool recursive,
ref List<FileResult> verifiedFiles,
ref List<FileResult> unVerifiedFiles,
Expand All @@ -475,17 +475,17 @@ bool blProhibitedFilesIgnoreFileExtensions
{
sigs = HeaderSignature.StockSignatures;
}



Delimon.Win32.IO.FileInfo[] filePaths = folderPath.GetFiles();


Alphaleonis.Win32.Filesystem.FileInfo[] filePaths = folderPath.GetFiles();

int index = 0;
//Load either default signatures or custom for determining ExtensionSupported?



foreach (Delimon.Win32.IO.FileInfo filePath in filePaths)
foreach (Alphaleonis.Win32.Filesystem.FileInfo filePath in filePaths)
{
if (blShuttingDown)
{
Expand Down Expand Up @@ -517,7 +517,7 @@ bool blProhibitedFilesIgnoreFileExtensions
{
if (blValidateZipFiles && HeaderSignature.ZipRelatedExtension(filePath.Extension))
{
using (Stream filestream1 = filePath.Open(Delimon.Win32.IO.FileMode.Open, Delimon.Win32.IO.FileAccess.Read, Delimon.Win32.IO.FileShare.ReadWrite))
using (Stream filestream1 = filePath.Open(System.IO.FileMode.Open, System.IO.FileAccess.Read, System.IO.FileShare.ReadWrite))
{

try
Expand Down Expand Up @@ -605,9 +605,9 @@ bool blProhibitedFilesIgnoreFileExtensions

if (recursive)
{
Delimon.Win32.IO.DirectoryInfo[] folderPaths = folderPath.GetDirectories();
Alphaleonis.Win32.Filesystem.DirectoryInfo[] folderPaths = folderPath.GetDirectories();

foreach (Delimon.Win32.IO.DirectoryInfo childFolderPath in folderPaths)
foreach (Alphaleonis.Win32.Filesystem.DirectoryInfo childFolderPath in folderPaths)
{
bool blIgnoreDirectory = false;
if (blShuttingDown)
Expand Down Expand Up @@ -668,7 +668,7 @@ bool blProhibitedFilesIgnoreFileExtensions
/// <param name="indentLevel">The nesting depth.</param>
/// <returns></returns>
private bool DoVerifyFileHeader(
Delimon.Win32.IO.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
Alphaleonis.Win32.Filesystem.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
{
if (filePath == null || !filePath.Exists || filePath.Length <= 0)
{
Expand Down Expand Up @@ -697,7 +697,7 @@ private bool DoVerifyFileHeader(
/// <returns>
/// <c>true</c> if [is prohibited content] [the specified file path]; otherwise, <c>false</c>.
/// </returns>
private bool IsVerifiedContent(Delimon.Win32.IO.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
private bool IsVerifiedContent(Alphaleonis.Win32.Filesystem.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
{

return CoreVerifyFileContent(filePath, sigs,ignoreExtension);
Expand All @@ -713,7 +713,7 @@ private bool IsVerifiedContent(Delimon.Win32.IO.FileInfo filePath, HeaderSignatu
/// <param name="filePath">The file path.</param>
/// <returns></returns>
private bool CoreVerifyFileContent(
Delimon.Win32.IO.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
Alphaleonis.Win32.Filesystem.FileInfo filePath, HeaderSignature[] sigs, bool ignoreExtension)
{
WriteError(
string.Format(
Expand Down
7 changes: 3 additions & 4 deletions ContentDetectorLibrary/ContentDetectorLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,9 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Delimon.Win32.IO, Version=4.0.4764.1936, Culture=neutral, PublicKeyToken=6f601db60ebd9657, processorArchitecture=MSIL">
<Reference Include="AlphaFS, Version=2.2.0.0, Culture=neutral, PublicKeyToken=4d31a58f7d7ad5c9, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>.\Delimon.Win32.IO.dll</HintPath>
<EmbedInteropTypes>False</EmbedInteropTypes>
<HintPath>.\AlphaFS.dll</HintPath>
</Reference>
<Reference Include="Ionic.Zip.Reduced, Version=1.9.1.8, Culture=neutral, PublicKeyToken=edbe51ad942a3f5c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
Expand Down Expand Up @@ -71,7 +70,7 @@
<Compile Include="Content\SingleFileContentProcessor.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="Delimon.Win32.IO.dll" />
<Content Include="AlphaFS.dll" />
<Content Include="Ionic.Zip.Reduced.dll" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Expand Down

0 comments on commit 6c17c2f

Please sign in to comment.