PdfStorageAdapter.RemoveOldDocuments Method (TimeSpan, Boolean, Boolean) |
Remove documents older than a given period of time.
Namespace:
RadPdf.Integration
Assembly:
RadPdf (in RadPdf.dll) Version: 4.4.0.0 (4.4.0.0)
Syntaxpublic void RemoveOldDocuments(
TimeSpan olderThan,
bool onlyKeyless,
bool useDateModified
)
Public Sub RemoveOldDocuments (
olderThan As TimeSpan,
onlyKeyless As Boolean,
useDateModified As Boolean
)
Parameters
- olderThan
- Type: System.TimeSpan
Resources older than this value will be removed from storage. - onlyKeyless
- Type: System.Boolean
If true, only documents without a valid DocumentKey will be removed. - useDateModified
- Type: System.Boolean
If true, the document's last modified date (instead of creation date) will be used for comparison.
Remarks
This method is typically used to perform maintenance on the storage provider used by RAD PDF.
This operation may require a substantial amount of time to complete.
olderThan should be a positive TimeSpan value.
Examples
In this example, we run a portion of the RAD PDF maintenance routinue.
If using RAD PDF's storage as temporary cache, a value of about 7 days is typical.
using(PdfStorageAdapter adapter = new PdfStorageAdapter())
{
adapter.RemoveOldDocuments(new TimeSpan(7, 0, 0, 0), true, false);
}
See Also