List of usage examples for java.net URISyntaxException printStackTrace
public void printStackTrace()
From source file:org.gege.caldavsyncadapter.caldav.CaldavFacade.java
public static boolean getEvent(CalendarEvent calendarEvent) throws ClientProtocolException, IOException { boolean Result = false; HttpReport request = null;//from w w w . j a va 2 s .c om //HINT: bugfix for google calendar String data = XML_VERSION + "<C:calendar-multiget xmlns:D=\"DAV:\" xmlns:C=\"urn:ietf:params:xml:ns:caldav\">" + "<D:prop>" + "<D:getetag/>" + "<C:calendar-data/>" + "</D:prop>" + "<D:href>" + calendarEvent.getUri().getPath().replace("@", "%40") + "</D:href>" + "</C:calendar-multiget>"; URI calendarURI = null; try { calendarURI = calendarEvent.calendarURL.toURI(); } catch (URISyntaxException e) { e.printStackTrace(); } //request = createReportRequest(calendarEvent.getUri(), data, 1); request = createReportRequest(calendarURI, data, 1); HttpResponse response = httpClient.execute(targetHost, request); BufferedReader reader = new BufferedReader( new InputStreamReader(response.getEntity().getContent(), "UTF-8")); String line; String body = ""; do { line = reader.readLine(); if (line != null) body += line + "\n"; } while (line != null); if (calendarEvent.setICSasMultiStatus(body)) Result = true; return Result; }
From source file:com.ny.apps.executor.TencentWeiboOAuth2.java
private URI prepareGetUrl() { URI uri = null;/*ww w . j a va2s .co m*/ List<NameValuePair> nvps = new ArrayList<NameValuePair>(); NameValuePair clientId = new BasicNameValuePair("client_id", APPKEY); NameValuePair responseType = new BasicNameValuePair("response_type", "code"); NameValuePair redirectURI = new BasicNameValuePair("redirect_uri", "http://www.smiletony.com"); nvps.add(clientId); nvps.add(responseType); nvps.add(redirectURI); URIBuilder uriBuilder; try { uriBuilder = new URIBuilder("https://open.t.qq.com/cgi-bin/oauth2/authorize"); uriBuilder.addParameters(nvps); uri = uriBuilder.build(); } catch (URISyntaxException e) { e.printStackTrace(); } return uri; }
From source file:org.mcxiaoke.commons.http.util.URIUtilsEx.java
/** * URLQuery??/*from w w w.java 2s . c o m*/ * * @param url * @param parameters * @return */ public static String appendQueryParameters(String url, final Collection<? extends NameValuePair> parameters) { try { URIBuilderEx builder = new URIBuilderEx(url); builder.addParameters(parameters); return builder.build().toString(); } catch (URISyntaxException e) { e.printStackTrace(); } return null; }
From source file:org.mcxiaoke.commons.http.util.URIUtilsEx.java
/** * URLQuery??/* w w w .j av a 2 s . co m*/ * * @param url * @param parameters * @return */ public static String appendQueryParameters(String url, final Map<String, String> parameters) { try { URIBuilderEx builder = new URIBuilderEx(url); builder.addParameters(parameters); return builder.build().toString(); } catch (URISyntaxException e) { e.printStackTrace(); } return null; }
From source file:org.mcxiaoke.commons.http.util.URIUtilsEx.java
/** * URL???Query?/*from ww w . j ava 2s . c om*/ * * @param url * @param encoding * @return */ public static List<NameValuePair> getQueryParameters(String url, final String encoding) { if (StringUtils.isEmpty(url)) { return null; } try { return parse(new URI(url), encoding); } catch (URISyntaxException e) { e.printStackTrace(); } return null; }
From source file:org.mcxiaoke.commons.http.util.URIUtilsEx.java
/** * URL???Query?/*from ww w . j av a 2 s . co m*/ * * @param url * @param encoding * @return */ public static Map<String, String> getQueryParameters2(String url, final String encoding) { if (StringUtils.isEmpty(url)) { return null; } try { return parse2(new URI(url), encoding); } catch (URISyntaxException e) { e.printStackTrace(); } return null; }
From source file:org.restcomm.connect.java.sdk.http.Request.java
public Request(HttpMethod method, String Url) { this.Url = Url; this.method = method; this.QueryParameters = new ArrayList<NameValuePair>(); this.PostParameters = new ArrayList<NameValuePair>(); try {//from w ww . j a va 2 s . co m this.Url = new URL(new URIBuilder(Url).build().toString()).toString(); } catch (URISyntaxException e) { e.printStackTrace(); } catch (MalformedURLException e) { e.printStackTrace(); } }
From source file:elaborate.editor.model.orm.service.ReindexStatus.java
public URI getURI() { try {/*ww w. j a va2s .c om*/ return new URIBuilder().build(); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } }
From source file:org.gatherdata.alert.notify.mail.internal.MailtoUrl.java
public String getScheme() { try {/* w w w. j a v a 2s. c o m*/ return internalUrl.toURI().getScheme(); } catch (URISyntaxException e) { e.printStackTrace(); } return ""; }
From source file:org.dhara.portal.web.northToAiravataConnector.WorkflowExecutionServlet.java
@RequestMapping(value = { "/connect/ExecutionServlet", "/connect/ExecutionServlet/" }, method = RequestMethod.GET) protected void doGet(HttpServletRequest request, HttpServletResponse response) throws javax.servlet.ServletException, IOException { PrintWriter pw = response.getWriter(); String workflowId = request.getParameter("workflowId"); try {/* w w w.j av a2s . c o m*/ ApplicationContext context = WebApplicationContextUtils .getRequiredWebApplicationContext(getServletContext()); AiravataClientAPIService airavataClientAPIService = (AiravataClientAPIService) context .getBean("airavataAPIService"); Map<String, Object> inputs = new HashMap<String, Object>(); Workflow workflow = airavataClientAPIService.getWorkflow(workflowId); for (WorkflowInput workflowInput : workflow.getWorkflowInputs()) { inputs.put(workflowInput.getName(), request.getParameter(workflowInput.getName())); } outputs = airavataClientAPIService.executeWorkflow(inputs, workflowId); // _52NorthExecuteWorkFlowTest JSONObject jsonObject = new JSONObject(outputs); PrintWriter printWriter = response.getWriter(); printWriter.write(jsonObject.toJSONString()); } catch (URISyntaxException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } }