Mercurial > hg4j
comparison src/org/tmatesoft/hg/core/HgIOException.java @ 498:0205a5c4566b
Issue 38: preserve user formatting and comments when updating configuration files
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 26 Oct 2012 18:17:15 +0200 |
parents | |
children | 7c0d2ce340b8 |
comparison
equal
deleted
inserted
replaced
497:02140be396d5 | 498:0205a5c4566b |
---|---|
1 /* | |
2 * Copyright (c) 2012 TMate Software Ltd | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; version 2 of the License. | |
7 * | |
8 * This program is distributed in the hope that it will be useful, | |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 * GNU General Public License for more details. | |
12 * | |
13 * For information on how to redistribute this software under | |
14 * the terms of a license other than GNU General Public License | |
15 * contact TMate Software at support@hg4j.com | |
16 */ | |
17 package org.tmatesoft.hg.core; | |
18 | |
19 import java.io.File; | |
20 import java.io.IOException; | |
21 | |
22 /** | |
23 * Tailored wrap for {@link IOException} and similar I/O-related issues. Unlike {@link IOException}, | |
24 * keeps track of {@link File} that caused the problem. Besides, additional information (like revision, | |
25 * see {@link HgException}) may be attached. | |
26 * | |
27 * @author Artem Tikhomirov | |
28 * @author TMate Software Ltd. | |
29 */ | |
30 @SuppressWarnings("serial") | |
31 public class HgIOException extends HgException { | |
32 private final File file; | |
33 | |
34 public HgIOException(String message, File troubleFile) { | |
35 this(message, null, troubleFile); | |
36 } | |
37 | |
38 /** | |
39 * @param message describes the issue, never <code>null</code> | |
40 * @param cause root cause for the error, likely {@link IOException} or its subclass, but not necessarily, and may be omitted. | |
41 * @param troubleFile file we tried to deal with, never <code>null</code> | |
42 */ | |
43 public HgIOException(String message, Exception cause, File troubleFile) { | |
44 super(message, cause); | |
45 file = troubleFile; | |
46 } | |
47 | |
48 public File getFile() { | |
49 return file; | |
50 } | |
51 } |