Class EbicsFileFolder
Organizes a file system folder as a storage for the EbicsFileSpooler.
public class EbicsFileFolder
- Inheritance
-
EbicsFileFolder
- Derived
- Inherited Members
Remarks
The EbicsFileFolder is configured for a directory where it stores flat data files, often extracted from ZIP downloads. The file names of the files in the folder shall adhere to the EbicsFileName convention.
Fields
ACCESSFILENAME
The name of the EbicsFileSpoolerAccessControlList file that manages the access rights for this folder.
public const string ACCESSFILENAME = ".access"
Field Value
JOURNALFILENAME
The name of the EbicsFileSpoolerJournal file that tracks the processing of order files in the BOX_OUTBOX.
public const string JOURNALFILENAME = ".journal"
Field Value
OKAYFILENAME
The name of the log file in which all spooler executions for a particular HostID and PartnerID are recorded. This is a simple, unencrypted CSV file where another line is appended for every spooler execution.
public const string OKAYFILENAME = ".okay"
Field Value
SENTINELFILENAME
The name of the sentinel file that is maintained in the file folder for locking and tracking. This must start with a dot to be hidden and to not interfere with the real data files in this folder.
public const string SENTINELFILENAME = ".sentinel"
Field Value
Properties
Exists
public bool Exists { get; }
Property Value
FolderName
The folder name without path information.
public string FolderName { get; }
Property Value
FolderPath
The complete folder path up to the file system root.
public string FolderPath { get; }
Property Value
IsLocked
Indicates whether the folder is already locked by this object instance.
public bool IsLocked { get; }
Property Value
Remarks
If the folder was locked by another thread or process, then this will
be false
. Only if the folder has been locked by calling Lock()
on this object instance, then the value will be true
.
Methods
Delete(EbicsFileName)
Deletes all file system files of any possible file system name variation of the logical EbicsFileName.
public void Delete(EbicsFileName aFileName)
Parameters
aFileName
EbicsFileName
Exceptions
- ArgumentNullException
The parameter
aFileName
wasnull
.
FileExists(EbicsFileName)
Indicates whether the file system file of the logical EbicsFileName exists.
public bool FileExists(EbicsFileName aFileName)
Parameters
aFileName
EbicsFileName
Returns
Exceptions
- ArgumentNullException
The parameter
aFileName
wasnull
.
GetFilePath(EbicsFileName)
Get the complete file system path to an EBICS file inside of this folder.
public string GetFilePath(EbicsFileName aFileName)
Parameters
aFileName
EbicsFileName
Returns
Exceptions
- ArgumentNullException
The parameter
aFileName
wasnull
.
GetFiles(DateTime, string, EbicsAccountInfo, string, bool)
public EbicsFileName[] GetFiles(DateTime tFromDate = default, string sOrderType = null, EbicsAccountInfo aAccount = null, string sSuffix = null, bool fIncludeHidden = false)
Parameters
tFromDate
DateTimeOptional starting date for the returned file names. Files that are older than this date will not be returned.
sOrderType
stringOptional order type to filter the returned file names. If
null
, then all file names are returned.aAccount
EbicsAccountInfoOptional account specification to filter the returned file names, If
null
, then all file names are returned. Only account fields that are specified in both, the given account and the file name account, are compared.sSuffix
stringOptional file name suffix. If this parameter is given, then only filenames with a matching Suffix are returned. The suffix is compared using
StringComparison.OrdinalIgnoreCase
.fIncludeHidden
bool
Returns
- EbicsFileName[]
Returns all matching file names in chronological sorted order. For file names with the same Date, the SequenceID is compared, if present. The returned array is never
null
, but may be empty.
GetMaxDate(string, EbicsAccountInfo)
Gets the highest creation date of the files stored in this folder.
public DateTime GetMaxDate(string sOrderType = null, EbicsAccountInfo aAccount = null)
Parameters
sOrderType
stringOptional order type to filter the files. If
null
, then the order type of the files is ignored.aAccount
EbicsAccountInfoOptional account specification to filter the files. If
null
, then the account specification of the files is ignored. Only account fields that are specified in both, the given account and the file name account, are compared.
Returns
- DateTime
If there are no matching files in this folder, then DateTime.MinValue is returned. Otherwise the highest Date of all matching files is returned. Note that there may be multiple files with the same, highest creation date.
GetSubFolder(string, bool)
public EbicsFileFolder GetSubFolder(string sSubFolderName, bool fCreate)
Parameters
Returns
GetSubFolders()
Returns all sub folders of this folder.
public EbicsFileFolder[] GetSubFolders()
Returns
Lock()
Attempt to exclusively lock this folder.
public bool Lock()
Returns
- bool
If the folder was locked successfully, then
true
is returned. If the folder could not be locked, e.g. is already in use, thenfalse
is returned. Also, if there is any other file access error,false
will be returned.
Exceptions
- InvalidOperationException
The folder was already locked by this class instance, that means IsLocked is
true
.
ToString()
public override string ToString()
Returns
Unlock()
Release exclusive access to this folder.
public void Unlock()
Exceptions
- InvalidOperationException
The folder was not previously locked via Lock(), that is, IsLocked is
false
.