001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (c) Alkacon Software GmbH & Co. KG (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.gwt.shared;
029
030import com.google.gwt.user.client.rpc.IsSerializable;
031
032/**
033 * A bean which represents a resource in the VFS.<p>
034 *
035 * @since 8.0.0
036 */
037public class CmsVfsEntryBean implements IsSerializable {
038
039    /** True if the resource has children. */
040    private boolean m_hasChildren;
041
042    /** True if the resource is a folder. */
043    private boolean m_isFolder;
044
045    /** The name of the resource. */
046    private String m_name;
047
048    /** The path of the resource. */
049    private String m_path;
050
051    /** The resource type of the resource. */
052    private String m_resourceType;
053
054    /**
055     * Constructs a new bean.<p>
056     *
057     * @param path the path of the resource
058     * @param name the name of the resource
059     * @param resourceType the resource type of the resource
060     * @param isFolder true if the resource is a folder
061     * @param hasChildren true if the resource is a folder which isn't empty
062     */
063    public CmsVfsEntryBean(String path, String name, String resourceType, boolean isFolder, boolean hasChildren) {
064
065        m_isFolder = isFolder;
066        m_path = path;
067        m_name = name;
068        m_resourceType = resourceType;
069        m_hasChildren = hasChildren;
070    }
071
072    /**
073     * Hidden default constructor.<p>
074     */
075    protected CmsVfsEntryBean() {
076
077        // do nothing
078    }
079
080    /**
081     * Returns the name of the resource.<p>
082     *
083     * @return the name of the resource
084     */
085    public String getName() {
086
087        return m_name;
088    }
089
090    /**
091     * Returns the path of the resource.<p>
092     *
093     * @return the path of the resource
094     */
095    public String getPath() {
096
097        return m_path;
098    }
099
100    /**
101     * Returns the resource type.<p>
102     *
103     * @return the resource type
104     */
105    public String getResourceType() {
106
107        return m_resourceType;
108    }
109
110    /**
111     * Returns true if the resource has children, i.e. is a non-empty folder.<p>
112     *
113     * @return true if the resource has children
114     */
115    public boolean hasChildren() {
116
117        return m_hasChildren;
118    }
119
120    /**
121     * Returns true if the resource is a folder.<p>
122     *
123     * @return true if the resource is a folder
124     */
125    public boolean isFolder() {
126
127        return m_isFolder;
128    }
129
130}