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

Delete a File

The resource /mmc/api/servers/<myServerId>/files/<myFile.xml> deletes a file on the specified server. Invoke this resource using the HTTP DELETE operation. Note that the file to delete on the server is relative to the Mule installation directory.

Specify the server and file path URLs in the form http://localhost:8080/mmc/api/servers/73d89173-290e-4cb3-a61c-e11deb74767d/files/<path>; where <path> is the path to the file you want to delete and 73d89173-290e-4cb3-a61c-e11deb74767d is the server id.

Example Request

The following example shows how to delete the bar.xml file on a server:

(curl example)curl --basic -u admin:admin -v -X DELETE http://localhost:8080/mmc/api/servers/'local$d6f9cf62-f09c-4bf6-9d73-a16fec39dffc'/files/foo/bar.xmlDELETE http://localhost:8080/mmc/api/servers/local$d6f9cf62-f09c-4bf6-9d73-a16fec39dffc/files/foo/bar.xml

Example Response

A success delete request returns the following response:

200 OKContent-Length: 0Server: Apache-Coyote/1.1Date: Tue, 10 Nov 2009 16:17:12 GMT