List of usage examples for java.net URISyntaxException printStackTrace
public void printStackTrace()
From source file:ezbake.azkaban.manager.ExecutionManager.java
/** * Class for executing a flow in Azkaban * * @param sessionId The session ID of an already connected session * @param azkabanUri The Azkaban URL// w w w. j av a 2 s .com */ public ExecutionManager(String sessionId, URI azkabanUri) { try { this.executionUri = new URIBuilder(azkabanUri).setPath("/executor").build(); } catch (URISyntaxException e) { e.printStackTrace(); } this.sessionId = sessionId; }
From source file:com.subgraph.vega.impl.scanner.handlers.DirIPSCheck.java
private HttpUriRequest createRequest(IPathState ps, String query) { final URI baseUri = ps.getPath().getUri(); try {/*w ww . jav a 2 s .co m*/ final URI newUri = new URI(baseUri.getScheme(), baseUri.getAuthority(), baseUri.getPath(), query, null); return new HttpGet(newUri); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } }
From source file:org.megam.deccanplato.provider.box.handler.FolderImpl.java
/** * @return//from ww w. ja v a2 s.c o m */ private Map<String, String> retrive() { Map<String, String> outMap = new HashMap<>(); final String BOX_RETRIVE = "/folders/" + args.get(FOLDER_ID) + "/items"; Map<String, String> headerMap = new HashMap<String, String>(); headerMap.put("Authorization", "BoxAuth api_key=" + args.get(API_KEY) + "&auth_token=" + args.get(TOKEN)); Map<String, String> boxList = new HashMap<>(); boxList.put("limit", args.get(LIMIT)); boxList.put("offset", args.get(OFFSET)); TransportTools tools = new TransportTools(BOX_URI + BOX_RETRIVE, null, headerMap); Gson obj = new GsonBuilder().setPrettyPrinting().create(); tools.setContentType(ContentType.APPLICATION_JSON, obj.toJson(boxList)); String responseBody = ""; TransportResponse response = null; try { response = TransportMachinery.get(tools); responseBody = response.entityToString(); System.out.println("OUTPUT:" + responseBody); } catch (ClientProtocolException ce) { ce.printStackTrace(); } catch (IOException ioe) { ioe.printStackTrace(); } catch (URISyntaxException e) { e.printStackTrace(); } outMap.put(OUTPUT, responseBody); return outMap; }
From source file:com.gondor.config.ApplicationContextConfig.java
@Override protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) { super.configureRepositoryRestConfiguration(config); try {/* ww w . j a v a2s . c o m*/ config.setBaseUri(new URI("/api")); } catch (URISyntaxException e) { e.printStackTrace(); } }
From source file:com.brightcove.com.uploader.verifier.RetrieveJSONNodeHelper.java
private void retriveRootNode() throws MediaAPIError { try {//ww w . j a v a 2 s. co m rootJsonNode = mMediaAPIHelper.executeRead(envInfo, parameter); } catch (URISyntaxException uriSyntaxException) { uriSyntaxException.printStackTrace(); } }
From source file:ezbake.azkaban.manager.ExecutionManager.java
/** * Class for executing a flow in Azkaban * * @param azkabanUri The Azkaban URL//from w w w .ja va 2 s . c o m * @param username The username to use * @param password The password for the username */ public ExecutionManager(URI azkabanUri, String username, String password) { try { this.executionUri = new URIBuilder(azkabanUri).setPath("/executor").build(); } catch (URISyntaxException e) { e.printStackTrace(); } final AuthenticationManager azkabanAuthenticator = new AuthenticationManager(azkabanUri, username, password); final AuthenticationResult result = azkabanAuthenticator.login(); if (result.hasError()) { throw new IllegalStateException(result.getError()); } this.sessionId = result.getSessionId(); }
From source file:org.deviceconnect.android.uiapp.fragment.profile.VibrationProfileFragment.java
/** * Vibration???./* w w w . j av a 2 s .co m*/ * @param pattern ? */ private void sendVibration(final CharSequence pattern) { (new AsyncTask<Void, Void, DConnectMessage>() { public DConnectMessage doInBackground(final Void... args) { String p = null; if (pattern != null && pattern.length() > 0) { p = pattern.toString(); } try { URIBuilder builder = new URIBuilder(); builder.setProfile(VibrationProfileConstants.PROFILE_NAME); builder.setAttribute(VibrationProfileConstants.ATTRIBUTE_VIBRATE); builder.addParameter(DConnectMessage.EXTRA_DEVICE_ID, getSmartDevice().getId()); if (p != null) { builder.addParameter(VibrationProfileConstants.PARAM_PATTERN, p); } builder.addParameter(DConnectMessage.EXTRA_ACCESS_TOKEN, getAccessToken()); HttpResponse response = getDConnectClient().execute(getDefaultHost(), new HttpPut(builder.build())); return (new HttpMessageFactory()).newDConnectMessage(response); } catch (URISyntaxException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return null; } @Override protected void onPostExecute(final DConnectMessage result) { if (getActivity().isFinishing()) { return; } TextView tv = (TextView) getView().findViewById(R.id.fragment_vibration_result); if (result == null) { tv.setText("failed"); } else { tv.setText(result.toString()); } } }).execute(); }
From source file:ezbake.azkaban.manager.ProjectManager.java
/** * Manages Azkaban projects/* ww w .j av a 2 s. c o m*/ * * @param azkabanUri The URL of the Azkaban server * @param username The username for the project * @param password The password for the project */ public ProjectManager(URI azkabanUri, String username, String password) { this.azkabanUri = azkabanUri; try { this.managerUri = new URIBuilder(azkabanUri).setPath("/manager").build(); } catch (URISyntaxException e) { e.printStackTrace(); } this.sessionId = new AuthenticationManager(azkabanUri, username, password).login().getSessionId(); }
From source file:ezbake.azkaban.manager.ProjectManager.java
/** * Manages Azkaban projects/* w ww.jav a2 s .c o m*/ * * @param sessionId The sessionId of the logged in Azkaban user * @param azkabanUri The URL of the Azkaban server */ public ProjectManager(String sessionId, URI azkabanUri) { this.azkabanUri = azkabanUri; try { this.managerUri = new URIBuilder(azkabanUri).setPath("/manager").build(); } catch (URISyntaxException e) { e.printStackTrace(); } this.sessionId = sessionId; }
From source file:com.bluexml.side.Framework.alfresco.hotdeployer.WorkflowHotDeployWebScript.java
public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException { // get process definition file String parameter = req.getParameter("filepath"); if (logger.isDebugEnabled()) { logger.debug("workflowhot deployer called for :" + parameter); }/*from ww w . ja v a 2s.com*/ File file = null; try { file = new File(new URI(parameter)); } catch (URISyntaxException e) { e.printStackTrace(); throw new IOException("Error when trying to parse String to URI :" + parameter); } FileInputStream fis = new FileInputStream(file); String result = ""; String workflowName = null; //TODO need to open the XMLDocument to read process name if (workflowName != null) { // undeploy all instance and workflow definition for the given workflow name List<WorkflowDefinition> defs = workflowService.getAllDefinitionsByName(workflowName); for (WorkflowDefinition def : defs) { workflowService.undeployDefinition(def.id); } } result = deploy(fis, result); String response = "<res>"; response += result; response += "</res>"; // response res.setContentType("text/xml"); String contentEncoding = "UTF-8"; res.setContentEncoding(contentEncoding); OutputStream outputStream = res.getOutputStream(); byte[] bytes = response.getBytes("UTF-8"); if (logger.isDebugEnabled()) { logger.debug("result :" + response); } outputStream.write(bytes); outputStream.close(); fis.close(); }