---
schema_version: "1"
id: 9994a0b051f4fcefca9e537e52385903767e82feb4c0e03401c3ae20c1a6eb15
title: Hadoop (HDFS) Connector - Examples
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/hdfs-connector/latest/hdfs-connector-examples.md
canonical_url: https://docs.mulesoft.com/hdfs-connector/latest/hdfs-connector-examples
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 088271e2d912dfa220a254a4b2eb389e4a1b9ba111443ad4517fcd95f1839335
description: MuleSoft Documentation Site
release: "6.0"
latest: true
---
---
product: Hadoop (HDFS) Connector
version: 6.0
is-latest-version: true
---

# Hadoop (HDFS) Connector - Examples

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

## Create a Text File in HDFS

The following example shows how to use the connector to create a text file in HDFS:

1.  In Anypoint Studio, click **File > New > Mule Project**, name the project, and click **Finish**.

2.  In the **Mule Palette** search field, type `http`.

3.  Drag the **HTTP > Listener** operation to the canvas.

4.  In **General** settings, click the green plus sign (+) to the right of **Connector
    Configuration**.

5.  Click **OK** to accept the default settings.

6.  In **Path**, enter `/createFile`.

7.  In the **Mule Palette** search field, type `hdfs`.

8.  Drag the HDFS **Write** operation to the canvas.

9.  Set **Path** to `/test.txt` and leave the default values for the other options.  
    This is the path of the file that HDFS creates.

10. Right-click in the project canvas and select **Run project** to start the application.

11. From an HTTP client such as Postman or curl, make a POST request, set the value for
    `Content-type:plain/text` to `localhost:8081/createFile`, and add the content you want to write
    as a payload, as shown in the following example:  
    `curl -X POST -H "Content-Type:plain/text" -d "payload to write to file" localhost:8090/createFile`

12. Use an HDFS explorer to verify that the `/test.txt` file exists and contains your content.

## See Also

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
