gvsig-raster / org.gvsig.raster.ermapper / trunk / org.gvsig.raster.ermapper / org.gvsig.raster.ermapper.jni / src / main / java / com / ermapper / ecw / JNCSError.java @ 2449
History | View | Annotate | Download (13.1 KB)
1 |
package com.ermapper.ecw; |
---|---|
2 |
|
3 |
/**
|
4 |
* Representaci?n de errores como cadenas de texto
|
5 |
*/
|
6 |
public class JNCSError{ |
7 |
|
8 |
public static String getError(int e){ |
9 |
|
10 |
switch(e){
|
11 |
case 0: return new String("No error"); /* NCS_SUCCESS */ |
12 |
/* NCS Raster Errors */
|
13 |
case 1: return new String("Queue node creation failed"); /* NCS_QUEUE_NODE_CREATE_FAILED */ |
14 |
case 2: return new String("Could not open file"); /* NCS_FILE_OPEN_FAILED */ |
15 |
case 3: return new String("The Image Web Server's licensed file limit has been reached "); /* NCS_FILE_LIMIT_REACHED (license name eg office) */ |
16 |
case 4: return new String("The requested file is larger than is permitted by the license on this Image Web Server ");/* NCS_FILE_SIZE_LIMIT_REACHED (license name eg office) */ |
17 |
case 5: return new String("Not enough memory for new file"); /* NCS_FILE_NO_MEMORY */ |
18 |
case 6: return new String("The Image Web Server's licensed client limit has been reached "); /* NCS_CLIENT_LIMIT_REACHED (license name eg enterprise) */ |
19 |
case 7: return new String("Detected duplicate open from net layer"); /* NCS_DUPLICATE_OPEN */ |
20 |
case 8: return new String("Packet request type not yet implemented"); /* NCS_PACKET_REQUEST_NYI (packet type num) */ |
21 |
case 9: return new String("Packet type is illegal"); /* NCS_PACKET_TYPE_ILLEGAL (packet type num) */ |
22 |
case 10: return new String("Client closed while requests outstanding"); /* NCS_DESTROY_CLIENT_DANGLING_REQUESTS */ |
23 |
|
24 |
/* NCS Network Errors */
|
25 |
case 11: return new String("Client UID unknown"); /* NCS_UNKNOWN_CLIENT_UID */ |
26 |
case 12: return new String("Could not create new client "); /* NCS_COULDNT_CREATE_CLIENT (reason) */ |
27 |
case 13: return new String("Could not resolve address of Image Web Server "); /* NCS_NET_COULDNT_RESOLVE_HOST (ip or hostname) */ |
28 |
case 14: return new String("Could not connect to host "); /* NCS_NET_COULDNT_CONNECT (reason) */ |
29 |
case 15: return new String("Receive timeout"); /* NCS_NET_RECV_TIMEOUT */ |
30 |
case 16: return new String("Error sending header "); /* NCS_NET_HEADER_SEND_FAILURE (reason) */ |
31 |
case 17: return new String("Error receiving header "); /* NCS_NET_HEADER_RECV_FAILURE (reason) */ |
32 |
case 18: return new String("Error sending packet"); /* NCS_NET_PACKET_SEND_FAILURE */ |
33 |
case 19: return new String("Error receiving packet"); /* NCS_NET_PACKET_RECV_FAILURE */ |
34 |
case 20: return new String("401 Unauthorised"); /* NCS_NET_401_UNAUTHORISED */ |
35 |
case 21: return new String("403 Forbidden"); /* NCS_NET_403_FORBIDDEN */ |
36 |
case 22: return new String("Is the host an Image Web Server?"); /* NCS_NET_404_NOT_FOUND */ |
37 |
case 23: return new String("Your HTTP proxy requires authentication,\nthis is presently unsupported by the Image Web Server control"); /* NCS_NET_407_PROXYAUTH */ |
38 |
case 24: return new String("Unexpected HTTP response "); /* NCS_NET_UNEXPECTED_RESPONSE (resonse # or string)*/ |
39 |
case 25: return new String("Bad HTTP response "); /* NCS_NET_BAD_RESPONSE (resonse # or string) */ |
40 |
case 26: return new String("Already connected"); /* NCS_NET_ALREADY_CONNECTED */ |
41 |
case 27: return new String("The connection is invalid"); /* NCS_INVALID_CONNECTION */ |
42 |
case 28: return new String("Windows sockets failure "); /* NCS_WINSOCK_FAILURE (reason (GetLastError()) or wininet version) */ |
43 |
|
44 |
/* NCS Symbol Errors */
|
45 |
case 29: return new String("Symbology error"); /* NCS_SYMBOL_ERROR */ |
46 |
case 30: return new String("Could not open database"); /* NCS_OPEN_DB_ERROR */ |
47 |
case 31: return new String("Could not execute the requested query on database"); /* NCS_DB_QUERY_FAILED */ |
48 |
case 32: return new String("SQL statement could not be executed"); /* NCS_DB_SQL_ERROR */ |
49 |
case 33: return new String("Open symbol layer failed"); /* NCS_GET_LAYER_FAILED */ |
50 |
case 34: return new String("The database is not open"); /* NCS_DB_NOT_OPEN */ |
51 |
case 35: return new String("This type of quad tree is not supported"); /* NCS_QT_TYPE_UNSUPPORTED */ |
52 |
|
53 |
/* Preference errors */
|
54 |
case 36: return new String("Invalid local user key name specified "); /* NCS_PREF_INVALID_USER_KEY (key name) */ |
55 |
case 37: return new String("Invalid local machine key name specified "); /* NCS_PREF_INVALID_MACHINE_KEY (local machine key) */ |
56 |
case 38: return new String("Failed to open registry key "); /* NCS_REGKEY_OPENEX_FAILED (key name) */ |
57 |
case 39: return new String("Registry query failed "); /* NCS_REGQUERY_VALUE_FAILED (reason) */ |
58 |
case 40: return new String("Type mismatch in registry variable"); /* NCS_INVALID_REG_TYPE */ |
59 |
|
60 |
/* Misc errors */
|
61 |
case 41: return new String("Invalid arguments passed to function "); /* NCS_INVALID_ARGUMENTS (function name) */ |
62 |
case 42: return new String("ECW error "); /* NCS_ECW_ERROR (reason) */ |
63 |
case 43: return new String("Server error "); /* NCS_SERVER_ERROR (reason) */ |
64 |
case 44: return new String("Unknown error "); /* NCS_UNKNOWN_ERROR (reason) */ |
65 |
case 45: return new String("Extent conversion failed"); /* NCS_EXTENT_ERROR */ |
66 |
case 46: return new String("Could not allocate enough memory "); /* NCS_COULDNT_ALLOC_MEMORY (what trying to malloc) [12]*/ |
67 |
case 47: return new String("An invalid parameter was used "); /* NCS_INVALID_PARAMETER (reason) */ |
68 |
|
69 |
/* Compress errors */
|
70 |
case 48: return new String("Could not perform Read/Write on file "); /* NCS_FILEIO_ERROR (filename) */ |
71 |
case 49: return new String("Could not open compression task "); /* NCS_COULDNT_OPEN_COMPRESSION (reason) */ |
72 |
case 50: return new String("Could not perform compression "); /* NCS_COULDNT_PERFORM_COMPRESSION (reason) */ |
73 |
case 51: return new String("Trying to generate too many output lines"); /* NCS_GENERATED_TOO_MANY_OUTPUT_LINES */ |
74 |
case 52: return new String("User cancelled compression"); /* NCS_USER_CANCELLED_COMPRESSION */ |
75 |
case 53: return new String("Could not read line from input image file"); /* NCS_COULDNT_READ_INPUT_LINE */ |
76 |
case 54: return new String("Input image size exceeded for this version"); /* NCS_INPUT_SIZE_EXCEEDED */ |
77 |
|
78 |
/* Decompression Errors */
|
79 |
case 55: return new String("Specified image region is outside image area"); /* NCS_REGION_OUTSIDE_FILE */ |
80 |
case 56: return new String("Supersampling not supported"); /* NCS_NO_SUPERSAMPLE */ |
81 |
case 57: return new String("Specified image region has a zero width or height"); /* NCS_ZERO_SIZE */ |
82 |
case 58: return new String("More bands specified than exist in this file ");/* NCS_TOO_MANY_BANDS (bands passed); bands in file) */ |
83 |
case 59: return new String("An invalid band number has been specified "); /* NCS_INVALID_BAND_NR (bandnr) */ |
84 |
|
85 |
/* New Compression Error */
|
86 |
case 60: return new String("Input image size is too small to compress"); /* NCS_INPUT_SIZE_TOO_SMALL */ |
87 |
/* NEW Network error */
|
88 |
case 61: return new String("The ECWP client version is incompatible with this server "); /* NCS_INCOMPATIBLE_PROTOCOL_VERSION (clientver, server ver) */ |
89 |
case 62: return new String("Windows Internet Client error "); /* NCS_WININET_FAILURE (reason) */ |
90 |
case 63: return new String("Could not load wininet.dll "); /* NCS_COULDNT_LOAD_WININET (reason) */ |
91 |
|
92 |
/* NCSFile && NCSRenderer class errors */
|
93 |
case 64: return new String("Invalid SetView parameters or SetView not called."); /* NCS_FILE_INVALID_SETVIEW */ |
94 |
case 65: return new String("There is no open ECW file."); /* NCS_FILE_NOT_OPEN */ |
95 |
|
96 |
/* NEW JNI Java Errors */
|
97 |
case 66: return new String("Class does not implement ECWProgressiveDisplay interface.");/* NCS_JNI_REFRESH_NOT_IMPLEMENTED */ |
98 |
|
99 |
/* NEW Coordinate Errors */
|
100 |
case 67: return new String("Incompatible coordinate systems"); /* NCS_INCOMPATIBLE_COORDINATE_SYSTEMS */ |
101 |
case 68: return new String("Incompatible coordinate datum types"); /* NCS_INCOMPATIBLE_COORDINATE_DATUM */ |
102 |
case 69: return new String("Incompatible coordinate projection types"); /* NCS_INCOMPATIBLE_COORDINATE_PROJECTION */ |
103 |
case 70: return new String("Incompatible coordinate units types"); /* NCS_INCOMPATIBLE_COORDINATE_UNITS */ |
104 |
case 71: return new String("Non-linear coordinate systems not supported"); /* NCS_COORDINATE_CANNOT_BE_TRANSFORMED */ |
105 |
case 72: return new String("GDT Error "); /* NCS_GDT_ERROR (reason) */ |
106 |
case 73: return new String("Zero length packet : "); /* NCS_NET_PACKET_RECV_ZERO_LENGTH (reason) */ /**[01]**/ |
107 |
case 74: return new String("Must use Japanese version of the ECW SDK"); /* NCS_UNSUPPORTEDLANGUAGE */ /**[02]**/ |
108 |
case 75: return new String("Lost of connection to server "); /* NCS_CONNECTION_LOST */ /**[03]**/ |
109 |
case 76: return new String("NCSGdt coordinate conversion failed "); /* NCS_COORD_CONVERT_ERROR */ |
110 |
case 77: return new String("Failed to open metabase "); /* NCS_METABASE_OPEN_FAILED*/ /**[04]**/ |
111 |
case 78: return new String("Failed to get value from metabase "); /* NCS_METABASE_GET_FAILED*/ /**[04]**/ |
112 |
case 79: return new String("Timeout sending header "); /* NCS_NET_HEADER_SEND_TIMEOUT*/ /**[05]**/ |
113 |
case 80: return new String("Java JNI error "); /* NCS_JNI_ERROR */ /**[06]**/ |
114 |
case 81: return new String("No data source passed"); /* NCS_DB_INVALID_NAME */ |
115 |
case 82: return new String("Could not resolve address of Image Web Server Symbol Server Extension"); /* NCS_SYMBOL_COULDNT_RESOLVE_HOST */ |
116 |
case 83: return new String("Invalid NCSError value!"); /* NCS_INVALID_ERROR_ENUM */ /**[08]**/ |
117 |
/* NCSFileIO errors [10] */
|
118 |
case 84: return new String("End Of File reached "); /* NCS_FILE_EOF [10] */ |
119 |
case 85: return new String("File not found "); /* NCS_FILE_NOT_FOUND [10] */ |
120 |
case 86: return new String("File is invalid or corrupt "); /* NCS_FILE_INVALID [10] */ |
121 |
case 87: return new String("Attempted to read, write or seek past file limits "); /* NCS_FILE_SEEK_ERROR [10] */ |
122 |
case 88: return new String("Permissions not available to access file "); /* NCS_FILE_NO_PERMISSIONS [10] */ |
123 |
case 89: return new String("File open error "); /* NCS_FILE_OPEN_ERROR [10] */ |
124 |
case 90: return new String("File close error "); /* NCS_FILE_CLOSE_ERROR [10] */ |
125 |
case 91: return new String("File IO error "); /* NCS_FILE_IO_ERROR [10] */ |
126 |
|
127 |
case 92: return new String("Illegal World Coordinates "); /* NCS_SET_EXTENTS_ERROR [13] */ |
128 |
|
129 |
case 93: return new String("Image projection doesn't match controlling layer "); /* NCS_FILE_PROJECTION_MISMATCH [14] */ |
130 |
|
131 |
/** 1.65 gdt errors [15]**/
|
132 |
case 94: return new String("Unknown map projection "); /*NCS_GDT_UNKNOWN_PROJECTION,*/ |
133 |
case 95: return new String("Unknown datum "); /*NCS_GDT_UNKNOWN_DATUM,*/ |
134 |
case 96: return new String("User specified Geographic Projection Database data server failed while loading . Please check your network connection and if the problem persists contact the website administrator."); /*NCS_GDT_USER_SERVER_FAILED*/ |
135 |
case 97: return new String("Remote Geographic Projection Database file downloading has been disable and no Geographic Projection Database data is locally available"); /*NCS_GDT_REMOTE_PATH_DISABLED*/ |
136 |
case 98: return new String("Invalid transform mode "); /*NCS_GDT_BAD_TRANSFORM_MODE, [17]**/ |
137 |
|
138 |
case 99: return new String("coordinate to be transformed is out of bounds "); /*NCS_GDT_TRANSFORM_OUT_OF_BOUNDS*/ |
139 |
|
140 |
case 100: return new String("Layer already exists with this name "); /*NCS_LAYER_DUPLICATE_LAYER_NAME*/ /**[17]**/ |
141 |
case 101: return new String("Layer does not contain this parameter "); /*NCS_LAYER_INVALID_PARAMETER*/ /**[18]**/ |
142 |
|
143 |
case 102: return new String("Failed to create pipe "); /*NCS_PIPE_CREATE_FAILED*/ /**[19]**/ |
144 |
/* Directory creation errors */
|
145 |
case 103: return new String("Directory already exists "); /*[20] NCS_FILE_MKDIR_EXISTS, Directory already exists */ |
146 |
case 104: return new String("The path was not found "); /*[20] NCS_FILE_MKDIR_PATH_NOT_FOUND, The path for the location of the new dir does not exist */ |
147 |
|
148 |
case 105: return new String("The read was cancelled"); |
149 |
case 106: return new String("Error reading georeferencing data from JPEG 2000 file "); /*[21] NCS_JP2_GEODATA_READ_ERROR*/ |
150 |
case 107: return new String("Error writing georeferencing data to JPEG 2000 file"); /*[21] NCS_JP2_GEODATA_READ_ERROR*/ |
151 |
case 108: return new String("JPEG 2000 file is not or should not be georeferenced"); /*[21] NCS_JP2_GEODATA_NOT_GEOREFERENCED*/ |
152 |
|
153 |
// Insert new errors before here!
|
154 |
case 109: return new String("Max NCSError enum value!"); /* NCS_MAX_ERROR_NUMBER */ /**[08]**/ |
155 |
|
156 |
} |
157 |
return new String(""); |
158 |
} |
159 |
|
160 |
} |