1 /** 2 * Copyright 2011, Aiki IT, FotoRenamer 3 * <p/> 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * <p/> 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * <p/> 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package de.aikiit.fotorenamer.exception; 17 18 import org.apache.log4j.Logger; 19 20 import java.io.File; 21 22 import static de.aikiit.fotorenamer.util.LocalizationHelper.getBundleString; 23 24 /** 25 * Exception class to indicate that a selected directory contains no relevant 26 * files to be renamed. 27 * 28 * @author hirsch 29 * @version 04.03.11 30 */ 31 public class NoFilesFoundException extends Exception { 32 /** 33 * Logger. 34 */ 35 private static final Logger LOG = 36 Logger.getLogger(NoFilesFoundException.class); 37 38 /** 39 * Provide error messages for a directory. 40 * 41 * @param directory Current directory. 42 */ 43 public NoFilesFoundException(final File directory) { 44 super(directory == null ? getBundleString("fotorenamer.error.noselection") : directory.getAbsolutePath()); 45 LOG.error("no files found in " + directory); 46 } 47 48 }