@sitevision/api 2.0.0-alpha.1 → 2023.2.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/client/requester/index.d.ts +10 -8
  2. package/client/toasts/index.d.ts +7 -5
  3. package/common/app/index.d.ts +45 -46
  4. package/common/events/index.d.ts +30 -31
  5. package/common/i18n/index.d.ts +7 -5
  6. package/common/router/index.d.ts +72 -77
  7. package/common/security/index.d.ts +27 -21
  8. package/index.d.ts +8 -0
  9. package/package.json +1 -1
  10. package/server/AliasUtil/index.d.ts +11 -9
  11. package/server/ArchiveUtil/index.d.ts +43 -41
  12. package/server/ArraysInstance/index.d.ts +1666 -1807
  13. package/server/ArticleUtil/index.d.ts +292 -224
  14. package/server/AuthenticationUtil/index.d.ts +72 -84
  15. package/server/BookmarkUtil/index.d.ts +74 -79
  16. package/server/BuddyIconRenderer/index.d.ts +123 -131
  17. package/server/BuddyIconRenderer.BuddyIconSize/index.d.ts +41 -0
  18. package/server/BuddyIconRenderer.BuddyIconSize/index.js +25 -0
  19. package/server/ClientUtil/index.d.ts +10 -8
  20. package/server/CollaborationFactory/index.d.ts +37 -40
  21. package/server/CollaborationGroupFolderUtil/index.d.ts +28 -26
  22. package/server/CollaborationGroupState/index.d.ts +27 -0
  23. package/server/CollaborationGroupState/index.js +11 -0
  24. package/server/CollaborationGroupTemplateUtil/index.d.ts +46 -48
  25. package/server/CollaborationGroupType/index.d.ts +28 -0
  26. package/server/CollaborationGroupType/index.js +12 -0
  27. package/server/CollaborationGroupUtil/index.d.ts +84 -80
  28. package/server/CollectionsInstance/index.d.ts +641 -704
  29. package/server/ColorUtil/index.d.ts +34 -35
  30. package/server/CompoundAndFilterBuilder/index.d.ts +28 -26
  31. package/server/CompoundComparatorBuilder/index.d.ts +33 -31
  32. package/server/CompoundOrFilterBuilder/index.d.ts +28 -26
  33. package/server/ContentNodeUtil/index.d.ts +34 -32
  34. package/server/CurrencyFactory/index.d.ts +70 -68
  35. package/server/DateUtil/index.d.ts +131 -141
  36. package/server/DecorationUtil/index.d.ts +11 -9
  37. package/server/DeviceUtil/index.d.ts +19 -17
  38. package/server/DimensionMode/index.d.ts +17 -0
  39. package/server/DimensionMode/index.js +12 -0
  40. package/server/DirectoryUtil/index.d.ts +87 -85
  41. package/server/DocType/index.d.ts +30 -0
  42. package/server/DocType/index.js +14 -0
  43. package/server/DocTypeUtil/index.d.ts +127 -133
  44. package/server/EndecUtil/index.d.ts +329 -346
  45. package/server/ExtendedDismaxParserBuilder/index.d.ts +153 -167
  46. package/server/FileIconRenderer/index.d.ts +152 -171
  47. package/server/FileUtil/index.d.ts +272 -298
  48. package/server/FilterBuilder/index.d.ts +39 -37
  49. package/server/FolderUtil/index.d.ts +91 -92
  50. package/server/FontUtil/index.d.ts +34 -35
  51. package/server/FormatterBuilderFactory/index.d.ts +73 -81
  52. package/server/HighlightBuilder/index.d.ts +76 -83
  53. package/server/IconUtil/index.d.ts +25 -23
  54. package/server/ImageLinkRenderer/index.d.ts +35 -33
  55. package/server/ImageRenderer/index.d.ts +340 -376
  56. package/server/ImageUtil/index.d.ts +245 -263
  57. package/server/IndexUtil/index.d.ts +38 -35
  58. package/server/IndexUtil.IndexType/index.d.ts +29 -0
  59. package/server/IndexUtil.IndexType/index.js +13 -0
  60. package/server/IndexingUtil/index.d.ts +67 -45
  61. package/server/InstanceCreatorUtil/index.d.ts +423 -459
  62. package/server/InstanceTypeUtil/index.d.ts +167 -188
  63. package/server/JwtUtil/index.d.ts +129 -127
  64. package/server/LandingPageUtil/index.d.ts +82 -85
  65. package/server/LandingPageUtil/index.js +1 -0
  66. package/server/LinkPageUtil/index.d.ts +294 -248
  67. package/server/LinkRenderer/index.d.ts +649 -713
  68. package/server/LinkTargetBuilder/index.d.ts +65 -73
  69. package/server/LinkValueBuilder/index.d.ts +66 -73
  70. package/server/ListWrapper/index.d.ts +80 -89
  71. package/server/LocaleUtil/index.d.ts +381 -393
  72. package/server/LogUtil/index.d.ts +118 -127
  73. package/server/MailBuilder/index.d.ts +106 -121
  74. package/server/MailUtil/index.d.ts +58 -63
  75. package/server/MathInstance/index.d.ts +624 -656
  76. package/server/MessageDigesterFactory/index.d.ts +28 -26
  77. package/server/MetadataDefinitionUtil/index.d.ts +77 -81
  78. package/server/MetadataUtil/index.d.ts +321 -345
  79. package/server/MimeTypeUtil/index.d.ts +208 -214
  80. package/server/MonitorBuilder/index.d.ts +17 -17
  81. package/server/NodeComparatorUtil/index.d.ts +214 -224
  82. package/server/NodeFactoryUtil/index.d.ts +19 -17
  83. package/server/NodeFilterUtil/index.d.ts +651 -738
  84. package/server/NodeIteratorUtil/index.d.ts +209 -224
  85. package/server/NodeResolverUtil/index.d.ts +398 -404
  86. package/server/NodeTreeUtil/index.d.ts +211 -226
  87. package/server/NodeTypeUtil/index.d.ts +1430 -546
  88. package/server/OfflineVersionPropertyUtil/index.d.ts +6 -4
  89. package/server/OnlineVersionPropertyUtil/index.d.ts +6 -4
  90. package/server/OutputUtil/index.d.ts +384 -379
  91. package/server/PageUtil/index.d.ts +264 -186
  92. package/server/PermissionUtil/index.d.ts +391 -428
  93. package/server/PermissionUtil.Permission/index.d.ts +54 -0
  94. package/server/PermissionUtil.Permission/index.js +38 -0
  95. package/server/PortletContextUtil/index.d.ts +111 -106
  96. package/server/PortletUtil/index.d.ts +30 -20
  97. package/server/PrincipalUtil/index.d.ts +33 -31
  98. package/server/Properties/index.d.ts +68 -75
  99. package/server/PropertyUtil/index.d.ts +1419 -1461
  100. package/server/PublishingUtil/index.d.ts +246 -247
  101. package/server/QueryStringUtil/index.d.ts +403 -414
  102. package/server/RedirectUtil/index.d.ts +62 -66
  103. package/server/RelatedValueBuilder/index.d.ts +40 -38
  104. package/server/Requester/index.d.ts +123 -123
  105. package/server/ResourceLocatorUtil/index.d.ts +434 -474
  106. package/server/RestApi/index.d.ts +156 -136
  107. package/server/RestAppInvokerFactory/index.d.ts +25 -23
  108. package/server/RoleAssignmentBuilder/index.d.ts +35 -33
  109. package/server/RoleMatcherBuilder/index.d.ts +35 -33
  110. package/server/RoleUtil/index.d.ts +35 -37
  111. package/server/ScriptUtil/index.d.ts +457 -494
  112. package/server/SearchFactory/index.d.ts +102 -117
  113. package/server/SearchUtil/index.d.ts +73 -71
  114. package/server/SearcherBuilder/index.d.ts +107 -114
  115. package/server/Session/index.d.ts +251 -1093
  116. package/server/Session/index.js +1 -20
  117. package/server/SimpleUserUtil/index.d.ts +26 -27
  118. package/server/SiteCookieUtil/index.d.ts +150 -173
  119. package/server/SortBuilder/index.d.ts +24 -22
  120. package/server/SourceSetMode/index.d.ts +12 -0
  121. package/server/SourceSetMode/index.js +12 -0
  122. package/server/SpellCheckBuilder/index.d.ts +27 -27
  123. package/server/StandardParserBuilder/index.d.ts +33 -31
  124. package/server/StructureUtil/index.d.ts +83 -81
  125. package/server/SubscriberUtil/index.d.ts +58 -65
  126. package/server/SubscriptionUtil/index.d.ts +121 -128
  127. package/server/SystemUserUtil/index.d.ts +146 -144
  128. package/server/TagUtil/index.d.ts +113 -118
  129. package/server/TemplateUtil/index.d.ts +113 -118
  130. package/server/TemporaryFileNodeBuilder/index.d.ts +29 -27
  131. package/server/TemporaryNodeBuilder/index.d.ts +136 -174
  132. package/server/TextModuleRendererBuilder/index.d.ts +18 -16
  133. package/server/TimestampUtil/index.d.ts +102 -116
  134. package/server/TranslationUtil/index.d.ts +96 -102
  135. package/server/TrashcanUtil/index.d.ts +112 -115
  136. package/server/UserDataUtil/index.d.ts +108 -109
  137. package/server/UserFactory/index.d.ts +49 -56
  138. package/server/UserFieldRenderer/index.d.ts +118 -126
  139. package/server/UserIdentityUtil/index.d.ts +36 -34
  140. package/server/UserUtil/index.d.ts +30 -28
  141. package/server/Utils/index.d.ts +702 -791
  142. package/server/VelocityRenderer/index.d.ts +94 -92
  143. package/server/VersionUtil/index.d.ts +24 -8
  144. package/server/WebContentUtil/index.d.ts +275 -282
  145. package/server/WebResourceFactory/index.d.ts +46 -51
  146. package/server/XSLTUtil/index.d.ts +33 -31
  147. package/server/XmlParserUtil/index.d.ts +47 -45
  148. package/server/appData/index.d.ts +8 -6
  149. package/server/appInfo/index.d.ts +6 -2
  150. package/server/appResource/index.d.ts +23 -21
  151. package/server/cache/index.d.ts +8 -6
  152. package/server/globalAppData/index.d.ts +8 -6
  153. package/server/headless/index.d.ts +28 -26
  154. package/server/hooks/index.d.ts +9 -9
  155. package/server/oauth2/index.d.ts +12 -10
  156. package/server/privileged/index.d.ts +24 -22
  157. package/server/storage/index.d.ts +22 -20
  158. package/types/javax/jcr/Binary/index.d.ts +0 -20
  159. package/types/javax/jcr/Binary/index.js +0 -1
  160. package/types/javax/jcr/ImportUUIDBehavior/index.d.ts +24 -0
  161. package/types/javax/jcr/Item/index.d.ts +1 -116
  162. package/types/javax/jcr/Item/index.js +0 -6
  163. package/types/javax/jcr/NamespaceRegistry/index.d.ts +66 -42
  164. package/types/javax/jcr/NamespaceRegistry/index.js +0 -2
  165. package/types/javax/jcr/Node/index.d.ts +24 -1495
  166. package/types/javax/jcr/Node/index.js +1 -34
  167. package/types/javax/jcr/NodeIterator/index.d.ts +1 -1
  168. package/types/javax/jcr/Property/index.d.ts +487 -489
  169. package/types/javax/jcr/Property/index.js +0 -5
  170. package/types/javax/jcr/PropertyIterator/index.d.ts +1 -1
  171. package/types/javax/jcr/RangeIterator/index.d.ts +1 -43
  172. package/types/javax/jcr/RangeIterator/index.js +1 -5
  173. package/types/javax/jcr/Repository/index.d.ts +460 -260
  174. package/types/javax/jcr/Repository/index.js +0 -4
  175. package/types/javax/jcr/Value/index.d.ts +0 -29
  176. package/types/javax/jcr/Value/index.js +0 -2
  177. package/types/javax/jcr/ValueFactory/index.d.ts +0 -70
  178. package/types/javax/jcr/ValueFactory/index.js +1 -2
  179. package/types/javax/jcr/Workspace/index.d.ts +93 -569
  180. package/types/javax/jcr/Workspace/index.js +1 -12
  181. package/types/javax/jcr/nodetype/ItemDefinition/index.d.ts +0 -103
  182. package/types/javax/jcr/nodetype/ItemDefinition/index.js +0 -5
  183. package/types/javax/jcr/nodetype/NodeDefinition/index.d.ts +1 -1
  184. package/types/javax/jcr/nodetype/NodeDefinitionTemplate/index.d.ts +1 -1
  185. package/types/javax/jcr/nodetype/NodeType/index.d.ts +255 -264
  186. package/types/javax/jcr/nodetype/NodeType/index.js +1 -12
  187. package/types/javax/jcr/nodetype/NodeTypeDefinition/index.d.ts +0 -104
  188. package/types/javax/jcr/nodetype/NodeTypeDefinition/index.js +1 -7
  189. package/types/javax/jcr/nodetype/NodeTypeIterator/index.d.ts +1 -1
  190. package/types/javax/jcr/nodetype/NodeTypeManager/index.d.ts +0 -123
  191. package/types/javax/jcr/nodetype/NodeTypeManager/index.js +1 -8
  192. package/types/javax/jcr/nodetype/NodeTypeTemplate/index.d.ts +1 -1
  193. package/types/javax/jcr/nodetype/PropertyDefinition/index.d.ts +1 -270
  194. package/types/javax/jcr/nodetype/PropertyDefinition/index.js +1 -7
  195. package/types/javax/jcr/nodetype/PropertyDefinitionTemplate/index.d.ts +1 -1
  196. package/types/javax/jcr/observation/Event/index.d.ts +82 -41
  197. package/types/javax/jcr/observation/EventIterator/index.d.ts +1 -1
  198. package/types/javax/jcr/observation/EventJournal/index.d.ts +1 -1
  199. package/types/javax/jcr/observation/EventListenerIterator/index.d.ts +1 -1
  200. package/types/javax/jcr/query/Query/index.d.ts +29 -8
  201. package/types/javax/jcr/query/RowIterator/index.d.ts +1 -1
  202. package/types/javax/jcr/query/qom/And/index.d.ts +1 -1
  203. package/types/javax/jcr/query/qom/BindVariableValue/index.d.ts +1 -1
  204. package/types/javax/jcr/query/qom/ChildNode/index.d.ts +1 -1
  205. package/types/javax/jcr/query/qom/ChildNodeJoinCondition/index.d.ts +1 -1
  206. package/types/javax/jcr/query/qom/Comparison/index.d.ts +1 -1
  207. package/types/javax/jcr/query/qom/DescendantNode/index.d.ts +1 -1
  208. package/types/javax/jcr/query/qom/DescendantNodeJoinCondition/index.d.ts +1 -1
  209. package/types/javax/jcr/query/qom/DynamicOperand/index.d.ts +1 -1
  210. package/types/javax/jcr/query/qom/EquiJoinCondition/index.d.ts +1 -1
  211. package/types/javax/jcr/query/qom/FullTextSearch/index.d.ts +1 -1
  212. package/types/javax/jcr/query/qom/FullTextSearchScore/index.d.ts +1 -1
  213. package/types/javax/jcr/query/qom/Join/index.d.ts +1 -1
  214. package/types/javax/jcr/query/qom/Length/index.d.ts +1 -1
  215. package/types/javax/jcr/query/qom/Literal/index.d.ts +1 -1
  216. package/types/javax/jcr/query/qom/LowerCase/index.d.ts +1 -1
  217. package/types/javax/jcr/query/qom/NodeLocalName/index.d.ts +1 -1
  218. package/types/javax/jcr/query/qom/NodeName/index.d.ts +1 -1
  219. package/types/javax/jcr/query/qom/Not/index.d.ts +1 -1
  220. package/types/javax/jcr/query/qom/Or/index.d.ts +1 -1
  221. package/types/javax/jcr/query/qom/PropertyExistence/index.d.ts +1 -1
  222. package/types/javax/jcr/query/qom/PropertyValue/index.d.ts +1 -1
  223. package/types/javax/jcr/query/qom/QueryObjectModel/index.d.ts +1 -1
  224. package/types/javax/jcr/query/qom/QueryObjectModelConstants/index.d.ts +73 -1
  225. package/types/javax/jcr/query/qom/QueryObjectModelFactory/index.d.ts +1 -1
  226. package/types/javax/jcr/query/qom/SameNode/index.d.ts +1 -1
  227. package/types/javax/jcr/query/qom/SameNodeJoinCondition/index.d.ts +1 -1
  228. package/types/javax/jcr/query/qom/Selector/index.d.ts +1 -1
  229. package/types/javax/jcr/query/qom/StaticOperand/index.d.ts +1 -1
  230. package/types/javax/jcr/query/qom/UpperCase/index.d.ts +1 -1
  231. package/types/javax/jcr/security/AccessControlList/index.d.ts +1 -1
  232. package/types/javax/jcr/security/AccessControlPolicyIterator/index.d.ts +1 -1
  233. package/types/javax/jcr/security/NamedAccessControlPolicy/index.d.ts +1 -1
  234. package/types/javax/jcr/security/Privilege/index.d.ts +127 -43
  235. package/types/javax/jcr/version/Version/index.d.ts +1 -1
  236. package/types/javax/jcr/version/VersionHistory/index.d.ts +1 -1
  237. package/types/javax/jcr/version/VersionIterator/index.d.ts +1 -1
  238. package/types/senselogic/sitevision/api/base/Requireable/ScriptEngine/index.d.ts +9 -0
  239. package/types/senselogic/sitevision/api/base/Requireable/ScriptEngine/index.js +11 -0
  240. package/types/senselogic/sitevision/api/collaboration/CollaborationGroupWrapper/index.d.ts +9 -5
  241. package/types/senselogic/sitevision/api/format/NumericFormatterBuilder/index.d.ts +1 -1
  242. package/types/senselogic/sitevision/api/link/CustomLinkProcessor/index.d.ts +1 -1
  243. package/types/senselogic/sitevision/api/render/BuddyIconRenderer.BuddyIconInfo/index.d.ts +49 -0
  244. package/types/senselogic/sitevision/api/render/BuddyIconRenderer.BuddyIconInfo/index.js +12 -0
  245. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.ArticleUtilConstants/index.d.ts +83 -0
  246. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.ArticleUtilConstants/index.js +21 -0
  247. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.ExceptionSuppressingProxyConstants/index.d.ts +29 -0
  248. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.ExceptionSuppressingProxyConstants/index.js +12 -0
  249. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.IndexingUtilConstants/index.d.ts +29 -0
  250. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.IndexingUtilConstants/index.js +12 -0
  251. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.LinkPageUtilConstants/index.d.ts +65 -0
  252. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.LinkPageUtilConstants/index.js +18 -0
  253. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.MathInstanceConstants/index.d.ts +23 -0
  254. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.MathInstanceConstants/index.js +11 -0
  255. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.MimeTypeUtilConstants/index.d.ts +17 -0
  256. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.MimeTypeUtilConstants/index.js +10 -0
  257. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.NodeTypeUtilConstants/index.d.ts +1241 -0
  258. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.NodeTypeUtilConstants/index.js +189 -0
  259. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.OutputUtilConstants/index.d.ts +29 -0
  260. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.OutputUtilConstants/index.js +12 -0
  261. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.PageUtilConstants/index.d.ts +89 -0
  262. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.PageUtilConstants/index.js +22 -0
  263. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.PortletContextUtilConstants/index.d.ts +25 -0
  264. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.PortletContextUtilConstants/index.js +11 -0
  265. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.PortletUtilConstants/index.d.ts +17 -0
  266. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.PortletUtilConstants/index.js +10 -0
  267. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.QueryStringUtilConstants/index.d.ts +17 -0
  268. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.QueryStringUtilConstants/index.js +10 -0
  269. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.SearchHitConstants/index.d.ts +23 -0
  270. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.SearchHitConstants/index.js +11 -0
  271. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.SearchResultConstants/index.d.ts +35 -0
  272. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.SearchResultConstants/index.js +13 -0
  273. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.VersionUtilConstants/index.d.ts +23 -0
  274. package/types/senselogic/sitevision/api/render/velocity/VelocityAccess.VersionUtilConstants/index.js +11 -0
  275. package/types/senselogic/sitevision/api/script/RequesterChainable/index.d.ts +2 -2
  276. package/types/senselogic/sitevision/api/script/proxy/ExceptionSuppressingProxy/index.d.ts +22 -2
  277. package/types/senselogic/sitevision/api/search/SearchHit/index.d.ts +16 -2
  278. package/types/senselogic/sitevision/api/search/SearchResult/index.d.ts +28 -6
  279. package/types/senselogic/sitevision/api/security/jaas/filter/AuthenticationFilter/index.d.ts +31 -1
  280. package/types/senselogic/sitevision/api/user/UserIdentityWrapper/index.d.ts +1 -1
@@ -1,321 +1,295 @@
1
1
  import type { Node } from "../../types/javax/jcr/Node";
2
2
 
3
3
  /**
4
- * <p>
5
- * Adds several files to a sv:localFileRepository, sv:fileRepository, sv:personalFileRepository or a sv:folder
6
- * residing as sub node to a file repository.
7
- * </p>
8
- * <p>
9
- * Files are specified by a map where the keys denotes the file names (will correspond to the property fileName
10
- * of the sv:file nodes) and the values denotes the URIs pointing to the file resources. The file resources
11
- * (i.e. the URIs) must be accessible from the Sitevision server. Sitevision opens a stream with the URI value
12
- * when creating/uploading the binary content of the file. If a firewall or such blocks outgoing communication
13
- * from the server - file creation will fail.
14
- * </p>
15
- * <p>
16
- * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
17
- * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
18
- * </p>
19
- * <p>
20
- * A warning will be written to the system log if Sitevision for any reason is unable to create one of the files.
21
- * </p>
22
- * @param aParent the parent node for the files
23
- * @param aFileMappings a map of file name to URI pairs
24
- * @throws java.lang.NullPointerException if <code>aParent</code> or <code>aFileMappings</code> is <code>null</code>
25
- * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified or if file exceeds file size limit
26
- * @throws RepositoryException if something else goes wrong
27
- */
28
- export function createFiles(aParent: Node, aFileMappings: unknown): void;
29
-
30
- /**
31
- * Creates a file using a uri string.
4
+ * File utility interface that handles nodes with primary node type <code>sv:file</code> and <code>sv:temporaryFile</code>.
32
5
  *
33
6
  * <p>
34
- * Note that the <code>aParent</code> of the file must be a <code>sv:localFileRepository</code>, <code>sv:fileRepository</code>,
35
- * <code>sv:personalFileRepository</code> or a <code>sv:folder</code> residing as sub node to a file repository.
36
- * </p>
37
- * <p>
38
- * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
39
- * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
40
- * </p>
41
- * <p>
42
- * <strong>URI note!</strong> The file resource must be accessible from the Sitevision server! Sitevision opens
43
- * a stream to an URL with the <code>aUri</code> value when creating/uploading the binary content of the file.
44
- * If a firewall or such blocks outgoing communication from the server - file creation will fail.
7
+ * <em>Note!</em> This interface is used to <em>create</em> files. You would typically use
8
+ * {@link senselogic.sitevision.api.webresource.structure.StructureUtil} to <em>move</em> a file
9
+ * and {@link senselogic.sitevision.api.webresource.structure.TrashcanUtil} to <em>delete</em> a file.
10
+ * To check <em>MIME/Content-Type</em> for a file you would typically use {@link senselogic.sitevision.api.webresource.mime.MimeTypeUtil}.
45
11
  * </p>
46
- * @param aParent the parent node of the file
47
- * @param aFileName the filename
48
- * @param aUri the URI pointing to the file resource retrievable from the Sitevision server
49
- * @return a sv:file node corresponding to the newly created file. Will never return <code>null</code>
50
- * @throws java.lang.NullPointerException if <code>aParent</code>, <code>aFileName</code> or <code>aUri</code> is <code>null</code>
51
- * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified or if file exceeds file size limit
52
- * @throws RepositoryException if something else goes wrong
53
- */
54
- export function createFile(
55
- aParent: Node,
56
- aFileName: string,
57
- aUri: string
58
- ): Node;
59
-
60
- /**
61
- * Creates a file using a base64 string.
62
12
  *
63
13
  * <p>
64
- * The base64 decoder uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for decoding operation.
65
- * The decoder rejects data that contains characters outside the base64 alphabet.
66
- * </p>
67
- * <p>
68
- * Note that the <code>aParent</code> of the file must be a <code>sv:localFileRepository</code>, <code>sv:fileRepository</code>,
69
- * <code>sv:personalFileRepository</code> or a <code>sv:folder</code> residing as sub node to a file repository.
70
- * </p>
71
- * <p>
72
- * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
73
- * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
14
+ * An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getFileUtil()}.
15
+ * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
74
16
  * </p>
75
- * @param aParent the parent node of the file
76
- * @param aFileName the filename
77
- * @param aBase64EncodedString a base64 encoded string
78
- * @return a sv:file node corresponding to the newly created file. Will never return <code>null</code>
79
- * @throws java.lang.NullPointerException if <code>aParent</code>, <code>aFileName</code> or <code>aBase64EncodedString</code> is <code>null</code>
80
- * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified, if <code>aBase64EncodedString</code> is not base64 encoded or if file exceeds file size limit
81
- * @throws RepositoryException if something else goes wrong
82
- * @since Sitevision 4.5.4
17
+ * @author Mikael Wikblom
18
+ * @since Sitevision 2.6.2
83
19
  */
84
- export function createFileFromBase64(
85
- aParent: Node,
86
- aFileName: string,
87
- aBase64EncodedString: string
88
- ): Node;
20
+ export interface FileUtil {
21
+ /**
22
+ * <p>
23
+ * Adds several files to a sv:localFileRepository, sv:fileRepository, sv:personalFileRepository or a sv:folder
24
+ * residing as sub node to a file repository.
25
+ * </p>
26
+ * <p>
27
+ * Files are specified by a map where the keys denotes the file names (will correspond to the property fileName
28
+ * of the sv:file nodes) and the values denotes the URIs pointing to the file resources. The file resources
29
+ * (i.e. the URIs) must be accessible from the Sitevision server. Sitevision opens a stream with the URI value
30
+ * when creating/uploading the binary content of the file. If a firewall or such blocks outgoing communication
31
+ * from the server - file creation will fail.
32
+ * </p>
33
+ * <p>
34
+ * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
35
+ * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
36
+ * </p>
37
+ * <p>
38
+ * A warning will be written to the system log if Sitevision for any reason is unable to create one of the files.
39
+ * </p>
40
+ * @param aParent the parent node for the files
41
+ * @param aFileMappings a map of file name to URI pairs
42
+ * @throws java.lang.NullPointerException if <code>aParent</code> or <code>aFileMappings</code> is <code>null</code>
43
+ * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified or if file exceeds file size limit
44
+ * @throws RepositoryException if something else goes wrong
45
+ */
46
+ createFiles(aParent: Node, aFileMappings: unknown): void;
89
47
 
90
- /**
91
- * Creates a file using a sv:temporaryFile.
92
- *
93
- * <p>
94
- * Note that the <code>aParent</code> of the file must be a <code>sv:localFileRepository</code>, <code>sv:fileRepository</code>,
95
- * <code>sv:personalFileRepository</code> or a <code>sv:folder</code> residing as sub node to a file repository.
96
- * </p>
97
- * <p>
98
- * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
99
- * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
100
- * </p>
101
- * @param aParent the parent node of the file
102
- * @param aTemporaryFile a sv:temporaryFile (typically created via {@link senselogic.sitevision.api.node.builder.TemporaryFileNodeBuilder})
103
- * @return a sv:file node corresponding to the newly created file. Will never return <code>null</code>
104
- * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified, if an invalid temporary node is specified or if file exceeds file size limit
105
- * @throws RepositoryException if something else goes wrong
106
- * @since Sitevision 4.5.4
107
- */
108
- export function createFileFromTemporary(
109
- aParent: Node,
110
- aTemporaryFile: Node
111
- ): Node;
48
+ /**
49
+ * Creates a file using a uri string.
50
+ *
51
+ * <p>
52
+ * Note that the <code>aParent</code> of the file must be a <code>sv:localFileRepository</code>, <code>sv:fileRepository</code>,
53
+ * <code>sv:personalFileRepository</code> or a <code>sv:folder</code> residing as sub node to a file repository.
54
+ * </p>
55
+ * <p>
56
+ * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
57
+ * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
58
+ * </p>
59
+ * <p>
60
+ * <strong>URI note!</strong> The file resource must be accessible from the Sitevision server! Sitevision opens
61
+ * a stream to an URL with the <code>aUri</code> value when creating/uploading the binary content of the file.
62
+ * If a firewall or such blocks outgoing communication from the server - file creation will fail.
63
+ * </p>
64
+ * @param aParent the parent node of the file
65
+ * @param aFileName the filename
66
+ * @param aUri the URI pointing to the file resource retrievable from the Sitevision server
67
+ * @return a sv:file node corresponding to the newly created file. Will never return <code>null</code>
68
+ * @throws java.lang.NullPointerException if <code>aParent</code>, <code>aFileName</code> or <code>aUri</code> is <code>null</code>
69
+ * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified or if file exceeds file size limit
70
+ * @throws RepositoryException if something else goes wrong
71
+ */
72
+ createFile(aParent: Node, aFileName: string, aUri: string): Node;
112
73
 
113
- /**
114
- * Updates the binary content of an existing file using a uri string.
115
- *
116
- * <p>
117
- * Properties related to the binary content will also be updated (e.g. <code>length</code>). A new version will
118
- * be created if the binary content of a <em>group file</em> is updated.
119
- * </p>
120
- * <p>
121
- * <strong>URI note!</strong> The URI must be accessible from the Sitevision server and the ending part
122
- * of the URI must match the file extension of the existing file that should be updated! Sitevision opens
123
- * a stream to an URL with the <code>anUri</code> value when uploading the binary content of the file.
124
- * If a firewall or such blocks outgoing communication from the server - file update will fail.
125
- * </p>
126
- * <p>
127
- * <strong>Permission note!</strong> Current user must be authorized to alter the file node that
128
- * should be updated (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
129
- * </p>
130
- * @param aFile the file
131
- * @param aUri the URI pointing to the file resource to fetch new binary content from
132
- * @throws ConstraintViolationException if the user is not authorized to alter the file node, if an invalid node is specified, if the end part of <code>aUri</code> doesn't match the file extension of <code>aFile</code> or if file exceeds file size limit
133
- * @throws RepositoryException if something else goes wrong
134
- * @since Sitevision 3.6.3
135
- */
136
- export function updateBinaryContent(aFile: Node, aUri: string): void;
74
+ /**
75
+ * Creates a file using a base64 string.
76
+ *
77
+ * <p>
78
+ * The base64 decoder uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for decoding operation.
79
+ * The decoder rejects data that contains characters outside the base64 alphabet.
80
+ * </p>
81
+ * <p>
82
+ * Note that the <code>aParent</code> of the file must be a <code>sv:localFileRepository</code>, <code>sv:fileRepository</code>,
83
+ * <code>sv:personalFileRepository</code> or a <code>sv:folder</code> residing as sub node to a file repository.
84
+ * </p>
85
+ * <p>
86
+ * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
87
+ * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
88
+ * </p>
89
+ * @param aParent the parent node of the file
90
+ * @param aFileName the filename
91
+ * @param aBase64EncodedString a base64 encoded string
92
+ * @return a sv:file node corresponding to the newly created file. Will never return <code>null</code>
93
+ * @throws java.lang.NullPointerException if <code>aParent</code>, <code>aFileName</code> or <code>aBase64EncodedString</code> is <code>null</code>
94
+ * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified, if <code>aBase64EncodedString</code> is not base64 encoded or if file exceeds file size limit
95
+ * @throws RepositoryException if something else goes wrong
96
+ * @since Sitevision 4.5.4
97
+ */
98
+ createFileFromBase64(
99
+ aParent: Node,
100
+ aFileName: string,
101
+ aBase64EncodedString: string
102
+ ): Node;
137
103
 
138
- /**
139
- * Updates the binary content of an existing file using a base64 string.
140
- *
141
- * <p>
142
- * The base64 decoder uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for decoding operation.
143
- * The decoder rejects data that contains characters outside the base64 alphabet.
144
- * </p>
145
- * <p>
146
- * Properties related to the binary content will also be updated (e.g. <code>length</code>). A new version will
147
- * be created if the binary content of a <em>group file</em> is updated.
148
- * </p>
149
- * <p>
150
- * <strong>Permission note!</strong> Current user must be authorized to alter the file node that
151
- * should be updated (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
152
- * </p>
153
- * @param aFile the file
154
- * @param aBase64EncodedString a base64 encoded string
155
- * @throws ConstraintViolationException if the user is not authorized to alter the file node, if an invalid node is specified, if <code>aBase64EncodedString</code> is not base64 encoded, if file exceeds file size limit or if file exceeds file size limit
156
- * @throws RepositoryException if something else goes wrong
157
- * @since Sitevision 4.5.4
158
- */
159
- export function updateBinaryContentFromBase64(
160
- aFile: Node,
161
- aBase64EncodedString: string
162
- ): void;
104
+ /**
105
+ * Creates a file using a sv:temporaryFile.
106
+ *
107
+ * <p>
108
+ * Note that the <code>aParent</code> of the file must be a <code>sv:localFileRepository</code>, <code>sv:fileRepository</code>,
109
+ * <code>sv:personalFileRepository</code> or a <code>sv:folder</code> residing as sub node to a file repository.
110
+ * </p>
111
+ * <p>
112
+ * <strong>Permission note!</strong> Current user must be authorized to alter the parent node
113
+ * (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
114
+ * </p>
115
+ * @param aParent the parent node of the file
116
+ * @param aTemporaryFile a sv:temporaryFile (typically created via {@link senselogic.sitevision.api.node.builder.TemporaryFileNodeBuilder})
117
+ * @return a sv:file node corresponding to the newly created file. Will never return <code>null</code>
118
+ * @throws ConstraintViolationException if the user is not authorized to alter the parent node, if an invalid parent node is specified, if an invalid temporary node is specified or if file exceeds file size limit
119
+ * @throws RepositoryException if something else goes wrong
120
+ * @since Sitevision 4.5.4
121
+ */
122
+ createFileFromTemporary(aParent: Node, aTemporaryFile: Node): Node;
163
123
 
164
- /**
165
- * Updates the binary content of an existing file using a sv:temporaryFile.
166
- *
167
- * <p>
168
- * Properties related to the binary content will also be updated (e.g. <code>length</code>). A new version will
169
- * be created if the binary content of a <em>group file</em> is updated.
170
- * </p>
171
- * <p>
172
- * <strong>Permission note!</strong> Current user must be authorized to alter the file node that
173
- * should be updated (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
174
- * </p>
175
- * @param aFile the file
176
- * @param aTemporaryFile the sv:temporaryFile (typically created via {@link senselogic.sitevision.api.node.builder.TemporaryFileNodeBuilder})
177
- * @throws ConstraintViolationException if the user is not authorized to alter the file node, if an invalid node is specified, if the end part of the file represented by <code>aTemporaryFile</code> doesn't match the file extension of <code>aFile</code> or if file exceeds file size limit
178
- * @throws RepositoryException if something else goes wrong
179
- * @since Sitevision 4.5.4
180
- */
181
- export function updateBinaryContentFromTemporary(
182
- aFile: Node,
183
- aTemporaryFile: Node
184
- ): void;
124
+ /**
125
+ * Updates the binary content of an existing file using a uri string.
126
+ *
127
+ * <p>
128
+ * Properties related to the binary content will also be updated (e.g. <code>length</code>). A new version will
129
+ * be created if the binary content of a <em>group file</em> is updated.
130
+ * </p>
131
+ * <p>
132
+ * <strong>URI note!</strong> The URI must be accessible from the Sitevision server and the ending part
133
+ * of the URI must match the file extension of the existing file that should be updated! Sitevision opens
134
+ * a stream to an URL with the <code>anUri</code> value when uploading the binary content of the file.
135
+ * If a firewall or such blocks outgoing communication from the server - file update will fail.
136
+ * </p>
137
+ * <p>
138
+ * <strong>Permission note!</strong> Current user must be authorized to alter the file node that
139
+ * should be updated (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
140
+ * </p>
141
+ * @param aFile the file
142
+ * @param aUri the URI pointing to the file resource to fetch new binary content from
143
+ * @throws ConstraintViolationException if the user is not authorized to alter the file node, if an invalid node is specified, if the end part of <code>aUri</code> doesn't match the file extension of <code>aFile</code> or if file exceeds file size limit
144
+ * @throws RepositoryException if something else goes wrong
145
+ * @since Sitevision 3.6.3
146
+ */
147
+ updateBinaryContent(aFile: Node, aUri: string): void;
185
148
 
186
- /**
187
- * Gets the contents of a file as a String using the UTF-8 character encoding.
188
- *
189
- * <p>
190
- * <em>Note! This is mere a convenience method for {@link #getContentAsString(Node, String)} using UTF-8 as character encoding.</em>
191
- * </p>
192
- * @param aFile the file Node (sv:file or sv:temporaryFile)
193
- * @return the UTF-8 file content, or null if aFile isn't a character-based file
194
- * @see #getContentAsString(Node, String)
195
- * @since Sitevision 4.1.1
196
- */
197
- export function getContentAsString(aFile: Node): string;
149
+ /**
150
+ * Updates the binary content of an existing file using a base64 string.
151
+ *
152
+ * <p>
153
+ * The base64 decoder uses "The Base64 Alphabet" as specified in Table 1 of RFC 4648 and RFC 2045 for decoding operation.
154
+ * The decoder rejects data that contains characters outside the base64 alphabet.
155
+ * </p>
156
+ * <p>
157
+ * Properties related to the binary content will also be updated (e.g. <code>length</code>). A new version will
158
+ * be created if the binary content of a <em>group file</em> is updated.
159
+ * </p>
160
+ * <p>
161
+ * <strong>Permission note!</strong> Current user must be authorized to alter the file node that
162
+ * should be updated (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
163
+ * </p>
164
+ * @param aFile the file
165
+ * @param aBase64EncodedString a base64 encoded string
166
+ * @throws ConstraintViolationException if the user is not authorized to alter the file node, if an invalid node is specified, if <code>aBase64EncodedString</code> is not base64 encoded, if file exceeds file size limit or if file exceeds file size limit
167
+ * @throws RepositoryException if something else goes wrong
168
+ * @since Sitevision 4.5.4
169
+ */
170
+ updateBinaryContentFromBase64(
171
+ aFile: Node,
172
+ aBase64EncodedString: string
173
+ ): void;
198
174
 
199
- /**
200
- * Gets the contents of a file as a String using a given character encoding.
201
- *
202
- * <p>
203
- * <em>Note!</em> This method operates on character-based file nodes only! That is:
204
- * </p>
205
- * <ul>
206
- * <li>
207
- * Files that are of <em>text type</em> (as of {@link senselogic.sitevision.api.webresource.mime.MimeTypeUtil#isTextType(String)}).
208
- * </li>
209
- * <li>
210
- * Files that are of <em>xml type</em> (as of {@link senselogic.sitevision.api.webresource.mime.MimeTypeUtil#isXmlType(String)}).
211
- * </li>
212
- * <li>
213
- * Common "cross-over/mixed-types" files, such as <em>json</em> (application type) and <em>svg</em> (image type).
214
- * </li>
215
- * </ul>
216
- * @param aFile the file Node (sv:file or sv:temporaryFile)
217
- * @param aCharacterEncoding the character encoding (Note! UTF-8 will be used instead for null, empty and illegal/unsupported encoding)
218
- * @return the file content using the specified character encoding, or null if aFile isn't a character-based file
219
- * @since Sitevision 4.1.1
220
- */
221
- export function getContentAsString(
222
- aFile: Node,
223
- aCharacterEncoding: string
224
- ): string;
175
+ /**
176
+ * Updates the binary content of an existing file using a sv:temporaryFile.
177
+ *
178
+ * <p>
179
+ * Properties related to the binary content will also be updated (e.g. <code>length</code>). A new version will
180
+ * be created if the binary content of a <em>group file</em> is updated.
181
+ * </p>
182
+ * <p>
183
+ * <strong>Permission note!</strong> Current user must be authorized to alter the file node that
184
+ * should be updated (e.g. {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
185
+ * </p>
186
+ * @param aFile the file
187
+ * @param aTemporaryFile the sv:temporaryFile (typically created via {@link senselogic.sitevision.api.node.builder.TemporaryFileNodeBuilder})
188
+ * @throws ConstraintViolationException if the user is not authorized to alter the file node, if an invalid node is specified, if the end part of the file represented by <code>aTemporaryFile</code> doesn't match the file extension of <code>aFile</code> or if file exceeds file size limit
189
+ * @throws RepositoryException if something else goes wrong
190
+ * @since Sitevision 4.5.4
191
+ */
192
+ updateBinaryContentFromTemporary(aFile: Node, aTemporaryFile: Node): void;
225
193
 
226
- /**
227
- * Alters the name of a file.
228
- *
229
- * <p>
230
- * If no file is specified a <code>NullPointerException</code> is thrown.
231
- * If the node is not a sv:file an <code>IllegalArgumentException</code> is thrown.
232
- * If no name is provided a <code>NullPointerException</code> is thrown.
233
- * </p>
234
- *
235
- * <p>
236
- * <strong>Permission note!</strong> Current user (the invoker of this method) must have WRITE permission
237
- * on the file node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
238
- * <em>Updating a file for a <code>sv:userIdentity</code> requires
239
- * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.</em>
240
- * </p>
241
- * @param aFile the sv:file that should be renamed. May not be <code>null</code>
242
- * @param aNewName the new name of the file. May not be <code>null</code>
243
- * @throws ConstraintViolationException if the current user is not authorized to alter the name of the file or if the file extension doesn't match
244
- * @throws RepositoryException if something else goes wrong
245
- * @since Sitevision 4.5.2
246
- */
247
- export function renameFile(aFile: Node, aNewName: string): void;
194
+ /**
195
+ * Gets the contents of a file as a String using the UTF-8 character encoding.
196
+ *
197
+ * <p>
198
+ * <em>Note! This is mere a convenience method for {@link #getContentAsString(Node, String)} using UTF-8 as character encoding.</em>
199
+ * </p>
200
+ * @param aFile the file Node (sv:file or sv:temporaryFile)
201
+ * @return the UTF-8 file content, or null if aFile isn't a character-based file
202
+ * @see #getContentAsString(Node, String)
203
+ * @since Sitevision 4.1.1
204
+ */
205
+ getContentAsString(aFile: Node): string;
248
206
 
249
- /**
250
- * Modifies versioning for a file.
251
- *
252
- * <p>
253
- * <strong>Permission note!</strong> Current user (the invoker of this method) must have WRITE permission
254
- * on the file node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
255
- * </p>
256
- * @param aFile the sv:file. May not be null
257
- * @param aVersioned the new state of versioning for this file
258
- * @throws ConstraintViolationException if the current user is not authorized to mutate aFile or if aFile is not a sv:file
259
- * @throws RepositoryException if something else goes wrong
260
- * @since Sitevision 9.1
261
- */
262
- export function setVersioned(aFile: Node, aVersioned: boolean): void;
207
+ /**
208
+ * Gets the contents of a file as a String using a given character encoding.
209
+ *
210
+ * <p>
211
+ * <em>Note!</em> This method operates on character-based file nodes only! That is:
212
+ * </p>
213
+ * <ul>
214
+ * <li>
215
+ * Files that are of <em>text type</em> (as of {@link senselogic.sitevision.api.webresource.mime.MimeTypeUtil#isTextType(String)}).
216
+ * </li>
217
+ * <li>
218
+ * Files that are of <em>xml type</em> (as of {@link senselogic.sitevision.api.webresource.mime.MimeTypeUtil#isXmlType(String)}).
219
+ * </li>
220
+ * <li>
221
+ * Common "cross-over/mixed-types" files, such as <em>json</em> (application type) and <em>svg</em> (image type).
222
+ * </li>
223
+ * </ul>
224
+ * @param aFile the file Node (sv:file or sv:temporaryFile)
225
+ * @param aCharacterEncoding the character encoding (Note! UTF-8 will be used instead for null, empty and illegal/unsupported encoding)
226
+ * @return the file content using the specified character encoding, or null if aFile isn't a character-based file
227
+ * @since Sitevision 4.1.1
228
+ */
229
+ getContentAsString(aFile: Node, aCharacterEncoding: string): string;
263
230
 
264
- /**
265
- * Modifies download protection for a file.
266
- *
267
- * <p>
268
- * <strong>Permission note!</strong> Current user (the invoker of this method) must have WRITE permission and MANAGE_DOWNLOAD_PROTECTION
269
- * permission on the file node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}
270
- * and {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_DOWNLOAD_PROTECTION}).
271
- * </p>
272
- *
273
- * <p>
274
- * <em>Tip! Use {@link senselogic.sitevision.api.property.PropertyUtil} or {@link senselogic.sitevision.api.property.Properties}
275
- * to check current state, i.e. the "downloadProtected" boolean property.</em>
276
- * </p>
277
- * @param aFile the sv:file. May not be null
278
- * @param aDownloadProtected the new state of download protection for aFile
279
- * @throws ConstraintViolationException if the current user is not authorized to mutate aFile or if aFile is not a sv:file
280
- * @throws RepositoryException if something else goes wrong
281
- * @since Sitevision 2022.08.1
282
- */
283
- export function setDownloadProtected(
284
- aFile: Node,
285
- aDownloadProtected: boolean
286
- ): void;
231
+ /**
232
+ * Alters the name of a file.
233
+ *
234
+ * <p>
235
+ * If no file is specified a <code>NullPointerException</code> is thrown.
236
+ * If the node is not a sv:file an <code>IllegalArgumentException</code> is thrown.
237
+ * If no name is provided a <code>NullPointerException</code> is thrown.
238
+ * </p>
239
+ *
240
+ * <p>
241
+ * <strong>Permission note!</strong> Current user (the invoker of this method) must have WRITE permission
242
+ * on the file node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
243
+ * <em>Updating a file for a <code>sv:userIdentity</code> requires
244
+ * {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_USER_IDENTITIES} on current page.</em>
245
+ * </p>
246
+ * @param aFile the sv:file that should be renamed. May not be <code>null</code>
247
+ * @param aNewName the new name of the file. May not be <code>null</code>
248
+ * @throws ConstraintViolationException if the current user is not authorized to alter the name of the file or if the file extension doesn't match
249
+ * @throws RepositoryException if something else goes wrong
250
+ * @since Sitevision 4.5.2
251
+ */
252
+ renameFile(aFile: Node, aNewName: string): void;
287
253
 
288
- /**
289
- * File utility interface that handles nodes with primary node type <code>sv:file</code> and <code>sv:temporaryFile</code>.
290
- *
291
- * <p>
292
- * <em>Note!</em> This interface is used to <em>create</em> files. You would typically use
293
- * {@link senselogic.sitevision.api.webresource.structure.StructureUtil} to <em>move</em> a file
294
- * and {@link senselogic.sitevision.api.webresource.structure.TrashcanUtil} to <em>delete</em> a file.
295
- * To check <em>MIME/Content-Type</em> for a file you would typically use {@link senselogic.sitevision.api.webresource.mime.MimeTypeUtil}.
296
- * </p>
297
- *
298
- * <p>
299
- * An instance of the Sitevision class implementing this interface can be obtained via {@link senselogic.sitevision.api.Utils#getFileUtil()}.
300
- * See {@link senselogic.sitevision.api.Utils} for how to obtain an instance of the <code>Utils</code> interface.
301
- * </p>
302
- * @author Mikael Wikblom
303
- * @since Sitevision 2.6.2
304
- */
305
- declare namespace fileUtil {
306
- export {
307
- createFiles,
308
- createFile,
309
- createFileFromBase64,
310
- createFileFromTemporary,
311
- updateBinaryContent,
312
- updateBinaryContentFromBase64,
313
- updateBinaryContentFromTemporary,
314
- getContentAsString,
315
- renameFile,
316
- setVersioned,
317
- setDownloadProtected,
318
- };
254
+ /**
255
+ * Modifies versioning for a file.
256
+ *
257
+ * <p>
258
+ * <strong>Permission note!</strong> Current user (the invoker of this method) must have WRITE permission
259
+ * on the file node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}).
260
+ * </p>
261
+ * @param aFile the sv:file. May not be null
262
+ * @param aVersioned the new state of versioning for this file
263
+ * @throws ConstraintViolationException if the current user is not authorized to mutate aFile or if aFile is not a sv:file
264
+ * @throws RepositoryException if something else goes wrong
265
+ * @since Sitevision 9.1
266
+ */
267
+ setVersioned(aFile: Node, aVersioned: boolean): void;
268
+
269
+ /**
270
+ * Modifies download protection for a file.
271
+ *
272
+ * <p>
273
+ * <strong>Permission note!</strong> Current user (the invoker of this method) must have WRITE permission and MANAGE_DOWNLOAD_PROTECTION
274
+ * permission on the file node that should be updated (see {@link senselogic.sitevision.api.security.PermissionUtil.Permission#WRITE}
275
+ * and {@link senselogic.sitevision.api.security.PermissionUtil.Permission#MANAGE_DOWNLOAD_PROTECTION}).
276
+ * </p>
277
+ *
278
+ * <p>
279
+ * <em>Tip! Use {@link senselogic.sitevision.api.property.PropertyUtil} or {@link senselogic.sitevision.api.property.Properties}
280
+ * to check current state, i.e. the "downloadProtected" boolean property.</em>
281
+ * </p>
282
+ * @param aFile the sv:file. May not be null
283
+ * @param aDownloadProtected the new state of download protection for aFile
284
+ * @throws ConstraintViolationException if the current user is not authorized to mutate aFile or if aFile is not a sv:file
285
+ * @throws RepositoryException if something else goes wrong
286
+ * @since Sitevision 2022.08.1
287
+ */
288
+ setDownloadProtected(aFile: Node, aDownloadProtected: boolean): void;
319
289
  }
320
290
 
291
+ declare namespace FileUtil {}
292
+
293
+ declare var fileUtil: FileUtil;
294
+
321
295
  export default fileUtil;