001/*
002 *  Copyright 2019 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.cms.data;
017
018import org.ametys.plugins.repository.data.repositorydata.RepositoryData;
019
020/**
021 * Class representing a file
022 */
023public class NamedResource extends Resource
024{
025    /** the file's name */
026    protected String _filename;
027    
028    /**
029     * Default constructor
030     */
031    public NamedResource()
032    {
033        // Empty constructor
034    }
035    
036    /**
037     * Constructor to use when reading the file from the repository
038     * @param repositoryData the repository data containing the file's data
039     */
040    public NamedResource(RepositoryData repositoryData)
041    {
042        super(repositoryData);
043    }
044    
045    /**
046     * Retrieves the binary's file name
047     * @return the binary's file name
048     */
049    public String getFilename()
050    {
051        return _filename;
052    }
053
054    /**
055     * Sets the binary's file name
056     * @param filename the file name to set
057     */
058    public void setFilename(String filename)
059    {
060        _filename = filename;
061    }
062}