Manage Files and File metadata
Data Structures
FTHFileMetadataItemData
File metadata in a form of name = value pairs
| Data Type | Field Name | Description |
|---|---|---|
| int | FileMetadataID | ID of a metadata item |
| int | FileID | ID of a file for which metadata is created |
| string | Name | Name of metadata item |
| int | DataType | Metadata type, extendable |
| object | Data | Metadata value |
FTHFileData
MFT FS File object data
| Data Type | Field Name | Description |
|---|---|---|
| int | FileID | ID of a file in MFT FS server |
| int | ParentFolderID | ID of a parent folder that contains a file |
| string | Name | Name of a file |
| long | Size | File size |
| int | EffectivePermission | Effective permission of a file (reserved for future use) |
| DateTime | DateCreated | Date when a file was created |
| DateTime | DateModified | Date when a file was modified last time |
| int | CreatedByUserID | ID of the user who created the file |
| int | ModifiedByUserID | ID of the user who modified the file last time |
| int | Version | File version (reserved for future use) |
| bool | IsDeleted | Flag shows if a file is in Deleted state |
| bool | IsQuarantined | Flag shows if a file is in Quarantined state, means that file body was removed by Anti-virus software. |
| bool | IsPublished | Flag shows that a file is published into one of MFT FS collections. |
Methods
DeleteFile
Deletes file object in MFT FS system. File body will be deleted later after Purge waiting period is over.
void
DeleteFile(Guid sessionID, int fileID)
| Parameter Name | Description |
|---|---|
SessionID | User session returned by one of the Open functions |
fileID | ID of the file to be deleted |
GetFile
Retrieves a specific file object in MFT FS system by file ID.
method does not retrieve a file body, it should be downloaded using HTTP GET call to URL servername/download.aspx, refer to Programmatic File and Folder Transfers.
FTHFileData
GetFile(Guid sessionID, int fileID)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
fileID | ID of the file object to be retrieved |
GetFileByName
Retrieves a specific file object from MFT FS system by specific file name, which is unique in the parent folder.
Method does not retrieve a file body, it should be downloaded using HTTP GET call to URL servername/download.aspx, refer to Programmatic File and Folder Transfers.
FTHFileData
GetFileByName(Guid sessionID, int parentFolderID, string name)
| Parameter Name | Description |
|---|---|
SessionID | User session returned by one of the Open functions |
parentFolderID | ID of the parent folder that contains the file |
Name | File name |
GetFileCount
Returns number of files in the specified parent folder.
int
GetFileCount(Guid sessionID, int parentFolderID)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
parentFolderID | ID of the parent folder that contains the files to be counted |
GetFiles
Retrieves an array of file objects in the specified parent folder.
Method does not retrieve the file bodies, each file should be downloaded using HTTP GET call to URL servername/download.aspx, refer to Programmatic File and Folder Transfers.
FTHFileData[]
GetFiles(Guid sessionID, int parentFolderID, int index, int length)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
parentFolderID | ID of the parent folder that contains the files to be retrieved |
index | Starting index for retrieval |
length | Number of elements to retrieve |
GetFilePath
Retrieves file path in MFT FS server to specific file.
string
GetFilePath(Guid sessionID, int fileID)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
fileID | ID of the file for which the path is retrieved |
MoveFiles
Moves specified files to destination folder.
void
MoveFiles(Guid sessionID, int[] fileIDList, int destinationFolderID)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
fileIDList | List of file IDs that should be moved to destination folder |
destinationFolderID | Destination folder where the files will be moved |
SaveFile
Saves changes to a MFT FS file object, different from overwriting file body.
Changes internal fields of file object. Effective use is to rename the file only.
FTHFileData
SaveFile(Guid sessionID, FTHFileData file)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
file | File object that should be saved |
CreateFileMetadata
Creates metadata for a specific file in a form of name = value pair
FTHFileMetadataItemData
CreateFileMetadata (Guid sessionID, int fileID, string name, object data)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
fileID | ID of the file for which the metadata is created |
name | Metadata item name |
data | Metadata value |
GetFileMetadata
Retrieves array of metadata items for a specific file.
FTHFileMetadataItemData[]
GetFileMetadata(Guid sessionID, int fileID)
| Parameter Name | Description |
|---|---|
SessionID | User session returned by one of the Open functions |
fileID | ID of the file for which the metadata is retrieved |
SaveFileMetadata
Saves metadata for a specific file.
FTHFileMetadataItemData
SaveFileMetadata(Guid sessionID, int fileID, string name, object data)
| Parameter Name | Description |
|---|---|
sessionID | User session returned by one of the Open functions |
fileID | ID of the file for which the metadata is saved |
name | Metadata item name |
data | Metadata value |