/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2008 Bull S.A.S.
 * Contact: jonas-team@ow2.org
 *
 * Application Versioning System
 * Copyright (C) 2008 France Telecom R&D
 *
 * This 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 1any later version.
 *
 * This 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 library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.ow2.jonas.web.tomcat6.versioning;

/**
 * Information about a versioned path.
 *
 * @author Frederic Germaneau
 * @author S. Ali Tokmen
 */
public class VersionedPathBean {
    /**
     * User path.
     */
    private String userPath;

    /**
     * Versioned path.
     */
    private String versionedPath;

    /**
     * Does the user path end with a slash ?
     */
    private boolean userPathEndWithSlash;

    /**
     * Sets all members to null.
     */
    public VersionedPathBean() {
        this.userPath = null;
        this.versionedPath = null;
        this.userPathEndWithSlash = true;
    }

    /**
     * Initializes all members.
     *
     * @param userPath              User path.
     * @param versionedPath         Versioned path.
     * @param userPathEndWithSlash  Does the user path end with a slash ?
     */
    public VersionedPathBean(final String userPath, final String versionedPath, final boolean userPathEndWithSlash) {
        this.userPath = userPath;
        this.versionedPath = versionedPath;
        this.userPathEndWithSlash = userPathEndWithSlash;
    }

    /**
     * @return   User path.
     */
    public String getUserPath() {
        return userPath;
    }

    /**
     * @param userPath   User path to set.
     */
    public void setUserPath(final String userPath) {
        this.userPath = userPath;
    }

    /**
     * @return  Versioned path.
     */
    public String getVersionedPath() {
        return versionedPath;
    }

    /**
     * @param versionedPath  Versioned path to set. This doesn't set
     *                       userPathEndWithSlash.
     */
    public void setVersionedPath(final String versionedPath) {
        this.versionedPath = versionedPath;
    }

    /**
     * @return  Does the user path end with a slash ?
     */
    public boolean isUserPathEndWithSlash() {
        return userPathEndWithSlash;
    }

    /**
     * @param userPathEndWithSlash  Whether the user path ends with a slash.
     */
    public void setUserPathEndWithSlash(final boolean userPathEndWithSlash) {
        this.userPathEndWithSlash = userPathEndWithSlash;
    }
}
