public boolean getSlotPublishingProfileXmlWithSecrets(final String sid, final String webAppId, final String slotName,
final String filePath) throws Exception {
final WebApp app = getWebAppById(sid, webAppId);
final DeploymentSlot slot = app.deploymentSlots().getByName(slotName);
final File file = new File(Paths.get(filePath, slotName + "_" + System.currentTimeMillis() + ".PublishSettings")
.toString());
file.createNewFile();
try (final InputStream inputStream = slot.manager().inner().webApps()
.listPublishingProfileXmlWithSecretsSlot(slot.resourceGroupName(), app.name(), slotName,
PublishingProfileFormat.FTP);
OutputStream outputStream = new FileOutputStream(file);
) {
IOUtils.copy(inputStream, outputStream);
return true;
} catch (IOException e) {
e.printStackTrace();
return false;
}
}