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.resource;
018
019import java.io.IOException;
020import java.io.InputStream;
021
022import org.apache.wicket.util.value.ValueMap;
023
024/**
025 * Load properties from properties file. The encoding of the file must be ISO 8859-1.
026 * 
027 * @see java.util.Properties
028 * 
029 * @author Juergen Donnerstag
030 */
031public class IsoPropertiesFilePropertiesLoader implements IPropertiesLoader
032{
033        private final String extension;
034
035        /**
036         * Construct.
037         * 
038         * @param extension
039         */
040        public IsoPropertiesFilePropertiesLoader(final String extension)
041        {
042                this.extension = extension;
043        }
044
045        /**
046         * @see org.apache.wicket.resource.IPropertiesLoader#getFileExtension()
047         */
048        @Override
049        public final String getFileExtension()
050        {
051                return extension;
052        }
053
054        /**
055         * @see org.apache.wicket.resource.IPropertiesLoader#loadJavaProperties(java.io.InputStream)
056         */
057        @Override
058        public java.util.Properties loadJavaProperties(final InputStream in) throws IOException
059        {
060                java.util.Properties properties = new java.util.Properties();
061                properties.load(in);
062                return properties;
063        }
064
065        /**
066         * @see org.apache.wicket.resource.IPropertiesLoader#loadWicketProperties(java.io.InputStream)
067         */
068        @Override
069        public ValueMap loadWicketProperties(InputStream inputStream)
070        {
071                return null;
072        }
073}