Subversion Repositories SmartDukaan

Rev

Rev 4421 | Rev 6491 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4421 Rev 5364
Line 7... Line 7...
7
import java.io.BufferedReader;
7
import java.io.BufferedReader;
8
import java.io.DataOutputStream;
8
import java.io.DataOutputStream;
9
import java.io.IOException;
9
import java.io.IOException;
10
import java.io.InputStreamReader;
10
import java.io.InputStreamReader;
11
import java.io.StringReader;
11
import java.io.StringReader;
-
 
12
import java.net.ConnectException;
12
import java.net.MalformedURLException;
13
import java.net.MalformedURLException;
13
import java.net.URL;
14
import java.net.URL;
14
import java.net.URLConnection;
15
import java.net.URLConnection;
15
import java.net.URLEncoder;
16
import java.net.URLEncoder;
16
import java.util.HashMap;
17
import java.util.HashMap;
Line 139... Line 140...
139
 
140
 
140
		    // Get response data.
141
		    // Get response data.
141
		    reader = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
142
		    reader = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));
142
		    resultMap = parseCaptureOutput(reader);
143
		    resultMap = parseCaptureOutput(reader);
143
		    reader.close ();
144
		    reader.close ();
-
 
145
	    }
-
 
146
	    catch(ConnectException e) {
-
 
147
            log.error("Unable to initialize connection to EBS API server", e);
-
 
148
            resultMap.put(ERR_CODE, Errors.CONN_FAILURE.code);
-
 
149
            resultMap.put(ERROR, Errors.CONN_FAILURE.message);
-
 
150
            return resultMap;
-
 
151
        } 
144
	    } catch (IOException e) {
152
	    catch (IOException e) {
145
	    	log.error(Errors.CAPTURE_FAILURE.message, e);
153
	    	log.error(Errors.CAPTURE_FAILURE.message, e);
146
			resultMap.clear();
154
			resultMap.clear();
147
			resultMap.put(STATUS, "");
155
			resultMap.put(STATUS, "");
148
			resultMap.put(ERR_CODE, Errors.CAPTURE_FAILURE.code);
156
			resultMap.put(ERR_CODE, Errors.CAPTURE_FAILURE.code);
149
			resultMap.put(ERROR, Errors.CAPTURE_FAILURE.message);
157
			resultMap.put(ERROR, Errors.CAPTURE_FAILURE.message);
150
		}
158
		}
-
 
159
	    
151
	    return resultMap;
160
	    return resultMap;
152
	}
161
	}
153
 
162
 
154
	/**
163
	/**
155
	 * Parses the given input stream and returns a map containing the
164
	 * Parses the given input stream and returns a map containing the