Modify Schema file resource using rest java client

0

Hi,

what is the proper way to modify/replace the schema file of a ClientSemanticLayerDataSource using rest java client (jrs-rest-java-client-6.3.0)?

i tried using 

=====

SingleResourceAdapter resAdapter = session.resourcesService().resource(schemaUri);

ClientFile cf = (ClientFile) resAdapter.details().getEntity();

cf.setContent(newXmlContent)

resAdapter.createOrUpdate(cf)

====

After the update, when trying to get the schema resource back, the downloadBinary() seems returned content in gibberrish characters (I read from the InputStream and output to string. the content was OK before the createOrUpdate, but after createOrUpdate in the above steps, it became gibberish).

 

is this the proper way to modify/replace the xml schema using the rest java client?

Thanks!

Bill

billokara's picture
Joined: Sep 14 2016 - 11:22am
Last seen: 2 years 7 months ago

1 Answer:

0

the content needs to be base64 encoded.

billokara's picture
Joined: Sep 14 2016 - 11:22am
Last seen: 2 years 7 months ago
Feedback
randomness