Nav
You are viewing an older version of this section. Click here to navigate to the latest version.

Get File Metadata

The resource /mmc/api/servers/<myServerId>/files/<myFile.xml>?metadata=true is used with the HTTP GET command to get the metadata for the specified file on the specified server. The resource returns the metadata for the specified file on the server relative to the Mule installation directory.

You specify the URL as http://localhost:8080/mmc/api/servers/73d89173-290e-4cb3-a61c-e11deb74767d/files/<path>?metadata=true where <path> is the path to the file whose metadata you want to retrieve and 73d89173-290e-4cb3-a61c-e11deb74767d is the server id.

Note that you must include the parameter metadata=true after the path to the file.

Example Request

The following example requests the metadata for the myconfig.xml file.


         
      
1
GET http://localhost:8080/mmc/api/servers/73d89173-290e-4cb3-a61c-e11deb74767d/files/myconfig.xml?metadata=true

Example Response

A successful request returns a response such as the following:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
200
Transfer-Encoding: chunked
Content-Type: application/json
Server: Apache-Coyote/1.1
Date: Tue, 10 Nov 2009 16:17:12 GMT

{
  "name" : "myconfig.xml",
  "size" : 6460,
  "absolutePath" : "/usr/local/mule-2.2.5/myconfig.xml",
  "directory" : false,
  "lastModified" : 1256052353600,
  "userCanExecute" : true,
  "userCanRead" : true,
  "userCanWrite" : true
}