/**
 * Copyright (c) 2010-2012 EBM WebSourcing, 2012-2013 Linagora
 * 
 * This program/library is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation, either version 2.1 of the License, or (at your
 * option) any later version.
 * 
 * This program/library is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program/library; If not, see <http://www.gnu.org/licenses/>
 * for the GNU Lesser General Public License version 2.1.
 */
package org.ow2.petals.cli.connection;

import java.io.File;

/**
 * The configured preference file does not exist.
 * 
 * @author Christophe DENEUX - Linagora
 * 
 */
public class PreferenceFileNotFoundException extends PreferenceFileException {
    
    private static final long serialVersionUID = 6784603308640370297L;

    private final static String MESSAGE_TEMPLATE = "The preferences file '%s' can not be found. Check your Petals CLI's installation.";
    
    /**
     * The preference file not found
     */
    private final File preferenceFileNotFound;

    public PreferenceFileNotFoundException(final File preferenceFileNotFound) {
        super(String.format(MESSAGE_TEMPLATE, preferenceFileNotFound.getAbsoluteFile()));
        this.preferenceFileNotFound = preferenceFileNotFound;
    }

    /**
     * @return The preference file not found
     */
    public File getPreferenceFileNotFound() {
        return this.preferenceFileNotFound;
    }

}
