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