←Select platform

IsUploadDocumentUri Method

Summary

Indicates whether the URL points to a special LEAD cache scheme.

Syntax
C#
VB
C++
Java
public static bool IsUploadDocumentUri( 
   Uri uri 
) 
Public Shared Function IsUploadDocumentUri( 
   ByVal uri As System.Uri 
) As Boolean 
public:  
   static bool IsUploadDocumentUri( 
      System::Uri^ uri 
   ) 
public static boolean isUploadDocumentUri(URI uri) 

Parameters

uri

URI to check.

Return Value

true if the URL points to a special LEAD cache scheme; otherwise, false.

Remarks

This is a helper method that can be used to detect whether a URL was created by BeginUpload. The Document Library creates a URI in the following format for uploaded documents:

leadcache://documentID

For instance, for the document with ID 2E478C12F7B64B67883B76B4D2FBE612 the cache URI for it will be:

leadcache://2E478C12F7B64B67883B76B4D2FBE612

Use the IsLeadCacheScheme helper method to determine if a string value contains a valid LEAD cache URI. For example:

C#
// A valid LEAD cache scheme with an ID 
Assert.IsTrue(DocumentFactory.IsLeadCacheScheme("leadcache://2E478C12F7B64B67883B76B4D2FBE612")); 
// An invalid LEAD cache scheme, not leadcache 
Assert.IsFalse(DocumentFactory.IsLeadCacheScheme("http://2E478C12F7B64B67883B76B4D2FBE612")); 
// Another invalid LEAD cache scheme, does not have a scheme 
Assert.IsFalse(DocumentFactory.IsLeadCacheScheme("2E478C12F7B64B67883B76B4D2FBE612")); 

Use the MakeLeadCacheUri helper method to construct a LEAD cache URI from a document ID. For example:

C#
Uri documentCacheUri = DocumentFactory.MakeLeadCacheUri("2E478C12F7B64B67883B76B4D2FBE612"); 
Assert.AreEqual("leadcache://2E478C12F7B64B67883B76B4D2FBE612", documentCacheUri.ToString()); 

Use the GetLeadCacheData helper method to retrieve the document ID from a LEAD cache URI. For example:

C#
Uri documentCacheUri = DocumentFactory.MakeLeadCacheUri("2E478C12F7B64B67883B76B4D2FBE612"); 
Assert.AreEqual("2E478C12F7B64B67883B76B4D2FBE612", DocumentFactory.GetLeadCacheData(documentCacheUri)); 

Requirements

Target Platforms

Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly