com.aspose.tasks

Interfaces

Classes

Exceptions

Class License


  • public class License
    extends Object

    Provides methods to license the component.


      In this example, an attempt will be made to find a license file named MyLicense.lic
      in the folder that contains
      
      the component, in the folder that contains the calling assembly,
      in the folder of the entry assembly and then in the embedded resources of the calling assembly.
      
    
      [C#]
    
      License license = new License();
      license.SetLicense("MyLicense.lic");
      [Visual Basic]
      Dim license As license = New license
      License.SetLicense("MyLicense.lic")
      
    the component jar file:
    
      License license = new License();
      license.setLicense("MyLicense.lic");
      
    • Constructor Detail

      • License

        public License()

        Initializes a new instance of the License class.


         In this example, an attempt will be made to find a license file named MyLicense.lic
         in the folder that contains
         
         the component, in the folder that contains the calling assembly,
         in the folder of the entry assembly and then in the embedded resources of the calling assembly.
         
        
         [C#]
         License license = new License();
         license.SetLicense("MyLicense.lic");
         [Visual Basic]
         Dim license As license = New license
         License.SetLicense("MyLicense.lic")
         
        the component jar file:
        
         License license = new License();
         license.setLicense("MyLicense.lic");
         
    • Method Detail

      • setLicense

        public final void setLicense​(String licenseName)
                              throws Exception

        Licenses the component.

        Library tries to find the license in the following locations:

        1. Explicit path.

        2. The folder that contains the Aspose component JAR file.

        3. The folder that contains the client's calling JAR file.


        In this example, an attempt will be made to find a license file named MyLicense.lic in locations listed above:
         
         License license = new License();
         license.setLicense("MyLicense.lic");
         
         

        Parameters:
        licenseName - Can be a full or short file name or name of an embedded resource. Use an empty string to switch to evaluation mode.
        Throws:
        Exception - Exception is thrown when License has Invalid edition type.
      • setLicense

        public void setLicense​(InputStream stream)
                        throws Exception

        Licenses the component.


         
        
         <ms>
         [C#]
         License license = new License();
         license.SetLicense(myStream);
         [Visual Basic]
         Dim license as License = new License
         license.SetLicense(myStream)
         </ms>
         <java>
         License license = new License();
         license.setLicense(myStream);
         </java>
         
        Parameters:
        stream - A stream that contains the license.
        Throws:
        Exception - Exception is thrown when License has Invalid edition type.
      • setLicense

        public void setLicense​(File licenseFile)
                        throws Exception
        Licenses the component.
        Parameters:
        licenseFile - representation of file pathname
        Throws:
        Exception - Exception is thrown when License is disabled.