Example: Checking the integrity of files in a file space
You can check the integrity of the files in a file space by submitting an HTTP request to the WebSphere® MQ Managed File Transfer Web Gateway. For example, if you are restoring a file system after data loss, you can check that the files in a file space exist in the correct location on the file system. The Web Gateway returns a response in XML or JSON format that lists the contents of a file space with an additional attribute to indicate the result of an integrity check on each file.
About this task
A successful request returns an HTTP status code of 200 and a payload that lists the first 100 files in the file space. You can request that the details of the files are returned in either XML or JSON format. You can write a web application to parse the content of the response and display it in an appropriate format to a web user. Only an administrator is authorized to list the files in a file space with the integrity-check attribute.
The following steps describe
how to submit a request. In this example, the server hosting the
WebSphere MQ Managed File Transfer Web Gateway is example.com. The name of the file space to list is john
and it contains two files. The header Accept:
application/xml
specifies that the query returns the results
in XML format. The header x-fte-check-integrity
specifies
that the query returns the results with the additional integrity check
attribute included for each file.
Procedure
Results
This example result indicates that the first file has passed
the integrity check. The integrity-check-result
attribute
value of OK
shows that the file exists in the Web
Gateway database and that the matching file has been found on the
file system. The second file has failed the integrity check. The integrity-check-result
attribute value of MISSING-FILESYSTEM
shows that the file exists in the Web Gateway database but that
the file cannot be found on the file system in the location given
by the fsLocation
attribute. In this case it might
be necessary for an administrator to delete the file from the file
space, or restore the file space directory from a backup.
For
the possible values of the integrity-check-result
attribute, see File space information response format.