0

I am fabricating a class to simplify distributing files to devices from cumulocity

/**
 * Class to simplify pushing files to the devices
 */
public class GenericFileUploadDriver implements Driver, OperationExecutor {

Using c8y_DownloadConfigFile I could mine out the file URL on the client by I apparently need to manually authenticate to access to that.

I would like to use the credentials from the cfg/device.properties file. I am wondering what is the easiest way to access to those from this context?

Thanks

Peter
  • 73
  • 1
  • 7

1 Answers1

1

You could poke it out of the Platform object that you get passed:

public void initialize(Platform platform) throws Exception {
  PlatformParameters parms = (PlatformParameters)platform;
  String user = parms.getUser();
  String password = parms.getPassword();
  // ...
}
André
  • 668
  • 6
  • 11