← ResourcesConnector migration

Migrating the MuleSoft File connector to Spring Boot

5 min read

The MuleSoft File connector maps onto the standard java.nio.file APIs. The file:listener source becomes a scheduled directory poller.

Operation mapping

  • file:read → Files.readAllBytes(path)
  • file:write → Files.write(path, bytes)
  • file:list → Files.list(dir)
  • file:move → Files.move(src, dest)
  • file:copy → Files.copy(src, dest)
  • file:listener (source) → a @Scheduled method polling the directory

Before and after: list

Mule (XML)
<file:list config-ref="File_Config" directoryPath="/data/in"/>
Spring Boot (Java)
try (Stream<Path> files = Files.list(Path.of("/data/in"))) {
    return files.map(Path::toString).toList();
}

How the conversion is validated

File operations are validated end-to-end against a live Mule runtime: the same requests run against both the original and converted apps and the responses are compared. In our reference conversion the file-listing endpoint matches Mule byte-for-byte.

Prove it on your own code

Send us one Mule application and your Postman collection. We convert it and prove the Spring Boot output matches field-by-field — on-premise, inside your environment.