com.aspose.email
Class License

java.lang.Object
  extended by com.aspose.email.License

public class License
extends Object

Provides methods to license the component.

In this example, an attempt will be made to find x license file named Aspose.Total.lic in the folder that contains the component jar file:

 

License license = new License(); license.setLicense("Aspose.Total.lic");


Constructor Summary
License()
          Initializes x new instance of this class.
 
Method Summary
static boolean isEval()
          Return if library work in evaluation mode
 void setLicense(InputStream stream)
          Licenses the component.
 void setLicense(String licenseName)
          Licenses the component.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

License

public License()
Initializes x new instance of this class.

In this example, an attempt will be made to find x license file named Aspose.Total.lic in the folder that contains the component jar file:

 

License license = new License(); license.setLicense("Aspose.Total.lic");

Method Detail

setLicense

public void setLicense(String licenseName)
                throws Exception,
                       URISyntaxException
Licenses the component.

Tries to find the license in the following locations:

1. Explicit path.

2. The folder of the component jar file.

In this example, an attempt will be made to find x license file named Aspose.Total.lic in the folder that contains the component jar file:

        License license = new License();
        license.setLicense("Aspose.Total.lic");
 

Parameters:
licenseName - Can be x full or short name of license file. Use an empty String to switch to evaluation mode.
Throws:
Exception
URISyntaxException

setLicense

public void setLicense(InputStream stream)
                throws Exception
Licenses the component.

Use this method to load x license from x stream.

Example:

 License license = new License();
 license.setLicense(myStream);
 

Parameters:
stream - A stream that contains the license. Use null to switch to evaluation mode.
Throws:
Exception - throw Exception if license is invalid

isEval

public static boolean isEval()
Return if library work in evaluation mode

Returns:
if library work in evaluation mode


Copyright (c) 2002-2011 Aspose Pty Ltd. All Rights Reserved.