2.4.4 Manage Files and File Metadata

2.4.4.1 Data Structures

2.4.4.1.1 FTHFileMetadataItemData

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

2.4.4.1.2 FTHFileData

FTHFileData

Thru File object data

Data Type

Field Name

Description

int

FileID

ID of a file in Thru 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 Thru collections.

2.4.4.2 Methods

2.4.4.2.1 DeleteFile

DeleteFile

Deletes file object in Thru 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

2.4.4.2.2 GetFile

GetFile

Retrieves a specific file object in Thru system by file ID.

Note: method does not retrieve a file body, it should be downloaded using HTTP GET call to URL servername/download.aspx, see section 2.6

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

2.4.4.2.3 GetFileByName

GetFileByName

Retrieves a specific file object from Thru system by specific file name, which is unique in the parent folder.

Note: method does not retrieve a file body, it should be downloaded using HTTP GET call to URL servername/download.aspx, see section 2.6

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

2.4.4.2.4 GetFileCount

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

2.4.4.2.5 GetFiles

GetFiles

Retrieves an array of file objects in the specified parent folder.

Note: method does not retrieve the file bodies, each file should be downloaded using HTTP GET call to URL servername/download.aspx see section 2.6

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

2.4.4.2.6 GetFilePath

GetFilePath

Retrieves file path in Thru 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

2.4.4.2.7 MoveFiles

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

2.4.4.2.8 SaveFile

Saves changes to a Thru 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

2.4.4.2.9 CreateFileMetadata

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

2.4.4.2.10 GetFileMetadata

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

2.4.4.2.11 SaveFileMetadata

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