Class EbicsFileFolder
Organizes a file system folder as a storage for the EbicsFileSpooler.
Inherited Members
Namespace: Subsembly.EBICS
Assembly: Subsembly.EBICS.Core.dll
Syntax
public class EbicsFileFolder
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.
Declaration
public const string ACCESSFILENAME = ".access"
Field Value
Type | Description |
---|---|
System.String |
JOURNALFILENAME
The name of the EbicsFileSpoolerJournal file that tracks the processing of order files in the BOX_OUTBOX.
Declaration
public const string JOURNALFILENAME = ".journal"
Field Value
Type | Description |
---|---|
System.String |
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.
Declaration
public const string OKAYFILENAME = ".okay"
Field Value
Type | Description |
---|---|
System.String |
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.
Declaration
public const string SENTINELFILENAME = ".sentinel"
Field Value
Type | Description |
---|---|
System.String |
Properties
Exists
Declaration
public bool Exists { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
FolderName
The folder name without path information.
Declaration
public string FolderName { get; }
Property Value
Type | Description |
---|---|
System.String |
FolderPath
The complete folder path up to the file system root.
Declaration
public string FolderPath { get; }
Property Value
Type | Description |
---|---|
System.String |
IsLocked
Indicates whether the folder is already locked by this object instance.
Declaration
public bool IsLocked { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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.
Declaration
public void Delete(EbicsFileName aFileName)
Parameters
Type | Name | Description |
---|---|---|
EbicsFileName | aFileName |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
FileExists(EbicsFileName)
Indicates whether the file system file of the logical EbicsFileName exists.
Declaration
public bool FileExists(EbicsFileName aFileName)
Parameters
Type | Name | Description |
---|---|---|
EbicsFileName | aFileName |
Returns
Type | Description |
---|---|
System.Boolean |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetFilePath(EbicsFileName)
Get the complete file system path to an EBICS file inside of this folder.
Declaration
public string GetFilePath(EbicsFileName aFileName)
Parameters
Type | Name | Description |
---|---|---|
EbicsFileName | aFileName |
Returns
Type | Description |
---|---|
System.String |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter |
GetFiles(DateTime, String, EbicsAccountInfo, String, Boolean)
Declaration
public EbicsFileName[] GetFiles(DateTime tFromDate = default(DateTime), string sOrderType = null, EbicsAccountInfo aAccount = null, string sSuffix = null, bool fIncludeHidden = false)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | tFromDate | Optional starting date for the returned file names. Files that are older than this date will not be returned. |
System.String | sOrderType | Optional order type to filter the returned file names. If |
EbicsAccountInfo | aAccount | Optional account specification to filter the returned file names, If |
System.String | sSuffix | Optional file name suffix. If this parameter is given, then only filenames with a
matching Suffix are returned. The suffix is compared
using |
System.Boolean | fIncludeHidden |
Returns
Type | Description |
---|---|
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 |
GetMaxDate(String, EbicsAccountInfo)
Gets the highest creation date of the files stored in this folder.
Declaration
public DateTime GetMaxDate(string sOrderType = null, EbicsAccountInfo aAccount = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | sOrderType | Optional order type to filter the files. If |
EbicsAccountInfo | aAccount | Optional account specification to filter the files. If |
Returns
Type | Description |
---|---|
System.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, Boolean)
Declaration
public EbicsFileFolder GetSubFolder(string sSubFolderName, bool fCreate)
Parameters
Type | Name | Description |
---|---|---|
System.String | sSubFolderName | |
System.Boolean | fCreate |
Returns
Type | Description |
---|---|
EbicsFileFolder |
GetSubFolders()
Returns all sub folders of this folder.
Declaration
public EbicsFileFolder[] GetSubFolders()
Returns
Type | Description |
---|---|
EbicsFileFolder[] |
Lock()
Attempt to exclusively lock this folder.
Declaration
public bool Lock()
Returns
Type | Description |
---|---|
System.Boolean | If the folder was locked successfully, then |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The folder was already locked by this class instance, that means
IsLocked is |
ToString()
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
Unlock()
Release exclusive access to this folder.
Declaration
public void Unlock()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The folder was not previously locked via Lock(), that is,
IsLocked is |