/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at legal-notices/CDDLv1_0.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Copyright 2006-2010 Sun Microsystems, Inc.
* Portions Copyright 2013-2015 ForgeRock AS.
*/
/**
* Represents information about the license file. NOTE: the license file
* location must be kept in sync with build.xml and
* org.opends.server.tools.upgrade.LicenseFile.
*/
public class LicenseFile
{
/**
* The license file name in Legal directory.
*/
/**
* The Legal folder which contains license file.
*/
/**
* The accepted license file name.
*/
/**
* Get the directory in which legal files are stored.
*/
if (installDirName == null)
{
}
if (installDirName == null)
{
installDirName = ".";
}
return installDirName;
}
/**
* Get the directory in which approved legal files are stored.
*/
{
if (!instanceLegalDir.exists())
{
}
return instanceLegalDirName;
}
/**
* The File object related to the license file.
*/
/**
* The license file approval state.
*/
private static boolean approved;
/**
* Returns the license file name.
*/
{
return getInstallDirectory() + File.separator + LEGAL_FOLDER_NAME + File.separator + LICENSE_FILE_NAME;
}
/**
* Returns the license file object.
*/
{
{
}
return licFile;
}
/**
* Checks if the license file exists.
*
* @return <CODE>true</CODE> if the license file exists in the Legal directory
* in the top level installation directory <CODE>false</CODE>
* otherwise.
*/
public static boolean exists()
{
}
/**
* Get the textual contents of the license file.
*
* @return the textual contents of the license file.
*/
{
try
{
}
catch (FileNotFoundException e)
{
// Should not happen
return "";
}
// Reads the inputstream content.
try
{
{
}
}
catch (IOException ioe)
{
// Should not happen
return "";
}
}
/**
* Get the license approval status.
*
* @return <CODE>true</CODE> if the license has been accepted by the user
* <CODE>false</CODE> otherwise.
*/
public static boolean getApproval()
{
return approved;
}
/**
* Sets the license approval status.
*
* @param p_approved
* the license approval status
*/
{
}
/**
* Creates a file - in the legal folder from the specified directory; which
* indicates that the license has been approved.
*
* @param installationPath
* The server installation's path.
*/
{
{
try
{
if (!instanceLegalDir.exists())
{
}
}
catch (IOException e)
{
// do nothing
}
}
}
/**
* Indicate if the license had already been approved..
*
* @return <CODE>true</CODE> if the license had already been approved by the
* user <CODE>false</CODE> otherwise.
*/
public static boolean isAlreadyApproved()
{
}
}