I have this plugin that we use for general purpose stuff. So far, it has these methods implemented…
//Copy a file from the Servoy App Server to a Servoy Client. Use 1024 as default bufferSize. Returns “true” or “Error: msg”
plugins.DDC_Utils.copyFileFromAppServerToClient("/path/on/server/filename", "/path/on/client/filename", 1024);
//Download a file from a URL to a local file. Returns “true” or “Error: msg”
plugins.DDC_Utils.downloadURL("http://site.com/filename.pdf", "/path/on/client/filename");
//Converts Integer to Binary and then returns switch at Position
plugins.DDC_Utils.getSwitch(number Key, number Position)
//Returns a unique random number array of specified length, using numbers from min to max
plugins.DDC_Utils.getUniqueRandomArray(number min, number max, number length)
//Returns title case of each word in the string
plugins.DDC_Utils.getTitleCase("mr. smith");
//Still have a way to go on this one. Currently jus replaces new line with
plugins.DDC_Utils.textToHTML(myText);
An improvement I would like to make is to make the copyFileFromAppServerToClient more streaming. Currently it streams the file using buffers of a specified length from the server to the client through a RMI service. This is okay for normal downloads…However we would like to also use it for streaming audio files. So, something like a Quicktime Streaming Server, but as a Servoy plugin…so they can listen to the file as it downloads. If it cannot be done, we will have to actually use a streaming server, which will put it outside of Servoy (which we really don’t want to do since it currently uses Servoy’s RMI port to stream the file).
ddc_utils.jar (23.6 KB)