Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X
I have a Java extension where I need to write a service that deletes a specified file from MyCustomFileRepository.
But the DeleteFile method isn't available as part of the FileRepositoryThing class!
@ThingworxServiceDefinition(name = "DeleteFile", description = "Deletes the specified file from the Healthband FileRepository entity.", category = "", isAllowOverride = false, aspects = {"isAsync:false" })
@ThingworxServiceResult(name = "Result", description = "", baseType = "STRING", aspects = {})
public String DeleteFile(
@ThingworxServiceParameter(name = "filePath", description = "", baseType = "STRING", aspects = {"isRequired:true" }) String filePath) {
final FileRepositoryThing repo = (FileRepositoryThing) ThingUtilities.findThing("MyCustomFileRepository");
repo.DeleteFile(filePath);
return "";
}
}
Solved! Go to Solution.
Hello Shane Clifford,
Please let us know, what version of Thingworx Extension SDK do you use? I've just tested it on 7.0 and it's working fine.
Regards,
J.
Hello Shane Clifford,
Please let us know, what version of Thingworx Extension SDK do you use? I've just tested it on 7.0 and it's working fine.
Regards,
J.
Hello Jakub,
I'm developing for 6.6.0 instances, so using 6.6.0 Thingworx Extension SDK.
Thanks,
Shane
Yes, tested and confirmed FileDelete method is present in the ThingWorx Extension SDK 7.2.3 version of FileRepository class. Marking your answer as correct Jakub, thank you.