gvsig-educa / org.gvsig.educa.portableview / trunk / org.gvsig.educa.portableview / org.gvsig.educa.portableview.lib / org.gvsig.educa.portableview.lib.api / src / main / java / org / gvsig / educa / portableview / map / InvalidInstalledPortableViewException.java @ 256
History | View | Annotate | Download (2.83 KB)
1 |
/* gvSIG. Geographic Information System of the Valencian Government
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2007-2008 Infrastructures and Transports Department
|
4 |
* of the Valencian Government (CIT)
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 2
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
*/
|
22 |
package org.gvsig.educa.portableview.map; |
23 |
|
24 |
import java.io.File; |
25 |
|
26 |
import org.gvsig.educa.portableview.PortableViewException; |
27 |
|
28 |
/**
|
29 |
* Exception Throws when try to open an installed PortableView folder with
|
30 |
* invalid format (missing package.info file or no match data)
|
31 |
*
|
32 |
* @author gvSIG Team
|
33 |
* @version $Id$
|
34 |
*
|
35 |
*/
|
36 |
public class InvalidInstalledPortableViewException extends PortableViewException { |
37 |
|
38 |
/**
|
39 |
*
|
40 |
*/
|
41 |
private static final long serialVersionUID = 1L; |
42 |
|
43 |
private static final String MESSAGE = |
44 |
"Invalid format of an installed PortableView [%(folderPath)]: %(info)";
|
45 |
|
46 |
private static final String KEY = "_InvalidInstalledPortableViewException"; |
47 |
|
48 |
/**
|
49 |
* Invalid format of an installed portable view folder by unspecified problem
|
50 |
*
|
51 |
* @param mapFile
|
52 |
*/
|
53 |
public InvalidInstalledPortableViewException(File mapFolder) { |
54 |
this(mapFolder, "unspecified problem"); |
55 |
} |
56 |
|
57 |
/**
|
58 |
* Invalid format of a portable view file
|
59 |
*
|
60 |
* @param mapFile
|
61 |
* @param message
|
62 |
* problem description
|
63 |
*/
|
64 |
public InvalidInstalledPortableViewException(File mapFolder, String message) { |
65 |
super(MESSAGE, KEY, serialVersionUID);
|
66 |
setValue("info", message);
|
67 |
setValue("folderPath", mapFolder.getAbsolutePath());
|
68 |
} |
69 |
|
70 |
/**
|
71 |
* Invalid format of a portable view file
|
72 |
*
|
73 |
* @param mapFile
|
74 |
* @param message
|
75 |
* problem description
|
76 |
* @param cause
|
77 |
*/
|
78 |
public InvalidInstalledPortableViewException(File mapFolder, String message, |
79 |
Throwable cause) {
|
80 |
super(MESSAGE, cause, KEY, serialVersionUID);
|
81 |
setValue("info", message);
|
82 |
setValue("folderPath", mapFolder.getAbsolutePath());
|
83 |
} |
84 |
|
85 |
/**
|
86 |
* Invalid format of a portable view file
|
87 |
*
|
88 |
* @param mapFile
|
89 |
*/
|
90 |
public InvalidInstalledPortableViewException(File mapFile, Throwable cause) { |
91 |
this(mapFile, "initializing problem", cause); |
92 |
} |
93 |
|
94 |
} |