InvalidFormatException.java |
1 /* 2 * InvalidFormatException.java 3 * 4 * Copyright (c) 2002, The University of Sheffield. 5 * 6 * This file is part of GATE (see http://gate.ac.uk/), and is free 7 * software, licenced under the GNU Library General Public License, 8 * Version 2, June1991. 9 * 10 * A copy of this licence is included in the distribution in the file 11 * licence.html, and is also available at http://gate.ac.uk/gate/licence.html. 12 * 13 * borislav popov 16/04/2002 14 * 15 * $Id: InvalidFormatException.java,v 1.3 2004/03/25 13:01:26 valyt Exp $ 16 */ 17 package gate.creole.ontology; 18 19 import java.net.URL; 20 21 import gate.util.GateException; 22 23 /** An exception thrown when invalid format of an ontology file is detected */ 24 public class InvalidFormatException extends GateException{ 25 26 /** the ontology file */ 27 private String file; 28 /** the url of the file */ 29 private URL url; 30 31 /** The basic exception message */ 32 private final static String MSG = "Invalid format of file is detected; file: "; 33 34 /** 35 * Construction given file and comment 36 * @param file the ontology file 37 * @param comment comment of the exception 38 */ 39 public InvalidFormatException(String file,String comment) { 40 super(MSG+file+"\n"+(null==comment ? "" : comment)); 41 } 42 43 /** 44 * Construction given file URL and comment 45 * @param url the ontology url 46 * @param comment comment of the exception 47 */ 48 public InvalidFormatException(URL url,String comment) { 49 super(MSG+url.toString()+"\n"+(null==comment ? "" : comment)); 50 } 51 52 public InvalidFormatException() { 53 super(MSG); 54 } 55 56 /** 57 * Gets the file associated with this exception 58 * @return the file associated with this exception 59 */ 60 public String getFile(){ 61 return file; 62 } 63 64 /** 65 * Gets the URL associated with this exception 66 * @return the URL associated with this exception 67 */ 68 private URL getURL() { 69 return url; 70 } 71 } // class InvalidFormatException