001 /* -*- mode: Java; c-basic-offset: 2; indent-tabs-mode: nil -*- 002 * 003 * $Id$ 004 * 005 * Copyright (c) 2010-2011 Edugility LLC. 006 * 007 * Permission is hereby granted, free of charge, to any person 008 * obtaining a copy of this software and associated documentation 009 * files (the "Software"), to deal in the Software without 010 * restriction, including without limitation the rights to use, copy, 011 * modify, merge, publish, distribute, sublicense and/or sell copies 012 * of the Software, and to permit persons to whom the Software is 013 * furnished to do so, subject to the following conditions: 014 * 015 * The above copyright notice and this permission notice shall be 016 * included in all copies or substantial portions of the Software. 017 * 018 * THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 019 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 021 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 022 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 023 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 024 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 025 * DEALINGS IN THE SOFTWARE. 026 * 027 * The original copy of this license is available at 028 * http://www.opensource.org/license/mit-license.html. 029 */ 030 package com.edugility.jpa.maven.plugin; 031 032 import java.io.File; 033 034 /** 035 * A {@link FileException} that results from a {@link File} 036 * representing a directory failing validation of some kind. 037 * 038 * @author <a href="mailto:ljnelson@gmail.com">Laird Nelson</a> 039 * 040 * @version 1.0-SNAPSHOT 041 * 042 * @since 1.0-SNAPSHOT 043 * 044 * @see FileException 045 */ 046 public abstract class DirectoryException extends FileException { 047 048 /** 049 * Creates a new {@link DirectoryException}. 050 * 051 * @param directory the {@link File} whose validation failure caused 052 * this {@link DirectoryException} to be thrown; may be {@code null} 053 */ 054 protected DirectoryException(final File directory) { 055 super(directory); 056 } 057 058 /** 059 * Creates a new {@link DirectoryException}. 060 * 061 * @param directory the {@link File} whose validation failure caused 062 * this {@link DirectoryException} to be thrown; may be {@code null} 063 * 064 * @param message a detail message further explaining this {@link 065 * DirectoryException}; may be {@code null} 066 */ 067 protected DirectoryException(final File directory, final String message) { 068 super(directory, message); 069 } 070 071 /** 072 * Creates a new {@link DirectoryException}. 073 * 074 * @param directory the {@link File} whose validation failure caused 075 * this {@link DirectoryException} to be thrown; may be {@code null} 076 * 077 * @param cause the {@link Throwable} that contributed to this 078 * {@link DirectoryException}'s cause; may be {@code null} 079 * 080 * @param message a detail message further explaining this {@link 081 * DirectoryException}; may be {@code null} 082 */ 083 protected DirectoryException(final File directory, final Throwable cause, final String message) { 084 super(directory, cause, message); 085 } 086 087 /** 088 * A convenience method that returns the return value of the {@link 089 * #getFile()} method. 090 * 091 * <p>This method may return {@code null}.</p> 092 * 093 * @return the result of calling the {@link #getFile()} method, or 094 * {@code null} 095 */ 096 public final File getDirectory() { 097 return this.getFile(); 098 } 099 100 }