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,277 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('Locks.Etag');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.Locks.Etag
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.Locks.Etag', null, {}, /** @lends ITHit.WebDAV.Client.Tests.Locks.Etag */{
|
|
11
|
+
|
|
12
|
+
GetEtag: function (test, sName, fCallback) {
|
|
13
|
+
var sFolderPath = Helper.GetAbsolutePath('Locks/Etag' + sName);
|
|
14
|
+
var sFilePath = Helper.GetAbsolutePath('Locks/Etag' + sName + '/etag.txt');
|
|
15
|
+
var oEtagPropertyName = new ITHit.WebDAV.Client.PropertyName('getetag', ITHit.WebDAV.Client.DavConstants.NamespaceUri);
|
|
16
|
+
|
|
17
|
+
var aEtags = [];
|
|
18
|
+
var methodsCount = 4;
|
|
19
|
+
var push = function (method, etag) {
|
|
20
|
+
if (etag === false) {
|
|
21
|
+
methodsCount--;
|
|
22
|
+
console.log('Method ' + method + ' not support for get etag.');
|
|
23
|
+
} else {
|
|
24
|
+
aEtags.push([method, etag]);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (aEtags.length === methodsCount) {
|
|
28
|
+
// Check etag equals
|
|
29
|
+
var sEtag = aEtags[0][1];
|
|
30
|
+
var bIsEquals = true;
|
|
31
|
+
for (var i = 0, l = aEtags.length; i < l; i++) {
|
|
32
|
+
if (sEtag !== aEtags[i][1]) {
|
|
33
|
+
bIsEquals = false;
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (!bIsEquals) {
|
|
39
|
+
for (var i2 = 0, l2 = aEtags.length; i2 < l2; i2++) {
|
|
40
|
+
console.log(aEtags[i2][0] + ':', aEtags[i2][1]);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
test.strictEqual(bIsEquals, true, 'Check get tags with different methods');
|
|
45
|
+
|
|
46
|
+
fCallback(sEtag);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// GET
|
|
51
|
+
webDavSession.OpenFileAsync(sFilePath, null, function (oAsyncResult) {
|
|
52
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
53
|
+
var oFile = oAsyncResult.Result;
|
|
54
|
+
|
|
55
|
+
var oRequest = oFile.ReadContentAsync(null, null, function () {
|
|
56
|
+
var etag = oRequest.GetInternalRequests()[0].Response.GetResponseHeader('etag');
|
|
57
|
+
push('GET', etag !== undefined ? etag : false);
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// HEAD
|
|
62
|
+
webDavSession.OpenFolderAsync(sFolderPath, null, function (oAsyncResult) {
|
|
63
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
64
|
+
var oFolder = oAsyncResult.Result;
|
|
65
|
+
|
|
66
|
+
var oRequest = oFolder.ItemExistsAsync('etag.txt', function () {
|
|
67
|
+
var etag = oRequest.GetInternalRequests()[0].Response.GetResponseHeader('etag');
|
|
68
|
+
push('HEAD', etag !== undefined ? etag : false);
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
// PROPFIND Depth 0
|
|
73
|
+
webDavSession.OpenFileAsync(sFilePath, [oEtagPropertyName], function (oAsyncResult) {
|
|
74
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
75
|
+
var oFile = oAsyncResult.Result;
|
|
76
|
+
|
|
77
|
+
push('PROPFIND Depth 0', oFile.GetProperty(oEtagPropertyName));
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// PROPFIND Depth 1
|
|
81
|
+
webDavSession.OpenFolderAsync(sFolderPath, null, function (oFolderAsyncResult) {
|
|
82
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
83
|
+
var oFolder = oFolderAsyncResult.Result;
|
|
84
|
+
|
|
85
|
+
oFolder.GetChildrenAsync(false, [oEtagPropertyName], function (oAsyncResult) {
|
|
86
|
+
/** @typedef {ITHit.WebDAV.Client.File[]} aFiles */
|
|
87
|
+
var aFiles = oAsyncResult.Result;
|
|
88
|
+
|
|
89
|
+
push('PROPFIND Depth 1', aFiles[0].GetProperty(oEtagPropertyName));
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
QUnitRunner.test('Lock file, check etag no change', function (test) {
|
|
97
|
+
var sName = 'lock';
|
|
98
|
+
var sFilePath = 'Locks/Etag' + sName + '/etag.txt';
|
|
99
|
+
Helper.Create(sFilePath, QUnitRunner.async(function (oFile) {
|
|
100
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
101
|
+
return ITHitTests.skip(test, 'Server does not support locks.');
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sEtag) {
|
|
105
|
+
oFile.LockAsync(ITHit.WebDAV.Client.LockScope.Shared, false, 'User 1', -1, QUnitRunner.async(function () {
|
|
106
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sNewEtag) {
|
|
107
|
+
|
|
108
|
+
test.strictEqual(sEtag, sNewEtag, 'Check that etag did not changed');
|
|
109
|
+
|
|
110
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath(sFilePath), null, QUnitRunner.async(function (oAsyncResult) {
|
|
111
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
112
|
+
var oLockedFile = oAsyncResult.Result;
|
|
113
|
+
|
|
114
|
+
test.strictEqual(String(oFile.LastModified), String(oLockedFile.LastModified), 'Check that LastModified did not changed');
|
|
115
|
+
}));
|
|
116
|
+
}));
|
|
117
|
+
}));
|
|
118
|
+
}));
|
|
119
|
+
}));
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
QUnitRunner.test('Update file, check etag change', function (test) {
|
|
123
|
+
var sName = 'update';
|
|
124
|
+
var sFilePath = 'Locks/Etag' + sName + '/etag.txt';
|
|
125
|
+
Helper.Create(sFilePath, QUnitRunner.async(function (oFile) {
|
|
126
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
127
|
+
return ITHitTests.skip(test, 'Server does not support locks.');
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sEtag) {
|
|
131
|
+
|
|
132
|
+
oFile.WriteContentAsync('Changes!', null, 'text/plain', QUnitRunner.async(function (oAsyncResult) {
|
|
133
|
+
|
|
134
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of write content to file');
|
|
135
|
+
|
|
136
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sNewEtag) {
|
|
137
|
+
|
|
138
|
+
test.notEqual(sEtag, sNewEtag, 'Check that etag did not changed');
|
|
139
|
+
|
|
140
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath(sFilePath), null, QUnitRunner.async(function (oAsyncResult) {
|
|
141
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
142
|
+
var oLockedFile = oAsyncResult.Result;
|
|
143
|
+
|
|
144
|
+
test.notEqual(String(oFile.LastModified), String(oLockedFile.LastModified), 'Check that etag did not changed');
|
|
145
|
+
}));
|
|
146
|
+
}));
|
|
147
|
+
}));
|
|
148
|
+
}));
|
|
149
|
+
}));
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
QUnitRunner.test('Lock file, unlock, check etag no change', function (test) {
|
|
153
|
+
var sName = 'lock';
|
|
154
|
+
var sFilePath = 'Locks/Etag' + sName + '/etag.txt';
|
|
155
|
+
Helper.Create(sFilePath, QUnitRunner.async(function (oFile) {
|
|
156
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
157
|
+
return ITHitTests.skip(test, 'Server does not support locks.');
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sEtag) {
|
|
161
|
+
oFile.LockAsync(ITHit.WebDAV.Client.LockScope.Shared, false, 'User 1', -1, QUnitRunner.async(function (oAsyncResult) {
|
|
162
|
+
|
|
163
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oLockInfo */
|
|
164
|
+
var oLockInfo = oAsyncResult.Result;
|
|
165
|
+
|
|
166
|
+
oFile.UnlockAsync(oLockInfo.LockToken.LockToken, QUnitRunner.async(function () {
|
|
167
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sNewEtag) {
|
|
168
|
+
|
|
169
|
+
test.strictEqual(sEtag, sNewEtag, 'Check that etag did not changed');
|
|
170
|
+
|
|
171
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath(sFilePath), null, QUnitRunner.async(function (oAsyncResult) {
|
|
172
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
173
|
+
var oLockedFile = oAsyncResult.Result;
|
|
174
|
+
|
|
175
|
+
test.strictEqual(String(oFile.LastModified), String(oLockedFile.LastModified), 'Check that LastModified did not changed');
|
|
176
|
+
}));
|
|
177
|
+
}));
|
|
178
|
+
}));
|
|
179
|
+
}));
|
|
180
|
+
}));
|
|
181
|
+
}));
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
QUnitRunner.test('Add file custom property, check etag no change', function (test) {
|
|
185
|
+
var sName = 'add_property';
|
|
186
|
+
var sFilePath = 'Locks/Etag' + sName + '/etag.txt';
|
|
187
|
+
var oPropertyName = new ITHit.WebDAV.Client.PropertyName('myname', 'mynamespace');
|
|
188
|
+
var oProperty = new ITHit.WebDAV.Client.Property(oPropertyName, 'first value');
|
|
189
|
+
|
|
190
|
+
Helper.Create(sFilePath, QUnitRunner.async(function (oFile) {
|
|
191
|
+
|
|
192
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sEtag) {
|
|
193
|
+
|
|
194
|
+
oFile.UpdatePropertiesAsync([oProperty], null, null, QUnitRunner.async(function (oAsyncResult) {
|
|
195
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of add property request');
|
|
196
|
+
|
|
197
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sNewEtag) {
|
|
198
|
+
test.strictEqual(sEtag, sNewEtag, 'Check that etag did not changed');
|
|
199
|
+
|
|
200
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath(sFilePath), null, QUnitRunner.async(function (oAsyncResult) {
|
|
201
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
202
|
+
var oLockedFile = oAsyncResult.Result;
|
|
203
|
+
|
|
204
|
+
test.strictEqual(String(oFile.LastModified), String(oLockedFile.LastModified), 'Check that LastModified did not changed');
|
|
205
|
+
}));
|
|
206
|
+
}));
|
|
207
|
+
}));
|
|
208
|
+
}));
|
|
209
|
+
}));
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
QUnitRunner.test('Update file custom property, check etag no change', function (test) {
|
|
213
|
+
var sName = 'update_property';
|
|
214
|
+
var sFilePath = 'Locks/Etag' + sName + '/etag.txt';
|
|
215
|
+
var oPropertyName = new ITHit.WebDAV.Client.PropertyName('myname', 'mynamespace');
|
|
216
|
+
var oProperty = new ITHit.WebDAV.Client.Property(oPropertyName, 'Value');
|
|
217
|
+
|
|
218
|
+
Helper.Create(sFilePath, QUnitRunner.async(function (oFile) {
|
|
219
|
+
|
|
220
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sEtag) {
|
|
221
|
+
|
|
222
|
+
oFile.UpdatePropertiesAsync([oProperty], null, null, QUnitRunner.async(function (oAsyncResult) {
|
|
223
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of add property request');
|
|
224
|
+
|
|
225
|
+
var oUpdatedProperty = new ITHit.WebDAV.Client.Property(oPropertyName, 'Updated value');
|
|
226
|
+
|
|
227
|
+
oFile.UpdatePropertiesAsync([oUpdatedProperty], null, null, QUnitRunner.async(function (oAsyncResult) {
|
|
228
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of add property request');
|
|
229
|
+
|
|
230
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sNewEtag) {
|
|
231
|
+
test.strictEqual(sEtag, sNewEtag, 'Check that etag did not changed');
|
|
232
|
+
|
|
233
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath(sFilePath), null, QUnitRunner.async(function (oAsyncResult) {
|
|
234
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
235
|
+
var oLockedFile = oAsyncResult.Result;
|
|
236
|
+
|
|
237
|
+
test.strictEqual(String(oFile.LastModified), String(oLockedFile.LastModified), 'Check that LastModified did not changed');
|
|
238
|
+
}));
|
|
239
|
+
}));
|
|
240
|
+
}));
|
|
241
|
+
}));
|
|
242
|
+
}));
|
|
243
|
+
}));
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
QUnitRunner.test('Delete file custom property, check etag no change', function (test) {
|
|
248
|
+
var sName = 'delete_property';
|
|
249
|
+
var sFilePath = 'Locks/Etag' + sName + '/etag.txt';
|
|
250
|
+
var oPropertyName = new ITHit.WebDAV.Client.PropertyName('myname', 'mynamespace');
|
|
251
|
+
var oProperty = new ITHit.WebDAV.Client.Property(oPropertyName, 'Value');
|
|
252
|
+
|
|
253
|
+
Helper.Create(sFilePath, QUnitRunner.async(function (oFile) {
|
|
254
|
+
|
|
255
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sEtag) {
|
|
256
|
+
|
|
257
|
+
oFile.UpdatePropertiesAsync([oProperty], null, null, QUnitRunner.async(function (oAsyncResult) {
|
|
258
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of add property request');
|
|
259
|
+
|
|
260
|
+
oFile.UpdatePropertiesAsync(null, [oPropertyName], null, QUnitRunner.async(function (oAsyncResult) {
|
|
261
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of add property request');
|
|
262
|
+
|
|
263
|
+
ITHit.WebDAV.Client.Tests.Locks.Etag.GetEtag(test, sName, QUnitRunner.async(function (sNewEtag) {
|
|
264
|
+
test.strictEqual(sEtag, sNewEtag, 'Check that etag did not changed');
|
|
265
|
+
|
|
266
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath(sFilePath), null, QUnitRunner.async(function (oAsyncResult) {
|
|
267
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
268
|
+
var oLockedFile = oAsyncResult.Result;
|
|
269
|
+
|
|
270
|
+
test.strictEqual(String(oFile.LastModified), String(oLockedFile.LastModified), 'Check that LastModified did not changed');
|
|
271
|
+
}));
|
|
272
|
+
}));
|
|
273
|
+
}));
|
|
274
|
+
}));
|
|
275
|
+
}));
|
|
276
|
+
}));
|
|
277
|
+
});
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('Locks.GetLocks');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.Locks.GetLocks
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.Locks.GetLocks', null, {}, /** @lends ITHit.WebDAV.Client.Tests.Locks.GetLocks */{
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
14
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
15
|
+
* @param {function} [fCallback=function() {}]
|
|
16
|
+
*/
|
|
17
|
+
GetList: function(webDavSession, sFileAbsolutePath, fCallback) {
|
|
18
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
19
|
+
|
|
20
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
21
|
+
var oFile = oFileAsyncResult.Result;
|
|
22
|
+
|
|
23
|
+
// Infinite lock
|
|
24
|
+
oFile.LockAsync(ITHit.WebDAV.Client.LockScope.Shared, false, "User 1", -1, function(oInfiniteLockAsyncResult) {
|
|
25
|
+
|
|
26
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oInfiniteLockInfo */
|
|
27
|
+
var oInfiniteLockInfo = oInfiniteLockAsyncResult.Result;
|
|
28
|
+
|
|
29
|
+
// Minute lock
|
|
30
|
+
oFile.LockAsync(ITHit.WebDAV.Client.LockScope.Shared, false, "User 2", 60, function(oMinuteLockAsyncResult) {
|
|
31
|
+
|
|
32
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oMinuteLockInfo */
|
|
33
|
+
var oMinuteLockInfo = oMinuteLockAsyncResult.Result;
|
|
34
|
+
|
|
35
|
+
// Refresh item from server to read locks
|
|
36
|
+
oFile.RefreshAsync(function(oAsyncResult) {
|
|
37
|
+
|
|
38
|
+
for (var i = 0, l = oFile.ActiveLocks.length; i < l; i++) {
|
|
39
|
+
|
|
40
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oLockInfo */
|
|
41
|
+
var oLockInfo = oFile.ActiveLocks[i];
|
|
42
|
+
var sTimeOut = oLockInfo.TimeOut === -1 ? "Infinite" : oLockInfo.TimeOut + ' sec';
|
|
43
|
+
|
|
44
|
+
// Show item locks
|
|
45
|
+
console.log([
|
|
46
|
+
oLockInfo.Owner,
|
|
47
|
+
oLockInfo.LockToken.Href,
|
|
48
|
+
oLockInfo.LockToken.LockToken,
|
|
49
|
+
oLockInfo.LockScope,
|
|
50
|
+
oLockInfo.Deep,
|
|
51
|
+
sTimeOut
|
|
52
|
+
].join(' '));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
fCallback(oFile, oInfiniteLockInfo, oMinuteLockInfo);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
QUnitRunner.test('Lock file, refresh and get it locks list', function (test) {
|
|
66
|
+
QUnit.stop();
|
|
67
|
+
Helper.Create([
|
|
68
|
+
'Locks/getlockfile.txt'
|
|
69
|
+
], function() {
|
|
70
|
+
QUnit.start();
|
|
71
|
+
|
|
72
|
+
QUnit.stop();
|
|
73
|
+
ITHit.WebDAV.Client.Tests.Locks.GetLocks.GetList(webDavSession, Helper.GetAbsolutePath('Locks/getlockfile.txt'), function(oFile, oInfiniteLockInfo, oMinuteLockInfo) {
|
|
74
|
+
QUnit.start();
|
|
75
|
+
|
|
76
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
77
|
+
ITHitTests.skip(test, 'Server does not support locks.');
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
var oLocalInfiniteLockInfo = null;
|
|
82
|
+
var oLocalMinuteLockInfo = null;
|
|
83
|
+
for (var i = 0, l = oFile.ActiveLocks.length; i < l; i++) {
|
|
84
|
+
if (oFile.ActiveLocks[i].LockToken.toString() === oInfiniteLockInfo.LockToken.toString()) {
|
|
85
|
+
oLocalInfiniteLockInfo = oFile.ActiveLocks[i];
|
|
86
|
+
}
|
|
87
|
+
if (oFile.ActiveLocks[i].LockToken.toString() === oMinuteLockInfo.LockToken.toString()) {
|
|
88
|
+
oLocalMinuteLockInfo = oFile.ActiveLocks[i];
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
test.strictEqual(oFile.ActiveLocks.length, 2, 'Check active locks length');
|
|
93
|
+
test.strictEqual(oLocalInfiniteLockInfo.Owner, 'User 1', 'Infinite lock: check owner');
|
|
94
|
+
test.strictEqual(oLocalInfiniteLockInfo.LockToken.Href, Helper.GetAbsolutePath('Locks/getlockfile.txt'), 'Infinite lock: check href');
|
|
95
|
+
test.strictEqual(oLocalInfiniteLockInfo.LockToken.LockToken, oInfiniteLockInfo.LockToken.toString(), 'Infinite lock: check token');
|
|
96
|
+
test.strictEqual(oLocalInfiniteLockInfo.LockToken.toString(), oInfiniteLockInfo.LockToken.toString(), 'Infinite lock: check token by toString()');
|
|
97
|
+
test.strictEqual(oLocalMinuteLockInfo.Owner, 'User 2', 'Minute lock: check owner');
|
|
98
|
+
test.strictEqual(oLocalMinuteLockInfo.LockToken.Href, Helper.GetAbsolutePath('Locks/getlockfile.txt'), 'Minute lock: check href');
|
|
99
|
+
test.strictEqual(oLocalMinuteLockInfo.LockToken.LockToken, oMinuteLockInfo.LockToken.toString(), 'Minute lock: check token');
|
|
100
|
+
test.strictEqual(oLocalMinuteLockInfo.LockToken.toString(), oMinuteLockInfo.LockToken.toString(), 'Minute lock: check token by toString()');
|
|
101
|
+
|
|
102
|
+
QUnit.stop();
|
|
103
|
+
oFile.UnlockAsync(oInfiniteLockInfo.LockToken, function(oAsyncResult) {
|
|
104
|
+
QUnit.start();
|
|
105
|
+
|
|
106
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of unlock first lock request');
|
|
107
|
+
|
|
108
|
+
QUnit.stop();
|
|
109
|
+
oFile.UnlockAsync(oMinuteLockInfo.LockToken, function(oAsyncResult) {
|
|
110
|
+
QUnit.start();
|
|
111
|
+
|
|
112
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of unlock second lock request');
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('Locks.Lock');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.Locks.Lock
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.Locks.Lock', null, {}, /** @lends ITHit.WebDAV.Client.Tests.Locks.Lock */{
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
14
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
15
|
+
* @param {function} [fCallback=function() {}]
|
|
16
|
+
*/
|
|
17
|
+
SetLock: function(webDavSession, sFileAbsolutePath, fCallback) {
|
|
18
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
19
|
+
|
|
20
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
21
|
+
var oFile = oFileAsyncResult.Result;
|
|
22
|
+
|
|
23
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
24
|
+
console.log('Locks are not supported.');
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
oFile.LockAsync(ITHit.WebDAV.Client.LockScope.Shared, false, 'User 1', -1, function(oAsyncResult) {
|
|
29
|
+
|
|
30
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oLockInfo */
|
|
31
|
+
var oLockInfo = oAsyncResult.Result;
|
|
32
|
+
|
|
33
|
+
if (oAsyncResult.IsSuccess) {
|
|
34
|
+
console.log('Locks token is: ' + oLockInfo.LockToken.LockToken);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
fCallback(oAsyncResult);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
44
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
45
|
+
* @param {string} [sLockToken='f36726d1-0671-4f6f-8445-c7d10e42a08e']
|
|
46
|
+
* @param {function} [fCallback=function() {}]
|
|
47
|
+
*/
|
|
48
|
+
SetUnLock: function(webDavSession, sFileAbsolutePath, sLockToken, fCallback) {
|
|
49
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
50
|
+
|
|
51
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
52
|
+
var oFile = oFileAsyncResult.Result;
|
|
53
|
+
|
|
54
|
+
oFile.UnlockAsync(sLockToken, function(oAsyncResult) {
|
|
55
|
+
|
|
56
|
+
if (oAsyncResult.IsSuccess) {
|
|
57
|
+
console.log('File is unlocked');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
fCallback(oAsyncResult);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
QUnitRunner.test('Lock file and check that it can not be moved', function (test) {
|
|
68
|
+
QUnit.stop();
|
|
69
|
+
Helper.Create([
|
|
70
|
+
'Locks/MoveDir/',
|
|
71
|
+
'Locks/lockfile.txt'
|
|
72
|
+
], function() {
|
|
73
|
+
QUnit.start();
|
|
74
|
+
|
|
75
|
+
QUnit.stop();
|
|
76
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath('Locks/lockfile.txt'), null, function(oAsyncResult) {
|
|
77
|
+
QUnit.start();
|
|
78
|
+
|
|
79
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
80
|
+
var oFile = oAsyncResult.Result;
|
|
81
|
+
|
|
82
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
83
|
+
ITHitTests.skip(test, 'Server does not support locks.');
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
QUnit.stop();
|
|
88
|
+
webDavSession.OpenFolderAsync(Helper.GetAbsolutePath('Locks/MoveDir/'), null, function(oAsyncResult) {
|
|
89
|
+
QUnit.start();
|
|
90
|
+
|
|
91
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oMoveFolder */
|
|
92
|
+
var oMoveFolder = oAsyncResult.Result;
|
|
93
|
+
|
|
94
|
+
QUnit.stop();
|
|
95
|
+
ITHit.WebDAV.Client.Tests.Locks.Lock.SetLock(webDavSession, Helper.GetAbsolutePath('Locks/lockfile.txt'), function(oAsyncResult) {
|
|
96
|
+
QUnit.start();
|
|
97
|
+
|
|
98
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oLockInfo */
|
|
99
|
+
var oLockInfo = oAsyncResult.Result;
|
|
100
|
+
|
|
101
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of set lock request');
|
|
102
|
+
test.strictEqual(oLockInfo instanceof ITHit.WebDAV.Client.LockInfo, true, 'Check result is instance of LockInfo');
|
|
103
|
+
test.strictEqual(oLockInfo.Deep, false, 'Check lock info deep is false');
|
|
104
|
+
test.strictEqual(oLockInfo.LockScope, ITHit.WebDAV.Client.LockScope.Shared, 'Check lock is shared');
|
|
105
|
+
test.strictEqual(oLockInfo.LockToken.Href, Helper.GetAbsolutePath('Locks/lockfile.txt'), 'Check lock href');
|
|
106
|
+
|
|
107
|
+
// Try move
|
|
108
|
+
QUnit.stop();
|
|
109
|
+
oFile.MoveToAsync(oMoveFolder, oFile.DisplayName, false, null, function(oAsyncResult) {
|
|
110
|
+
QUnit.start();
|
|
111
|
+
|
|
112
|
+
test.strictEqual(oAsyncResult.Error instanceof ITHit.WebDAV.Client.Exceptions.LockedException, true, 'Check error is LockedException on try move file without lock token');
|
|
113
|
+
|
|
114
|
+
// Try move with lock
|
|
115
|
+
QUnit.stop();
|
|
116
|
+
oFile.MoveToAsync(oMoveFolder, oFile.DisplayName, false, [oLockInfo], function(oAsyncResult) {
|
|
117
|
+
QUnit.start();
|
|
118
|
+
|
|
119
|
+
// Try move
|
|
120
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of move file request with lock token');
|
|
121
|
+
|
|
122
|
+
QUnit.stop();
|
|
123
|
+
ITHit.WebDAV.Client.Tests.Locks.Lock.SetUnLock(webDavSession, Helper.GetAbsolutePath('Locks/MoveDir/lockfile.txt'), oLockInfo.LockToken.LockToken, function(oAsyncResult) {
|
|
124
|
+
QUnit.start();
|
|
125
|
+
|
|
126
|
+
test.strictEqual(oAsyncResult.IsSuccess, false, 'Check success of unlock request');
|
|
127
|
+
});
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('Locks.RefreshLock');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @class ITHit.WebDAV.Client.Tests.Locks.RefreshLock
|
|
9
|
+
*/
|
|
10
|
+
ITHit.DefineClass('ITHit.WebDAV.Client.Tests.Locks.RefreshLock', null, {}, /** @lends ITHit.WebDAV.Client.Tests.Locks.RefreshLock */{
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param {ITHit.WebDAV.Client.WebDavSession} [webDavSession=new ITHit.WebDAV.Client.WebDavSession()]
|
|
14
|
+
* @param {string} [sFileAbsolutePath='http://localhost:87654/myfile.txt']
|
|
15
|
+
* @param {function} [fCallback=function() {}]
|
|
16
|
+
*/
|
|
17
|
+
RefreshLock: function(webDavSession, sFileAbsolutePath, fCallback) {
|
|
18
|
+
webDavSession.OpenFileAsync(sFileAbsolutePath, null, function(oFileAsyncResult) {
|
|
19
|
+
|
|
20
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
21
|
+
var oFile = oFileAsyncResult.Result;
|
|
22
|
+
|
|
23
|
+
oFile.LockAsync(ITHit.WebDAV.Client.LockScope.Shared, false, 'User 1', 60, function(oLockAsyncResult) {
|
|
24
|
+
|
|
25
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oLockInfo */
|
|
26
|
+
var oLockInfo = oLockAsyncResult.Result;
|
|
27
|
+
|
|
28
|
+
if (oLockAsyncResult.IsSuccess) {
|
|
29
|
+
console.log('Lock timeout is: ' + oLockInfo.TimeOut);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
oFile.RefreshLockAsync(oLockInfo.LockToken.toString(), 300, function(oRefreshAsyncResult) {
|
|
33
|
+
|
|
34
|
+
/** @typedef {ITHit.WebDAV.Client.LockInfo} oLockInfo */
|
|
35
|
+
var oRefreshedLockInfo = oRefreshAsyncResult.Result;
|
|
36
|
+
|
|
37
|
+
if (oRefreshAsyncResult.IsSuccess) {
|
|
38
|
+
console.log('Lock timeout is: ' + oRefreshedLockInfo.TimeOut);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
fCallback(oLockAsyncResult, oRefreshAsyncResult);
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
QUnitRunner.test('Refresh lock on a file', function (test) {
|
|
50
|
+
QUnit.stop();
|
|
51
|
+
Helper.Create([
|
|
52
|
+
'Locks/refreshlockfile.txt'
|
|
53
|
+
], function() {
|
|
54
|
+
QUnit.start();
|
|
55
|
+
|
|
56
|
+
QUnit.stop();
|
|
57
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath('Locks/refreshlockfile.txt'), null, function(oAsyncResult) {
|
|
58
|
+
QUnit.start();
|
|
59
|
+
|
|
60
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
61
|
+
var oFile = oAsyncResult.Result;
|
|
62
|
+
|
|
63
|
+
if (oFile.SupportedLocks.length === 0) {
|
|
64
|
+
ITHitTests.skip(test, 'Server does not support locks.');
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
QUnit.stop();
|
|
69
|
+
ITHit.WebDAV.Client.Tests.Locks.RefreshLock.RefreshLock(webDavSession, Helper.GetAbsolutePath('Locks/refreshlockfile.txt'), function(oLockAsyncResult, oRefreshAsyncResult) {
|
|
70
|
+
QUnit.start();
|
|
71
|
+
|
|
72
|
+
test.strictEqual(oLockAsyncResult.IsSuccess, true, 'Check success of lock request');
|
|
73
|
+
test.strictEqual(oLockAsyncResult.Result.TimeOut, 60, 'Check previous lock timeout');
|
|
74
|
+
test.strictEqual(oRefreshAsyncResult.IsSuccess, true, 'Check success of refresh lock request');
|
|
75
|
+
test.strictEqual(oRefreshAsyncResult.Result.TimeOut, 300, 'Check current lock timeout');
|
|
76
|
+
|
|
77
|
+
QUnit.stop();
|
|
78
|
+
webDavSession.OpenFileAsync(Helper.GetAbsolutePath('Locks/refreshlockfile.txt'), null, function(oAsyncResult) {
|
|
79
|
+
QUnit.start();
|
|
80
|
+
|
|
81
|
+
/** @typedef {ITHit.WebDAV.Client.File} oFile */
|
|
82
|
+
var oFile = oAsyncResult.Result;
|
|
83
|
+
|
|
84
|
+
QUnit.stop();
|
|
85
|
+
oFile.UnlockAsync(oRefreshAsyncResult.Result.LockToken.toString(), function(oAsyncResult) {
|
|
86
|
+
QUnit.start();
|
|
87
|
+
|
|
88
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of unlock request');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
});
|
|
94
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {ITHit.WebDAV.Client.WebDavSession} webDavSession
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
QUnit.module('Upload.CancelUpload');
|
|
6
|
+
|
|
7
|
+
QUnitRunner.test('Cancel upload on created file', function (test) {
|
|
8
|
+
QUnit.stop();
|
|
9
|
+
Helper.Create([
|
|
10
|
+
'Upload/cancel_file2.txt'
|
|
11
|
+
], function() {
|
|
12
|
+
QUnit.start();
|
|
13
|
+
|
|
14
|
+
QUnit.stop();
|
|
15
|
+
webDavSession.OpenItemAsync(Helper.GetAbsolutePath('Upload/cancel_file2.txt'), null, function(oAsyncResult) {
|
|
16
|
+
QUnit.start();
|
|
17
|
+
|
|
18
|
+
/** @typedef {ITHit.WebDAV.Client.Folder} oFolder */
|
|
19
|
+
var oFile = oAsyncResult.Result;
|
|
20
|
+
|
|
21
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of open item request');
|
|
22
|
+
test.strictEqual(oFile instanceof ITHit.WebDAV.Client.File, true, 'Check result is instance of File');
|
|
23
|
+
test.strictEqual(oFile.ResumableUpload instanceof ITHit.WebDAV.Client.ResumableUpload, true, 'Check file have link to ResumableUpload instance');
|
|
24
|
+
|
|
25
|
+
// Async variant
|
|
26
|
+
QUnit.stop();
|
|
27
|
+
oFile.ResumableUpload.CancelUploadAsync(null, function(oAsyncResult) {
|
|
28
|
+
QUnit.start();
|
|
29
|
+
|
|
30
|
+
test.strictEqual(oAsyncResult.IsSuccess, true, 'Check success of cancel upload request');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
});
|