Issue
I have a scenario which we use a Azure File Share storage to store large files and need to copy those files to another location such as OneDrive or Share Point. Copying files will be selected based on some criteria and I need to start this in a Spring Boot application with a scheduled task.
Is this task feasible with Java and other above mentioned Microsoft Products?
Solution
- Here is the Sample code where you can create an Azure file share using Java Application.
public static Boolean createFileShare(String connectStr, String shareName)
{
try
{
ShareClient shareClient = new ShareClientBuilder()
.connectionString(connectStr).shareName(shareName)
.buildClient();
shareClient.create();
return true;
}
catch (Exception e)
{
System.out.println("createFileShare exception: " + e.getMessage());
return false;
}
}
- Thanks pringi for referring the documentation, for more information you can refer the Microsoft Documentation
Answered By - SaiSakethGuduru
Answer Checked By - Marilyn (JavaFixing Volunteer)