Statistics
| Revision:

gvsig-raster / org.gvsig.raster.ermapper / trunk / org.gvsig.raster.ermapper / org.gvsig.raster.ermapper.jni / src / main / java / es / gva / cit / jecwcompress / NCSError.java @ 2449

History | View | Annotate | Download (13.7 KB)

1
/**********************************************************************
2
 * $Id: NCSError.java 3538 2006-01-09 11:56:54Z nacho $
3
 *
4
 * Name:     NCSError.java
5
 * Project:  
6
 * Purpose:  
7
 * Author:   Nacho Brodin, brodin_ign@gva.es
8
 *
9
 **********************************************************************/
10
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
11
*
12
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
13
*
14
* This program is free software; you can redistribute it and/or
15
* modify it under the terms of the GNU General Public License
16
* as published by the Free Software Foundation; either version 2
17
* of the License, or (at your option) any later version.
18
*
19
* This program is distributed in the hope that it will be useful,
20
* but WITHOUT ANY WARRANTY; without even the implied warranty of
21
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22
* GNU General Public License for more details.
23
*
24
* You should have received a copy of the GNU General Public License
25
* along with this program; if not, write to the Free Software
26
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
27
*
28
* For more information, contact:
29
*
30
*  Generalitat Valenciana
31
*   Conselleria d'Infraestructures i Transport
32
*   Av. Blasco Ib??ez, 50
33
*   46010 VALENCIA
34
*   SPAIN
35
*
36
*      +34 963862235
37
*   gvsig@gva.es
38
*      www.gvsig.gva.es
39
*
40
*    or
41
*
42
*   IVER T.I. S.A
43
*   Salamanca 50
44
*   46005 Valencia
45
*   Spain
46
*
47
*   +34 963163400
48
*   dac@iver.es
49
*/
50

    
51
package es.gva.cit.jecwcompress;
52

    
53
/**
54
 * Clase que realiza la conversi?n de los c?digos de error que devuelve las funciones C
55
 * en cadenas para que pueda ser mostrado el significado del error al usuario.
56
 * 
57
 * @author Nacho Brodin <brodin_ign@gva.es>.<BR> Equipo de desarrollo gvSIG.<BR> http://www.gvsig.gva.es
58
 * @version 0.0
59
 * @link http://www.gvsig.gva.es
60
 */
61
public class NCSError{
62
        
63
        /**
64
         * Conversi?n de un c?digo de error pasado por par?metro a cadena
65
         * @return cadena que representa el error producido
66
         */
67
        public static String ErrorToString(int error){
68
        
69
                switch(error){
70
                        case 0: return new String("NCS_SUCCESS");
71
                        case 1: return new String("NCS_QUEUE_NODE_CREATE_FAILED");                        /**< Queue node creation failed */
72
                        case 2: return new String("NCS_FILE_OPEN_FAILED");                                        /**< File open failed */
73
                        case 3: return new String("NCS_FILE_LIMIT_REACHED");                                        /**< The Image Web Server's licensed file limit has been reached */
74
                        case 4: return new String("NCS_FILE_SIZE_LIMIT_REACHED");                        /**< The requested file is larger than is permitted by the license on this Image Web Server */
75
                        case 5: return new String("NCS_FILE_NO_MEMORY");                                                /**< Not enough memory for new file */
76
                        case 6: return new String("NCS_CLIENT_LIMIT_REACHED");                                /**< The Image Web Server's licensed client limit has been reached */
77
                        case 7: return new String("NCS_DUPLICATE_OPEN");                                                /**< Detected duplicate open from net layer */
78
                        case 8: return new String("NCS_PACKET_REQUEST_NYI");                                        /**< Packet request type not yet implemented */
79
                        case 9: return new String("NCS_PACKET_TYPE_ILLEGAL");                                /**< Packet type is illegal */
80
                        case 10: return new String("NCS_DESTROY_CLIENT_DANGLING_REQUESTS");        /**< Client closed while requests outstanding */
81
                        case 11: return new String("NCS_UNKNOWN_CLIENT_UID");                                        /**< Client UID unknown */
82
                        case 12: return new String("NCS_COULDNT_CREATE_CLIENT");                                /**< Could not create new client */
83
                        case 13: return new String("NCS_NET_COULDNT_RESOLVE_HOST");                        /**< Could not resolve address of Image Web Server */
84
                        case 14: return new String("NCS_NET_COULDNT_CONNECT");                                /**< Could not connect to host */
85
                        case 15: return new String("NCS_NET_RECV_TIMEOUT");                                        /**< Receive timeout */
86
                        case 16: return new String("NCS_NET_HEADER_SEND_FAILURE");                        /**< Error sending header */
87
                        case 17: return new String("NCS_NET_HEADER_RECV_FAILURE");                        /**< Error receiving header */
88
                        case 18: return new String("NCS_NET_PACKET_SEND_FAILURE");                        /**< Error sending packet */
89
                        case 19: return new String("NCS_NET_PACKET_RECV_FAILURE");                        /**< Error receiving packet */
90
                        case 20: return new String("NCS_NET_401_UNAUTHORISED");                                /**< 401 Unauthorised: SDK doesn't do authentication so this suggests a misconfigured server */                        
91
                        case 21: return new String("NCS_NET_403_FORBIDDEN");                                        /**< 403 Forbidden: could be a 403.9 from IIS or PWS meaning that the maximum simultaneous request limit has been reached */
92
                        case 22: return new String("NCS_NET_404_NOT_FOUND");                                        /**< 404 Not Found: this error suggests that the server hasn't got Image Web Server installed */
93
                        case 23: return new String("NCS_NET_407_PROXYAUTH");                                        /**< 407 Proxy Authentication: the SDK doesn't do proxy authentication yet either, so this also suggests misconfiguration */
94
                        case 24: return new String("NCS_NET_UNEXPECTED_RESPONSE");                        /**< Unexpected HTTP response could not be handled */
95
                        case 25: return new String("NCS_NET_BAD_RESPONSE");                                        /**< HTTP response received outside specification */
96
                        case 26: return new String("NCS_NET_ALREADY_CONNECTED");                                /**< Already connected */
97
                        case 27: return new String("NCS_INVALID_CONNECTION");                                        /**< Connection is invalid */
98
                        case 28: return new String("NCS_WINSOCK_FAILURE");                                        /**< A Windows sockets failure occurred */
99
                        case 29: return new String("NCS_SYMBOL_ERROR");                        /**< Symbology error */
100
                        case 30: return new String("NCS_OPEN_DB_ERROR");                        /**< Could not open database */
101
                        case 31: return new String("NCS_DB_QUERY_FAILED");                /**< Could not execute the requested query on database */
102
                        case 32: return new String("NCS_DB_SQL_ERROR");                        /**< SQL statement could not be executed */
103
                        case 33: return new String("NCS_GET_LAYER_FAILED");                /**< Open symbol layer failed */
104
                        case 34: return new String("NCS_DB_NOT_OPEN");                        /**< The database is not open */
105
                        case 35: return new String("NCS_QT_TYPE_UNSUPPORTED");        /**< This type of quadtree is not supported */
106
                        case 36: return new String("NCS_PREF_INVALID_USER_KEY");                /**< Invalid local user key name specified */
107
                        case 37: return new String("NCS_PREF_INVALID_MACHINE_KEY");        /**< Invalid local machine key name specified */
108
                        case 38: return new String("NCS_REGKEY_OPENEX_FAILED");                /**< Failed to open registry key */
109
                        case 39: return new String("NCS_REGQUERY_VALUE_FAILED");                /**< Registry query failed */
110
                        case 40: return new String("NCS_INVALID_REG_TYPE");                        /**< Type mismatch in registry variable */
111
                        case 41: return new String("NCS_INVALID_ARGUMENTS");                /**< Invalid arguments passed to function */
112
                        case 42: return new String("NCS_ECW_ERROR");                                /**< ECW error */
113
                        case 43: return new String("NCS_SERVER_ERROR");                        /**< Server error */
114
                        case 44: return new String("NCS_UNKNOWN_ERROR");                        /**< Unknown error */
115
                        case 45: return new String("NCS_EXTENT_ERROR");                        /**< Extent conversion failed */
116
                        case 46: return new String("NCS_COULDNT_ALLOC_MEMORY");        /**< Could not allocate enough memory */
117
                        case 47: return new String("NCS_INVALID_PARAMETER");                /**< An invalid parameter was used */
118
                        case 48: return new String("NCS_FILEIO_ERROR");                                                /**< Error reading or writing file */
119
                        case 49: return new String("NCS_COULDNT_OPEN_COMPRESSION");                        /**< Compression task could not be initialised */
120
                        case 50: return new String("NCS_COULDNT_PERFORM_COMPRESSION");                /**< Compression task could not be processed */
121
                        case 51: return new String("NCS_GENERATED_TOO_MANY_OUTPUT_LINES");        /**< Trying to generate too many output lines */
122
                        case 52: return new String("NCS_USER_CANCELLED_COMPRESSION");                        /**< Compression task was cancelled by client application */
123
                        case 53: return new String("NCS_COULDNT_READ_INPUT_LINE");                        /**< Could not read line from input data */
124
                        case 54: return new String("NCS_INPUT_SIZE_EXCEEDED");                                /**< Input image size was exceeded for this version of the SDK */
125
                        case 55: return new String("NCS_REGION_OUTSIDE_FILE");        /**< Specified image region is outside image extents */
126
                        case 56: return new String("NCS_NO_SUPERSAMPLE");                        /**< Supersampling is not supported by the SDK functions */
127
                        case 57: return new String("NCS_ZERO_SIZE");                                /**< Specified image region has a zero width or height */
128
                        case 58: return new String("NCS_TOO_MANY_BANDS");                        /**< More bands specified than exist in the input file */
129
                        case 59: return new String("NCS_INVALID_BAND_NR");                /**< An invalid band number has been specified */
130
                        case 60: return new String("NCS_INPUT_SIZE_TOO_SMALL");        /**< Input image size is too small to compress - for ECW compression there is a minimum output file size */
131
                        case 61: return new String("NCS_INCOMPATIBLE_PROTOCOL_VERSION");        /**< The ECWP client version is incompatible with this server */
132
                        case 62: return new String("NCS_WININET_FAILURE");                                /**< Windows Internet Client error */
133
                        case 63: return new String("NCS_COULDNT_LOAD_WININET");                        /**< wininet.dll could not be loaded - usually indicates Internet Explorer should be upgraded */
134
                        case 64: return new String("NCS_FILE_INVALID_SETVIEW");                        /**< The parameters specified for setting a file view were invalid, or the view was not set */
135
                        case 65: return new String("NCS_FILE_NOT_OPEN");                                        /**< No file is open */
136
                        case 66: return new String("NCS_JNI_REFRESH_NOT_IMPLEMENTED");        /**< Class does not implement ECWProgressiveDisplay interface */
137
                        case 67: return new String("NCS_INCOMPATIBLE_COORDINATE_SYSTEMS");        /**< Incompatible coordinate systems */
138
                        case 68: return new String("NCS_INCOMPATIBLE_COORDINATE_DATUM");                /**< Incompatible coordinate datum types */
139
                        case 69: return new String("NCS_INCOMPATIBLE_COORDINATE_PROJECTION");        /**< Incompatible coordinate projection types */
140
                        case 70: return new String("NCS_INCOMPATIBLE_COORDINATE_UNITS");                /**< Incompatible coordinate units types */
141
                        case 71: return new String("NCS_COORDINATE_CANNOT_BE_TRANSFORMED");        /**< Non-linear coordinate systems not supported */
142
                        case 72: return new String("NCS_GDT_ERROR");                                                        /**< Error involving the GDT database */
143
                        case 73: return new String("NCS_NET_PACKET_RECV_ZERO_LENGTH");        /**< Zero length packet received */
144
                        case 74: return new String("NCS_UNSUPPORTEDLANGUAGE");                        /**< Must use Japanese version of the ECW SDK */
145
                        case 75: return new String("NCS_CONNECTION_LOST");                                /**< Connection to server was lost */
146
                        case 76: return new String("NCS_COORD_CONVERT_ERROR");                        /**< NCSGDT coordinate conversion failed */
147
                        case 77: return new String("NCS_METABASE_OPEN_FAILED");                        /**< Failed to open metabase */
148
                        case 78: return new String("NCS_METABASE_GET_FAILED");                        /**< Failed to get value from metabase */
149
                        case 79: return new String("NCS_NET_HEADER_SEND_TIMEOUT");                /**< Timeout sending header */
150
                        case 80: return new String("NCS_JNI_ERROR");                                                /**< Java JNI error */
151
                        case 81: return new String("NCS_DB_INVALID_NAME");                                /**< No data source passed */
152
                        case 82: return new String("NCS_SYMBOL_COULDNT_RESOLVE_HOST");        /**< Could not resolve address of Image Web Server Symbol Server Extension */
153
                        case 83: return new String("NCS_INVALID_ERROR_ENUM");                        /**< The value of an NCSError error number was invalid! */
154
                        case 84: return new String("NCS_FILE_EOF");                                                /**< End of file reached */
155
                        case 85: return new String("NCS_FILE_NOT_FOUND");                                /**< File not found */
156
                        case 86: return new String("NCS_FILE_INVALID");                                        /**< File was invalid or corrupt */
157
                        case 87: return new String("NCS_FILE_SEEK_ERROR");                                /**< Attempted to read, write or seek past file limits */
158
                        case 88: return new String("NCS_FILE_NO_PERMISSIONS");                        /**< Permissions not available to access file */
159
                        case 89: return new String("NCS_FILE_OPEN_ERROR");                                /**< Error opengin file */
160
                        case 90: return new String("NCS_FILE_CLOSE_ERROR");                                /**< Error closing file */
161
                        case 91: return new String("NCS_FILE_IO_ERROR");                                        /**< Miscellaneous error involving file input or output */
162
                        case 92: return new String("NCS_SET_EXTENTS_ERROR");                                /**< Illegal or invalid world coordinates supplied */
163
                        case 93: return new String("NCS_FILE_PROJECTION_MISMATCH");                /**< Image projection does not match that of the controlling layer */
164
                        case 94: return new String("NCS_GDT_UNKNOWN_PROJECTION");                /**< Unknown map projection */
165
                        case 95: return new String("NCS_GDT_UNKNOWN_DATUM");                                /**< Unknown geodetic datum */
166
                        case 96: return new String("NCS_GDT_USER_SERVER_FAILED");                /**< User specified Geographic Projection Database data server failed */
167
                        case 97: return new String("NCS_GDT_REMOTE_PATH_DISABLED");                /**< Remote Geographic Projection Database file downloading has been disabled and no local GDT data is available */
168
                        case 98: return new String("NCS_GDT_BAD_TRANSFORM_MODE");                /**< Invalid mode of transform */
169
                        case 99: return new String("NCS_GDT_TRANSFORM_OUT_OF_BOUNDS");        /**< Coordinate to be transformed is out of bounds */
170
                        case 100: return new String("NCS_LAYER_DUPLICATE_LAYER_NAME");        /**< A layer already exists with the specified name */
171
                        case 101: return new String("NCS_LAYER_INVALID_PARAMETER");                /**< The specified layer does not contain the specified parameter */
172
                        case 102: return new String("NCS_PIPE_CREATE_FAILED");                        /**< Failed to create pipe */
173
                        case 103: return new String("NCS_FILE_MKDIR_EXISTS");                                /**< Directory to be created already exists */ /*[20]*/
174
                        case 104: return new String("NCS_FILE_MKDIR_PATH_NOT_FOUND");                /**< The path specified for directory creation does not exist */ /*[20]*/
175
                        case 105: return new String("NCS_ECW_READ_CANCELLED");                        /**< File read was cancelled */
176
                        case 106: return new String("NCS_JP2_GEODATA_READ_ERROR");                /**< Error reading geodata from a JPEG 2000 file */ /*[21]*/
177
                        case 107: return new String("NCS_JP2_GEODATA_WRITE_ERROR");            /**< Error writing geodata to a JPEG 2000 file */        /*[21]*/
178
                        case 108: return new String("NCS_JP2_GEODATA_NOT_GEOREFERENCED"); /**< JPEG 2000 file not georeferenced */                        /*[21]*/
179
                        case 109: return new String("NCS_MAX_ERROR_NUMBER");                                /**< The maximum error value in this enumerated typ*/
180
                }
181
                return new String("");
182
        }
183
}