webdav.client 5.20.5664
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.
- package/.npmignore +2 -0
- package/Help/ClassReference/Create.html +3026 -0
- package/Help/ClassReference/ITHit.Environment.html +2961 -0
- package/Help/ClassReference/ITHit.LogLevel.html +3198 -0
- package/Help/ClassReference/ITHit.Logger.html +3381 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.AsyncResult.html +3096 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.BrowserExtension.html +3493 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.CancellableResult.html +3262 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.DavConstants.html +4368 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Depth.html +3035 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.DocManager.html +4756 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Encoder.html +3006 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Error.html +3006 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.BadRequestException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.ConflictException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.DependencyFailedException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.ForbiddenException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.Error.html +2969 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.Multistatus.html +2920 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.MultistatusResponse.html +2920 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.PropertyMultistatus.html +2972 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Info.PropertyMultistatusResponse.html +2920 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.InsufficientStorageException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.IntegrationException.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.LockedException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.MethodNotAllowedException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.NotFoundException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.NotImplementedException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.Parsers.InsufficientStorage.html +3022 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PreconditionFailedException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyConflictException.html +3147 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyException.html +3147 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyForbiddenException.html +3147 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.PropertyNotFoundException.html +3147 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.QuotaNotExceededException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.SufficientDiskSpaceException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.UnauthorizedException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.WebDavException.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Exceptions.WebDavHttpException.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Features.html +3423 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.File.html +9512 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Folder.html +11207 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.HierarchyItem.html +8575 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.HttpStatus.html +4945 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.LockInfo.html +3141 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.LockScope.html +3020 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.LockUriTokenPair.html +3006 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.CancelUpload.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.CopyMove.html +2967 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Delete.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.ErrorResponse.html +2968 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Get.GoAsync.html +3047 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Get.html +2921 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Head.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.HttpMethod.html +2982 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Lock.Go.html +3083 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Lock.GoAsync.html +3101 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Lock.html +2924 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.LockRefresh.Go.html +3083 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.LockRefresh.GoAsync.html +3101 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.LockRefresh.html +2924 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Mkcol.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.MultiResponse.html +2968 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Options.html +2965 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Propfind.html +2967 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Proppatch.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Propstat.html +2950 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Put.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Report.html +2978 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Response.html +2968 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.ResponseFactory.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Search.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.SingleResponse.html +2959 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Undelete.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.Unlock.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.UpdateToVersion.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Methods.VersionControl.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.MsOfficeEditExtensions.html +3289 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Multistatus.html +3006 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.MultistatusResponse.html +3051 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.OptionsInfo.html +2961 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.OrderProperty.html +3172 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.PageResults.html +3006 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Property.html +3229 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.PropertyList.html +3265 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.PropertyMultistatusResponse.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.PropertyName.html +3184 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Request.html +3818 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.RequestProgress.html +3186 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.ResourceType.html +2973 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.ResumableUpload.html +3482 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.SPSManager.html +3170 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.SearchQuery.html +3186 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Source.html +3006 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.DocManager.MsOfficeEditExtensions.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Delete.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetFolderItems.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetHeadRequests.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetItemByFolder.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetItemBySession.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.GetParent.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.ItemExists.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.MicrosoftOfficeDiscovery.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.NameCheck.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Progress.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Refresh.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.Search.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyItems.SupportedFeatures.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyProperties.GetProperties.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.HierarchyProperties.UpdateProperties.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.CheckSupport.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.Etag.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.GetLocks.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.Lock.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Locks.RefreshLock.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.GetVersions.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.ManageVersions.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.PutUnderVersion.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.Versions.ReadContent.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Tests.WebDavSession.Events.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.AutoUploader.html +2970 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Collections.Map.html +3130 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Collections.Pair.html +3004 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.ContentWriter.html +3158 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.DropZone.html +3012 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.FSEntryFactory.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.HtmlControl.html +3002 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Controls.Input.html +3012 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.DropZoneCollection.html +3354 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.AsyncEvent.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.BaseEvent.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.BeforeUploadStarted.html +3242 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.Error.html +2918 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.EventName.html +3059 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.ProgressChanged.html +2918 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.QueueChanged.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.StateChanged.html +2918 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.UploadError.html +3371 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Events.UploadItemsCreated.html +3358 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.FSEntry.html +3039 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.FileSpan.html +3023 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Groups.Group.html +2978 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Groups.GroupManager.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.InputCollection.html +3354 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.ItemSettings.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Path.Generator.html +3102 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Path.PathCache.html +2910 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Progress.html +3186 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Providers.ProgressTracker.html +2961 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Providers.UploadDiff.html +3003 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Providers.UploadProvider.html +3049 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Queue.html +3824 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.ServerItem.html +2978 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Settings.html +3060 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.State.html +3243 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.BaseState.html +2908 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.CanceledState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.CompletedState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.Factory.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.PausedState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.QueuedState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.ResumeState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.SkippedState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.States.UploadingState.html +2914 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.UploadItem.html +6147 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.UploadLocation.html +2978 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Uploader.html +3314 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.UploaderSession.html +4374 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Utils.DavUrl.html +2996 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Utils.DavUrlBuilder.html +2961 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Upload.Utils.RepeatableAction.html +3077 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.UploadProgressInfo.html +3096 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.Version.html +4373 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavRequest.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavResponse.html +2912 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavSession.html +5097 -0
- package/Help/ClassReference/ITHit.WebDAV.Client.WebDavUtil.html +2912 -0
- package/Help/ClassReference/fonts/glyphicons-halflings-regular.eot +0 -0
- package/Help/ClassReference/fonts/glyphicons-halflings-regular.svg +229 -0
- package/Help/ClassReference/fonts/glyphicons-halflings-regular.ttf +0 -0
- package/Help/ClassReference/fonts/glyphicons-halflings-regular.woff +0 -0
- package/Help/ClassReference/global.html +8985 -0
- package/Help/ClassReference/index.html +3889 -0
- package/Help/ClassReference/scripts/bootstrap.min.js +7 -0
- package/Help/ClassReference/scripts/jquery.min.js +6 -0
- package/Help/ClassReference/scripts/jquery.min.map +1 -0
- package/Help/ClassReference/scripts/linenumber.js +29 -0
- package/Help/ClassReference/scripts/main.js +104 -0
- package/Help/ClassReference/scripts/prettify/Apache-License-2.0.txt +202 -0
- package/Help/ClassReference/scripts/prettify/lang-css.js +2 -0
- package/Help/ClassReference/scripts/prettify/prettify.js +28 -0
- package/Help/ClassReference/scripts/underscore-min.js +6 -0
- package/Help/ClassReference/scripts/underscore-min.map +1 -0
- package/Help/ClassReference/styles/bootstrap.min.css +7 -0
- package/Help/ClassReference/styles/jaguar.css +406 -0
- package/Help/ClassReference/styles/prettify-jsdoc.css +111 -0
- package/Help/ClassReference/styles/prettify-tomorrow.css +132 -0
- package/Help/index.html +6 -0
- package/IT Hit WebDAV AJAX Library License Agreement.rtf +314 -0
- package/ITHitWebDAVClient.js +87 -0
- package/Plugins/ITHitEditDocumentOpener.deb +0 -0
- package/Plugins/ITHitEditDocumentOpener.msi +0 -0
- package/Plugins/ITHitEditDocumentOpener.pkg +0 -0
- package/Plugins/ITHitEditDocumentOpener.rpm +0 -0
- package/README.md +98 -0
- package/Tests/DocManager/MsOfficeEditExtensions.js +53 -0
- package/Tests/Helper.js +214 -0
- package/Tests/HierarchyItems/CopyMove.js +341 -0
- package/Tests/HierarchyItems/CreateFile.js +157 -0
- package/Tests/HierarchyItems/CreateFolder.js +156 -0
- package/Tests/HierarchyItems/Delete.js +73 -0
- package/Tests/HierarchyItems/GetFolderItems.js +87 -0
- package/Tests/HierarchyItems/GetHeadRequests.js +73 -0
- package/Tests/HierarchyItems/GetItemByFolder.js +91 -0
- package/Tests/HierarchyItems/GetItemBySession.js +135 -0
- package/Tests/HierarchyItems/GetParent.js +58 -0
- package/Tests/HierarchyItems/ItemExists.js +73 -0
- package/Tests/HierarchyItems/MicrosoftOfficeDiscovery.js +51 -0
- package/Tests/HierarchyItems/NameCheck.js +184 -0
- package/Tests/HierarchyItems/Progress.js +89 -0
- package/Tests/HierarchyItems/Quota.js +35 -0
- package/Tests/HierarchyItems/Refresh.js +68 -0
- package/Tests/HierarchyItems/Search.js +187 -0
- package/Tests/HierarchyItems/SupportedFeatures.js +53 -0
- package/Tests/HierarchyProperties/GetProperties.js +192 -0
- package/Tests/HierarchyProperties/UpdateFolderProperties.js +138 -0
- package/Tests/HierarchyProperties/UpdateProperties.js +187 -0
- package/Tests/ITHitTests.css +72 -0
- package/Tests/ITHitTests.js +560 -0
- package/Tests/Locks/CheckSupport.js +66 -0
- package/Tests/Locks/CopyLock.js +67 -0
- package/Tests/Locks/Etag.js +277 -0
- package/Tests/Locks/GetLocks.js +117 -0
- package/Tests/Locks/Lock.js +134 -0
- package/Tests/Locks/RefreshLock.js +94 -0
- package/Tests/Upload/CancelUpload.js +34 -0
- package/Tests/Upload/GetBytesUploaded.js +47 -0
- package/Tests/Versions/GetVersions.js +84 -0
- package/Tests/Versions/ManageVersions.js +180 -0
- package/Tests/Versions/PutUnderVersion.js +98 -0
- package/Tests/Versions/ReadContent.js +82 -0
- package/Tests/WebDavSession/Events.js +125 -0
- package/Tests/index.html +9 -0
- package/Tests/qunit-runner/highlight/github.css +124 -0
- package/Tests/qunit-runner/highlight/highlight.js +1 -0
- package/Tests/qunit-runner/main.js +340 -0
- package/Tests/qunit-runner/qunit/jquery.js +10308 -0
- package/Tests/qunit-runner/qunit/qunit.css +237 -0
- package/Tests/qunit-runner/qunit/qunit.js +2495 -0
- package/package.json +25 -0
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('HierarchyItems.CopyMove');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove', null, {}, /** @lends ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove */{
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
14
|
+
* @param {string} [sFolderAbsolutePath='http://localhost:87654/Products/']
|
|
15
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
16
|
+
* @param {function} [fCallback=function() {}]
|
|
17
|
+
*/
|
|
18
|
+
Copy: function(webDavSession, sFolderAbsolutePath, sFileAbsolutePath, fCallback) {
|
|
19
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
20
|
+
|
|
21
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
22
|
+
var oFile = oFileAsyncResult.Result;
|
|
23
|
+
|
|
24
|
+
webDavSession.OpenFolderAsync(sFolderAbsolutePath, null, function(oFolderAsyncResult) {
|
|
25
|
+
|
|
26
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
27
|
+
var oFolder = oFolderAsyncResult.Result;
|
|
28
|
+
|
|
29
|
+
oFile.CopyToAsync(oFolder, 'myproduct.txt', true, null, null, function(oAsyncResult) {
|
|
30
|
+
|
|
31
|
+
if (oAsyncResult.IsSuccess) {
|
|
32
|
+
console.log('Copy successfully completed.');
|
|
33
|
+
} else if (oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.PreconditionFailedException) {
|
|
34
|
+
console.log('The item with such name exists and `overwrite` was `false`.');
|
|
35
|
+
} else if (oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.WebDavHttpException) {
|
|
36
|
+
var sErrorText = oAsyncResult.Error.Message + ' ' + oAsyncResult.Error.Status.Code + ' ' +
|
|
37
|
+
oAsyncResult.Error.Status.Description;
|
|
38
|
+
|
|
39
|
+
// Find which items failed to copy.
|
|
40
|
+
for(var i = 0, l = oAsyncResult.Error.Multistatus.Responses.length; i < l; i++) {
|
|
41
|
+
var oResponse = oAsyncResult.Error.Multistatus.Responses[i];
|
|
42
|
+
sErrorText += '\n' + oResponse.Href + ' ' + oResponse.Status.Code + ' ' +
|
|
43
|
+
oResponse.Status.Description;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
console.log('Copy error: ' + sErrorText);
|
|
47
|
+
} else {
|
|
48
|
+
console.log('Copy error: ' + String(oAsyncResult.Error));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
fCallback(oAsyncResult);
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
59
|
+
* @param {string} [sDestinationFolderAbsolutePath='http://localhost:87654/Sales/']
|
|
60
|
+
* @param {string} [sSourceFolderAbsolutePath='http://localhost:87654/Products/']
|
|
61
|
+
* @param {function} [fCallback=function() {}]
|
|
62
|
+
*/
|
|
63
|
+
Move: function(webDavSession, sDestinationFolderAbsolutePath, sSourceFolderAbsolutePath, fCallback) {
|
|
64
|
+
webDavSession.OpenFolderAsync(sSourceFolderAbsolutePath, null, function(oSourceFolderAsyncResult) {
|
|
65
|
+
|
|
66
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oSourceFolder */
|
|
67
|
+
var oSourceFolder = oSourceFolderAsyncResult.Result;
|
|
68
|
+
|
|
69
|
+
webDavSession.OpenFolderAsync(sDestinationFolderAbsolutePath, null, function(oDestinationFolderAsyncResult) {
|
|
70
|
+
|
|
71
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oDestinationFolder */
|
|
72
|
+
var oDestinationFolder = oDestinationFolderAsyncResult.Result;
|
|
73
|
+
|
|
74
|
+
oSourceFolder.MoveToAsync(oDestinationFolder, oSourceFolder.DisplayName, false, null, function(oAsyncResult) {
|
|
75
|
+
|
|
76
|
+
if (oAsyncResult.IsSuccess) {
|
|
77
|
+
console.log('Move successfully completed.');
|
|
78
|
+
} else if (oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.PreconditionFailedException) {
|
|
79
|
+
console.log('The item with such name exists and `overwrite` was `false`.');
|
|
80
|
+
} else if (oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.WebDavHttpException) {
|
|
81
|
+
var sErrorText = oAsyncResult.Error.Message + ' ' + oAsyncResult.Error.Status.Code + ' ' +
|
|
82
|
+
oAsyncResult.Error.Status.Description;
|
|
83
|
+
|
|
84
|
+
// Find which items failed to move.
|
|
85
|
+
for(var i = 0, l = oAsyncResult.Error.Multistatus.Responses.length; i < l; i++) {
|
|
86
|
+
var oResponse = oAsyncResult.Error.Multistatus.Responses[i];
|
|
87
|
+
sErrorText += '\n' + oResponse.Href + ' ' + oResponse.Status.Code + ' ' +
|
|
88
|
+
oResponse.Status.Description;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log('Move error: ' + sErrorText);
|
|
92
|
+
} else {
|
|
93
|
+
console.log('Move error: ' + String(oAsyncResult.Error));
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
fCallback(oAsyncResult);
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
QUnitRunner.test('Copy file and check error on duplicate', function (test) {
|
|
105
|
+
QUnit.stop();
|
|
106
|
+
Helper.Create([
|
|
107
|
+
'HierarchyItems/Copy/Products/',
|
|
108
|
+
'HierarchyItems/Copy/Duplicate/myfile.txt',
|
|
109
|
+
'HierarchyItems/Copy/myfile.txt'
|
|
110
|
+
], function() {
|
|
111
|
+
QUnit.start();
|
|
112
|
+
|
|
113
|
+
QUnit.stop();
|
|
114
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove.Copy(webDavSession, Helper.GetAbsolutePath('HierarchyItems/Copy/Products/'), Helper.GetAbsolutePath('HierarchyItems/Copy/myfile.txt'), function(oAsyncResult) {
|
|
115
|
+
QUnit.start();
|
|
116
|
+
|
|
117
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of copy request');
|
|
118
|
+
|
|
119
|
+
QUnit.stop();
|
|
120
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove.Copy(webDavSession, Helper.GetAbsolutePath('HierarchyItems/Copy/Products/'), Helper.GetAbsolutePath('HierarchyItems/Copy/Duplicate/myfile.txt'), function(oAsyncResult) {
|
|
121
|
+
QUnit.start();
|
|
122
|
+
|
|
123
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failed copy request on duplicate');
|
|
124
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.PreconditionFailedException, true, 'Check error is PreconditionFailedException on duplicate copy request');
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
QUnitRunner.test('Copy folder', function (test) {
|
|
131
|
+
QUnit.stop();
|
|
132
|
+
Helper.Create([
|
|
133
|
+
'HierarchyItems/CopyFolder/Destination/',
|
|
134
|
+
'HierarchyItems/CopyFolder/Source/file.txt',
|
|
135
|
+
'HierarchyItems/CopyFolder/Source/file2.txt'
|
|
136
|
+
], function() {
|
|
137
|
+
QUnit.start();
|
|
138
|
+
|
|
139
|
+
QUnit.stop();
|
|
140
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/CopyFolder/Destination/'), null, function(oAsyncResult) {
|
|
141
|
+
QUnit.start();
|
|
142
|
+
|
|
143
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oDestinationFolder */
|
|
144
|
+
var oDestinationFolder = oAsyncResult.Result;
|
|
145
|
+
|
|
146
|
+
QUnit.stop();
|
|
147
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/CopyFolder/Source/'), null, function(oAsyncResult) {
|
|
148
|
+
QUnit.start();
|
|
149
|
+
|
|
150
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oSourceFolder */
|
|
151
|
+
var oSourceFolder = oAsyncResult.Result;
|
|
152
|
+
|
|
153
|
+
QUnit.stop();
|
|
154
|
+
oSourceFolder.CopyToAsync(oDestinationFolder, oSourceFolder.DisplayName + '/', true, null, null, function(oAsyncResult) {
|
|
155
|
+
QUnit.start();
|
|
156
|
+
|
|
157
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of copy folder request');
|
|
158
|
+
|
|
159
|
+
QUnit.stop();
|
|
160
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/CopyFolder/Destination/Source/'), null, function(oAsyncResult) {
|
|
161
|
+
QUnit.start();
|
|
162
|
+
|
|
163
|
+
test.strictEqual(oAsyncResult.Result.DisplayName, 'Source', 'Check new copied folder is `Source`');
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
QUnitRunner.test('Check Forbidden exception on copy to self', function (test) {
|
|
172
|
+
QUnit.stop();
|
|
173
|
+
Helper.Create([
|
|
174
|
+
'HierarchyItems/CopyForbidden/'
|
|
175
|
+
], function() {
|
|
176
|
+
QUnit.start();
|
|
177
|
+
|
|
178
|
+
QUnit.stop();
|
|
179
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/CopyForbidden/'), null, function(oAsyncResult) {
|
|
180
|
+
QUnit.start();
|
|
181
|
+
|
|
182
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
183
|
+
var oFolder = oAsyncResult.Result;
|
|
184
|
+
|
|
185
|
+
QUnit.stop();
|
|
186
|
+
oFolder.CopyToAsync(oFolder, oFolder.DisplayName + '/', true, null, null, function(oAsyncResult) {
|
|
187
|
+
QUnit.start();
|
|
188
|
+
|
|
189
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failed copy request on copy to self');
|
|
190
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.ForbiddenException, true, 'Check error is ForbiddenException');
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
QUnitRunner.test('Check NotFound exception on copy removed file', function (test) {
|
|
197
|
+
QUnit.stop();
|
|
198
|
+
Helper.Create([
|
|
199
|
+
'HierarchyItems/CopyNotFound/res.txt'
|
|
200
|
+
], function() {
|
|
201
|
+
QUnit.start();
|
|
202
|
+
|
|
203
|
+
QUnit.stop();
|
|
204
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/'), null, function(oAsyncResult) {
|
|
205
|
+
QUnit.start();
|
|
206
|
+
|
|
207
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
208
|
+
var oFolder = oAsyncResult.Result;
|
|
209
|
+
|
|
210
|
+
QUnit.stop();
|
|
211
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath('HierarchyItems/CopyNotFound/res.txt'), null, function(oAsyncResult) {
|
|
212
|
+
QUnit.start();
|
|
213
|
+
|
|
214
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
215
|
+
var oFile = oAsyncResult.Result;
|
|
216
|
+
|
|
217
|
+
QUnit.stop();
|
|
218
|
+
oFile.DeleteAsync(null, function(oAsyncResult) {
|
|
219
|
+
QUnit.start();
|
|
220
|
+
|
|
221
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of delete request');
|
|
222
|
+
|
|
223
|
+
QUnit.stop();
|
|
224
|
+
oFile.CopyToAsync(oFolder, oFile.DisplayName + '/', true, null, null, function(oAsyncResult) {
|
|
225
|
+
QUnit.start();
|
|
226
|
+
|
|
227
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failed request on copy removed file');
|
|
228
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.NotFoundException, true, 'Check error is NotFoundException');
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
QUnitRunner.test('Move folder and check already exists error', function (test) {
|
|
237
|
+
QUnit.stop();
|
|
238
|
+
Helper.Create([
|
|
239
|
+
'HierarchyItems/Move/Products/',
|
|
240
|
+
'HierarchyItems/Move/Duplicate/Sales/',
|
|
241
|
+
'HierarchyItems/Move/Sales/'
|
|
242
|
+
], function() {
|
|
243
|
+
QUnit.start();
|
|
244
|
+
|
|
245
|
+
QUnit.stop();
|
|
246
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove.Move(webDavSession, Helper.GetAbsolutePath('HierarchyItems/Move/Products/'), Helper.GetAbsolutePath('HierarchyItems/Move/Sales/'), function(oAsyncResult) {
|
|
247
|
+
QUnit.start();
|
|
248
|
+
|
|
249
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of move request');
|
|
250
|
+
|
|
251
|
+
QUnit.stop();
|
|
252
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CopyMove.Move(webDavSession, Helper.GetAbsolutePath('HierarchyItems/Move/Products/'), Helper.GetAbsolutePath('HierarchyItems/Move/Duplicate/Sales/'), function(oAsyncResult) {
|
|
253
|
+
QUnit.start();
|
|
254
|
+
|
|
255
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failed move request on already exists folder');
|
|
256
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.PreconditionFailedException, true, 'Check error is PreconditionFailedException');
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
|
|
262
|
+
QUnitRunner.test('Move folder', function (test) {
|
|
263
|
+
QUnit.stop();
|
|
264
|
+
Helper.Create([
|
|
265
|
+
'HierarchyItems/MoveFolder/Destination/',
|
|
266
|
+
'HierarchyItems/MoveFolder/Source/file.txt',
|
|
267
|
+
'HierarchyItems/MoveFolder/Source/file2.txt'
|
|
268
|
+
], function() {
|
|
269
|
+
QUnit.start();
|
|
270
|
+
|
|
271
|
+
QUnit.stop();
|
|
272
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/MoveFolder/Destination/'), null, function(oAsyncResult) {
|
|
273
|
+
QUnit.start();
|
|
274
|
+
|
|
275
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oDestinationFolder */
|
|
276
|
+
var oDestinationFolder = oAsyncResult.Result;
|
|
277
|
+
|
|
278
|
+
QUnit.stop();
|
|
279
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/MoveFolder/Source/'), null, function(oAsyncResult) {
|
|
280
|
+
QUnit.start();
|
|
281
|
+
|
|
282
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oSourceFolder */
|
|
283
|
+
var oSourceFolder = oAsyncResult.Result;
|
|
284
|
+
|
|
285
|
+
QUnit.stop();
|
|
286
|
+
oSourceFolder.MoveToAsync(oDestinationFolder, oSourceFolder.DisplayName + '/', true, null, function(oAsyncResult) {
|
|
287
|
+
QUnit.start();
|
|
288
|
+
|
|
289
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of move request');
|
|
290
|
+
|
|
291
|
+
QUnit.stop();
|
|
292
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/MoveFolder/Destination/Source/'), null, function(oAsyncResult) {
|
|
293
|
+
QUnit.start();
|
|
294
|
+
|
|
295
|
+
test.strictEqual(oAsyncResult.Result.DisplayName, 'Source', 'Check moved folder name is `Source`');
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
QUnitRunner.test('Check NotFound exception on move removed file', function (test) {
|
|
304
|
+
QUnit.stop();
|
|
305
|
+
Helper.Create([
|
|
306
|
+
'HierarchyItems/MoveNotFound/res.txt'
|
|
307
|
+
], function() {
|
|
308
|
+
QUnit.start();
|
|
309
|
+
|
|
310
|
+
QUnit.stop();
|
|
311
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/'), null, function(oAsyncResult) {
|
|
312
|
+
QUnit.start();
|
|
313
|
+
|
|
314
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
315
|
+
var oFolder = oAsyncResult.Result;
|
|
316
|
+
|
|
317
|
+
QUnit.stop();
|
|
318
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath('HierarchyItems/MoveNotFound/res.txt'), null, function(oAsyncResult) {
|
|
319
|
+
QUnit.start();
|
|
320
|
+
|
|
321
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
322
|
+
var oFile = oAsyncResult.Result;
|
|
323
|
+
|
|
324
|
+
QUnit.stop();
|
|
325
|
+
oFile.DeleteAsync(null, function(oAsyncResult) {
|
|
326
|
+
QUnit.start();
|
|
327
|
+
|
|
328
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of delete request');
|
|
329
|
+
|
|
330
|
+
QUnit.stop();
|
|
331
|
+
oFile.MoveToAsync(oFolder, oFile.DisplayName + '/', true, null, function(oAsyncResult) {
|
|
332
|
+
QUnit.start();
|
|
333
|
+
|
|
334
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failed on move not found file');
|
|
335
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.NotFoundException, true, 'Check error is NotFoundException');
|
|
336
|
+
});
|
|
337
|
+
});
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
});
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('HierarchyItems.CreateFile');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile', null, {}, /** @lends ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile */{
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
14
|
+
* @param {string} [sFolderAbsolutePath='http://localhost:87654/']
|
|
15
|
+
* @param {function} [fCallback=function() {}]
|
|
16
|
+
*/
|
|
17
|
+
CreateAndWriteContent: function(webDavSession, sFolderAbsolutePath, fCallback) {
|
|
18
|
+
webDavSession.OpenFolderAsync(sFolderAbsolutePath, null, function(oFolderAsyncResult) {
|
|
19
|
+
|
|
20
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
21
|
+
var oFolder = oFolderAsyncResult.Result;
|
|
22
|
+
|
|
23
|
+
oFolder.CreateFileAsync('myfile.txt', null, 'Hello World!', null, function(oAsyncResult) {
|
|
24
|
+
|
|
25
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
26
|
+
var oFile = oAsyncResult.Result;
|
|
27
|
+
|
|
28
|
+
if (oAsyncResult.Error) {
|
|
29
|
+
console.log(oAsyncResult.toString());
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (oAsyncResult.IsSuccess) {
|
|
33
|
+
console.log(oFile.DisplayName); // myfile.txt
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
fCallback(oAsyncResult);
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
43
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
44
|
+
* @param {function} [fCallback=function() {}]
|
|
45
|
+
*/
|
|
46
|
+
OnlyWriteContent: function(webDavSession, sFileAbsolutePath, fCallback) {
|
|
47
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
48
|
+
|
|
49
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
50
|
+
var oFile = oFileAsyncResult.Result;
|
|
51
|
+
|
|
52
|
+
oFile.WriteContentAsync('Goodbye!', null, 'text/plain', function(oAsyncResult) {
|
|
53
|
+
|
|
54
|
+
if (oAsyncResult.IsSuccess) {
|
|
55
|
+
console.log('Content is saved!');
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
fCallback(oAsyncResult);
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
65
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
66
|
+
* @param {function} [fCallback=function() {}]
|
|
67
|
+
*/
|
|
68
|
+
ReadContent: function(webDavSession, sFileAbsolutePath, fCallback) {
|
|
69
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
70
|
+
|
|
71
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
72
|
+
var oFile = oFileAsyncResult.Result;
|
|
73
|
+
|
|
74
|
+
oFile.ReadContentAsync(null, null, function(oAsyncResult) {
|
|
75
|
+
|
|
76
|
+
console.log(oAsyncResult.Result); // Goodbye!
|
|
77
|
+
|
|
78
|
+
fCallback(oAsyncResult);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Create folder example
|
|
85
|
+
*/
|
|
86
|
+
ReadContentRange: function(oFile, fCallback) {
|
|
87
|
+
oFile.ReadContentAsync(4, 3, function(oAsyncResult) {
|
|
88
|
+
|
|
89
|
+
console.log(oAsyncResult.Result); // bye
|
|
90
|
+
|
|
91
|
+
fCallback(oAsyncResult);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
QUnitRunner.test('Create, write and read file content', function (test) {
|
|
98
|
+
QUnit.stop();
|
|
99
|
+
Helper.Create([
|
|
100
|
+
'HierarchyItems/CreateFile/'
|
|
101
|
+
], function() {
|
|
102
|
+
QUnit.start();
|
|
103
|
+
|
|
104
|
+
var sFolderPath = Helper.GetAbsolutePath('HierarchyItems/CreateFile/');
|
|
105
|
+
var sFilePath = Helper.GetAbsolutePath('HierarchyItems/CreateFile/myfile.txt');
|
|
106
|
+
|
|
107
|
+
QUnit.stop();
|
|
108
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile.CreateAndWriteContent(webDavSession, sFolderPath, function(oAsyncResult) {
|
|
109
|
+
QUnit.start();
|
|
110
|
+
|
|
111
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of create and write file request');
|
|
112
|
+
test.strictEqual(oAsyncResult.Result.DisplayName, 'myfile.txt', 'Check created file name');
|
|
113
|
+
|
|
114
|
+
QUnit.stop();
|
|
115
|
+
webDavSession.OpenFileAsync(sFilePath, null, function(oAsyncResult) {
|
|
116
|
+
QUnit.start();
|
|
117
|
+
|
|
118
|
+
var oFile = oAsyncResult.Result;
|
|
119
|
+
|
|
120
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of get file request');
|
|
121
|
+
test.strictEqual(oAsyncResult.Result.DisplayName, 'myfile.txt', 'Check loaded file name');
|
|
122
|
+
|
|
123
|
+
QUnit.stop();
|
|
124
|
+
oAsyncResult.Result.ReadContentAsync(null, null, function(oAsyncResult) {
|
|
125
|
+
QUnit.start();
|
|
126
|
+
|
|
127
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of read content request');
|
|
128
|
+
test.strictEqual(oAsyncResult.Result, 'Hello World!', 'Check content string');
|
|
129
|
+
|
|
130
|
+
QUnit.stop();
|
|
131
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile.OnlyWriteContent(webDavSession, sFilePath, function(oAsyncResult) {
|
|
132
|
+
QUnit.start();
|
|
133
|
+
|
|
134
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of write content request');
|
|
135
|
+
|
|
136
|
+
QUnit.stop();
|
|
137
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile.ReadContent(webDavSession, sFilePath, function(oAsyncResult) {
|
|
138
|
+
QUnit.start();
|
|
139
|
+
|
|
140
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of read content request (after change content)');
|
|
141
|
+
test.strictEqual(oAsyncResult.Result, 'Goodbye!', 'Check updated content');
|
|
142
|
+
|
|
143
|
+
QUnit.stop();
|
|
144
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFile.ReadContentRange(oFile, function(oAsyncResult) {
|
|
145
|
+
QUnit.start();
|
|
146
|
+
|
|
147
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of read range content request');
|
|
148
|
+
test.strictEqual(oAsyncResult.Result, 'bye', 'Check range get content');
|
|
149
|
+
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
});
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('HierarchyItems.CreateFolder');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder', null, {}, /** @lends ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder */{
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
14
|
+
* @param {string} [sFolderAbsolutePath='http://localhost:87654/']
|
|
15
|
+
* @param {function} [fCallback=function() {}]
|
|
16
|
+
*/
|
|
17
|
+
CreateFolder: function (webDavSession, sFolderAbsolutePath, sFolderName, fCallback) {
|
|
18
|
+
webDavSession.OpenFolderAsync(sFolderAbsolutePath, null, function (oAsyncResult) {
|
|
19
|
+
|
|
20
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
21
|
+
var oFolder = oAsyncResult.Result;
|
|
22
|
+
|
|
23
|
+
oFolder.CreateFolderAsync(sFolderName, null, null, function (oAsyncResult) {
|
|
24
|
+
|
|
25
|
+
if (oAsyncResult.IsSuccess) {
|
|
26
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oNewFolder */
|
|
27
|
+
var oNewFolder = oAsyncResult.Result;
|
|
28
|
+
|
|
29
|
+
console.log(oNewFolder.Href);
|
|
30
|
+
} else if (oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.MethodNotAllowedException) {
|
|
31
|
+
console.log('Folder already exists.');
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
fCallback(oAsyncResult);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
QUnitRunner.test('Create folder and open it', function (test) {
|
|
42
|
+
QUnit.stop();
|
|
43
|
+
Helper.Create([
|
|
44
|
+
'HierarchyItems/'
|
|
45
|
+
], function () {
|
|
46
|
+
QUnit.start();
|
|
47
|
+
|
|
48
|
+
QUnit.stop();
|
|
49
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder.CreateFolder(webDavSession, Helper.GetAbsolutePath('HierarchyItems/'), 'my_folder', function (oAsyncResult) {
|
|
50
|
+
QUnit.start();
|
|
51
|
+
|
|
52
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of create folder request');
|
|
53
|
+
test.strictEqual(oAsyncResult.Result.Href, Helper.GetAbsolutePath('HierarchyItems/my_folder/'), 'Check created folder name');
|
|
54
|
+
|
|
55
|
+
QUnit.stop();
|
|
56
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/my_folder/'), null, function (oAsyncResult) {
|
|
57
|
+
QUnit.start();
|
|
58
|
+
|
|
59
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of get folder request');
|
|
60
|
+
test.strictEqual(oAsyncResult.Result.Href, Helper.GetAbsolutePath('HierarchyItems/my_folder/'), 'Check name of loaded folder');
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
QUnitRunner.test('Check Conflict exception on create in removed folder', function (test) {
|
|
67
|
+
QUnit.stop();
|
|
68
|
+
Helper.Create([
|
|
69
|
+
'HierarchyItems/toDelete/'
|
|
70
|
+
], function () {
|
|
71
|
+
QUnit.start();
|
|
72
|
+
|
|
73
|
+
QUnit.stop();
|
|
74
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/toDelete/'), null, function (oAsyncResult) {
|
|
75
|
+
QUnit.start();
|
|
76
|
+
|
|
77
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
78
|
+
var oFolder = oAsyncResult.Result;
|
|
79
|
+
|
|
80
|
+
QUnit.stop();
|
|
81
|
+
oFolder.DeleteAsync(null, function (oAsyncResult) {
|
|
82
|
+
QUnit.start();
|
|
83
|
+
|
|
84
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of delete request');
|
|
85
|
+
|
|
86
|
+
QUnit.stop();
|
|
87
|
+
oFolder.CreateFolderAsync('test', null, null, function (oAsyncResult) {
|
|
88
|
+
QUnit.start();
|
|
89
|
+
|
|
90
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failure on create in not founded folder');
|
|
91
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.ConflictException, true, 'Check error is ConflictException');
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
QUnitRunner.test('Check Duplicate exception on create already exists folder', function (test) {
|
|
99
|
+
QUnit.stop();
|
|
100
|
+
Helper.Create([
|
|
101
|
+
'HierarchyItems/duplicate/'
|
|
102
|
+
], function () {
|
|
103
|
+
QUnit.start();
|
|
104
|
+
|
|
105
|
+
QUnit.stop();
|
|
106
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('HierarchyItems/'), null, function (oAsyncResult) {
|
|
107
|
+
QUnit.start();
|
|
108
|
+
|
|
109
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
110
|
+
var oFolder = oAsyncResult.Result;
|
|
111
|
+
|
|
112
|
+
QUnit.stop();
|
|
113
|
+
oFolder.CreateFolderAsync('duplicate', null, null, function (oAsyncResult) {
|
|
114
|
+
QUnit.start();
|
|
115
|
+
|
|
116
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check failure on request create already exists folder');
|
|
117
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.MethodNotAllowedException, true, 'Check error is MethodNotAllowedException');
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
QUnitRunner.test('Check long paths support', function (test) {
|
|
124
|
+
QUnit.stop();
|
|
125
|
+
Helper.Create([
|
|
126
|
+
'HierarchyItems/'
|
|
127
|
+
], function () {
|
|
128
|
+
var numFolder = 9;
|
|
129
|
+
var folderPath = 'HierarchyItems';
|
|
130
|
+
var folderName = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
|
|
131
|
+
function createFolder(sFolderPath, sFolderName, index) {
|
|
132
|
+
ITHit.WebDAV.Client.Tests.HierarchyItems.CreateFolder.CreateFolder(webDavSession, Helper.GetAbsolutePath(sFolderPath), sFolderName, function (oAsyncResult) {
|
|
133
|
+
|
|
134
|
+
var nFolderPath = sFolderPath + '/' + sFolderName;
|
|
135
|
+
var message = 'Path ' + nFolderPath + ': check success of create folder request';
|
|
136
|
+
if (oAsyncResult.IsSuccess) {
|
|
137
|
+
test.ok(true, message);
|
|
138
|
+
test.strictEqual(oAsyncResult.Result.Href, Helper.GetAbsolutePath(nFolderPath + '/'), 'Path ' + nFolderPath + ': check created folder name');
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
ITHitTests.skip(test, 'Server does not support long paths.');
|
|
142
|
+
QUnit.start();
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if (index++ < numFolder) {
|
|
147
|
+
createFolder(nFolderPath, folderName, index);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
QUnit.start();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
createFolder(folderPath, folderName, 0)
|
|
155
|
+
});
|
|
156
|
+
});
|