Volian.Base.Library & Baseline
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
@@ -8,19 +6,9 @@ namespace Volian.Base.Library
|
||||
{
|
||||
public static class TmpFile
|
||||
{
|
||||
public static string CreateFileName(string procNumber, string sectNumber, string sectTitle)
|
||||
{
|
||||
return FixFileName(procNumber + "_" + ((sectNumber ?? "") != "" ? sectNumber : sectTitle));
|
||||
}
|
||||
public static string CreateFileName(string procNumber)
|
||||
{
|
||||
return FixFileName(procNumber);
|
||||
}
|
||||
public static string FixFileName(string name)
|
||||
{
|
||||
return Regex.Replace(name, "[ .,/]", "_") + ".pdf";
|
||||
}
|
||||
public static void RemoveAllTmps()
|
||||
public static string CreateFileName(string procNumber) => FixFileName(procNumber);
|
||||
public static string FixFileName(string name) => $"{Regex.Replace(name, "[ .,/]", "_")}.pdf";
|
||||
public static void RemoveAllTmps()
|
||||
{
|
||||
RemoveTmpPDFs();
|
||||
RemoveTmpDocs();
|
||||
@@ -41,7 +29,7 @@ namespace Volian.Base.Library
|
||||
if (fi.LastAccessTime.Ticks < (DateTime.Now.Ticks - TimeSpan.TicksPerHour))
|
||||
fi.Delete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
continue; // if an error, go onto next file.
|
||||
}
|
||||
@@ -70,7 +58,7 @@ namespace Volian.Base.Library
|
||||
if(fi.LastWriteTimeUtc < DateTime.Now.AddDays(-2.0))
|
||||
fi.Delete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
continue; // if an error, go onto next file.
|
||||
}
|
||||
@@ -90,7 +78,7 @@ namespace Volian.Base.Library
|
||||
// it may be open from another process.
|
||||
fi.Delete();
|
||||
}
|
||||
catch (Exception ex)
|
||||
catch (Exception)
|
||||
{
|
||||
continue; // if an error, go onto next file.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user