1042N/A/*
1042N/A * CDDL HEADER START
1042N/A *
1042N/A * The contents of this file are subject to the terms of the
1042N/A * Common Development and Distribution License, Version 1.0 only
1042N/A * (the "License"). You may not use this file except in compliance
1042N/A * with the License.
1042N/A *
1042N/A * You can obtain a copy of the license at
1042N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE
1042N/A * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
1042N/A * See the License for the specific language governing permissions
1042N/A * and limitations under the License.
1042N/A *
1042N/A * When distributing Covered Code, include this CDDL HEADER in each
1042N/A * file and include the License file at
1042N/A * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
1042N/A * add the following below this CDDL HEADER, with the fields enclosed
1042N/A * by brackets "[]" replaced with your own identifying information:
1042N/A * Portions Copyright [yyyy] [name of copyright owner]
1042N/A *
1042N/A * CDDL HEADER END
1042N/A *
1042N/A *
3215N/A * Copyright 2006-2008 Sun Microsystems, Inc.
1042N/A */
1042N/A
1042N/Apackage org.opends.quicksetup;
2086N/Aimport org.opends.messages.Message;
1042N/A
2086N/Aimport org.opends.server.types.OpenDsException;
1935N/A
1042N/A/**
1042N/A * This exception is used to encapsulate all the error that we might have
1042N/A * during the installation.
1042N/A *
1042N/A * @see org.opends.quicksetup.installer.Installer
1042N/A * @see org.opends.quicksetup.installer.webstart.WebStartInstaller
1042N/A * @see org.opends.quicksetup.installer.offline.OfflineInstaller
1042N/A *
1042N/A */
2086N/Apublic class ApplicationException extends OpenDsException {
2086N/A
1042N/A private static final long serialVersionUID = -3527273444231560341L;
1042N/A
1935N/A private ReturnCode type;
1042N/A
1042N/A /**
1073N/A * Creates a new ApplicationException of type FILE_SYSTEM_ERROR.
1073N/A * @param msg localized exception message
1073N/A * @param e Exception cause
1073N/A * @return ApplicationException with Type property being FILE_SYSTEM_ERROR
1073N/A */
2086N/A public static ApplicationException createFileSystemException(Message msg,
1935N/A Exception e)
1935N/A {
1935N/A return new ApplicationException(ReturnCode.FILE_SYSTEM_ACCESS_ERROR,
1935N/A msg, e);
1073N/A }
1073N/A
1073N/A /**
1042N/A * The constructor of the ApplicationException.
1935N/A *
1935N/A * @param type
1935N/A * the type of error we have.
1935N/A * @param localizedMsg
1935N/A * a localized string describing the problem.
1935N/A * @param rootCause
1935N/A * the root cause of this exception.
1042N/A */
2086N/A public ApplicationException(ReturnCode type, Message localizedMsg,
1042N/A Throwable rootCause)
1042N/A {
1042N/A super(localizedMsg, rootCause);
1042N/A this.type = type;
1042N/A }
1042N/A
1042N/A /**
1042N/A * Returns the Type of this exception.
1042N/A * @return the Type of this exception.
1042N/A */
1935N/A public ReturnCode getType()
1042N/A {
1042N/A return type;
1042N/A }
1042N/A
1042N/A /**
1042N/A * {@inheritDoc}
1042N/A */
1042N/A public String toString()
1042N/A {
1042N/A return getMessage();
1042N/A }
1042N/A}