ws_fileio.ecm 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*##############################################################################
  2. Copyright (C) 2011 HPCC Systems.
  3. All rights reserved. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ############################################################################## */
  14. #include "xslprocessor.hpp"
  15. ESPrequest CreateFileRequest
  16. {
  17. string DestDropZone; //name or IP address;
  18. string DestRelativePath; //file name and/or path; related to the predefined directory of the dropzone
  19. bool Overwrite(false);
  20. };
  21. ESPresponse [nil_remove, exceptions_inline]
  22. CreateFileResponse
  23. {
  24. string DestDropZone; //echo back from request
  25. string DestRelativePath; //echo back from request
  26. bool Overwrite; //echo back from request
  27. string Result;
  28. };
  29. ESPrequest WriteFileDataRequest
  30. {
  31. binary Data;
  32. string DestDropZone; //name or IP address;
  33. string DestRelativePath; //file name and/or path;
  34. int64 Offset(0);
  35. bool Append(false);
  36. };
  37. ESPresponse [nil_remove, exceptions_inline]
  38. WriteFileDataResponse
  39. {
  40. string DestDropZone; //echo back from request
  41. string DestRelativePath; //echo back from request
  42. int64 Offset; //echo back from request
  43. bool Append; //echo back from request
  44. string Result;
  45. };
  46. ESPrequest ReadFileDataRequest
  47. {
  48. string DestDropZone; //name or IP address;
  49. string DestRelativePath; //file name and/or path;
  50. int64 Offset(0);
  51. int64 DataSize;
  52. };
  53. ESPresponse [nil_remove, exceptions_inline]
  54. ReadFileDataResponse
  55. {
  56. binary Data;
  57. string DestDropZone; //echo back from request
  58. string DestRelativePath; //echo back from request
  59. int64 Offset; //echo back from request
  60. int64 DataSize; //echo back from request
  61. string Result;
  62. };
  63. ESPservice [exceptions_inline("./smc_xslt/exceptions.xslt")] WsFileIO
  64. {
  65. //ESPuses ESPstruct DFUException;
  66. ESPmethod CreateFile(CreateFileRequest, CreateFileResponse);
  67. ESPmethod WriteFileData(WriteFileDataRequest, WriteFileDataResponse);
  68. ESPmethod ReadFileData(ReadFileDataRequest, ReadFileDataResponse);
  69. };
  70. SCMexportdef(WsFileIO);
  71. SCMapi(WsFileIO) IClientWsFileIO *createWsFileIOClient();