001/*
002 * Licensed to the Apache Software Foundation (ASF) under one or more
003 * contributor license agreements.  See the NOTICE file distributed with
004 * this work for additional information regarding copyright ownership.
005 * The ASF licenses this file to You under the Apache License, Version 2.0
006 * (the "License"); you may not use this file except in compliance with
007 * the License.  You may obtain a copy of the License at
008 *
009 *      http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017package org.apache.wicket.request.resource.caching;
018
019import org.apache.wicket.request.mapper.parameter.INamedParameters;
020
021/**
022 * Url view given to the {@link IResourceCachingStrategy} to manipulate
023 * 
024 * @author igor
025 */
026public class ResourceUrl
027{
028        private String fileName;
029        private INamedParameters parameters;
030
031        /**
032         * Constructor
033         * 
034         * @param fileName
035         *            file name of the resource
036         * @param urlParameters
037         *            query string parameters
038         */
039        public ResourceUrl(String fileName, INamedParameters urlParameters)
040        {
041                this.fileName = fileName;
042                parameters = urlParameters;
043        }
044
045        /**
046         * @return file name of the resource
047         */
048        public String getFileName()
049        {
050                return fileName;
051        }
052
053        /**
054         * @param fileName
055         *            file name of the resource
056         */
057        public void setFileName(String fileName)
058        {
059                this.fileName = fileName;
060        }
061
062        /**
063         * @return query string parameters
064         */
065        public INamedParameters getParameters()
066        {
067                return parameters;
068        }
069
070        @Override
071        public String toString()
072        {
073                return "Name: " + fileName + "\n\tParameters: " + parameters;
074        }
075}