001/* 002 * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. 003 * Copyright (C) 2000-2010 The Gridarta Developers. 004 * 005 * This program is free software; you can redistribute it and/or modify 006 * it under the terms of the GNU General Public License as published by 007 * the Free Software Foundation; either version 2 of the License, or 008 * (at your option) any later version. 009 * 010 * This program is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 013 * GNU General Public License for more details. 014 * 015 * You should have received a copy of the GNU General Public License along 016 * with this program; if not, write to the Free Software Foundation, Inc., 017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 018 */ 019 020package net.sf.gridarta.model.mappathnormalizer; 021 022import java.io.File; 023import java.io.IOException; 024import org.jetbrains.annotations.NotNull; 025 026/** 027 * Exception throws if an I/O error occurs. 028 * @author Andreas Kirschbaum 029 */ 030public class IOErrorException extends Exception { 031 032 /** 033 * The serial version UID. 034 */ 035 private static final long serialVersionUID = 1L; 036 037 /** 038 * The invalid file. 039 * @serial 040 */ 041 @NotNull 042 private final File file; 043 044 /** 045 * Creates a new instance. 046 * @param file the invalid file 047 * @param exception the I/O exception 048 * @noinspection TypeMayBeWeakened 049 */ 050 public IOErrorException(@NotNull final File file, @NotNull final IOException exception) { 051 super(file.getPath(), exception); 052 this.file = file; 053 } 054 055 /** 056 * Returns the invalid file. 057 * @return the invalid file 058 */ 059 @NotNull 060 public File getFile() { 061 return file; 062 } 063 064}