List of usage examples for java.net URISyntaxException printStackTrace
public void printStackTrace()
From source file:alfreso.hadoop.store.hadoop_store.store.HadoopDownload.java
private String generateDownloadLink(String filePath) { URI uri;//from www. j a v a 2s. co m String name = ""; try { uri = new URI(filePath); String[] segments = uri.getPath().split("/"); name = segments[segments.length - 1]; } catch (URISyntaxException e) { e.printStackTrace(); } //TODO: fix build set up and delete this return TEMP_DIR + name; /* * TODO: fix build set up and uncomment this if(HD.copyToLocal(filePath, (TEMP_DIR+name))) { return "<a href=\"" + filePath + "\">" + filePath + "</a>"; } return "ERROR - retrieval failed"; */ }
From source file:com.onedrive.api.resource.support.AsyncOperationStatus.java
public void delete() { try {//from www. j a v a2s . c o m URI uri = new URI(getMonitorUrl()); getOneDrive().getRestTemplate().delete(uri); } catch (URISyntaxException e) { e.printStackTrace(); } }
From source file:com.mark.SimpleApp.SimpleAsyncTask.java
private String getHttp() { // some basic code to do an HttpGet call String body = null;//w w w. j a va 2 s.com Header[] headers; HttpClient httpClient = new DefaultHttpClient(); try { HttpGet get = new HttpGet(new URI("http://www.appnexus.com")); HttpResponse response = httpClient.execute(get); headers = response.getAllHeaders(); body = EntityUtils.toString(response.getEntity()); } catch (URISyntaxException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } finally { httpClient.getConnectionManager().shutdown(); } return body; }
From source file:com.onedrive.api.resource.support.AsyncOperationStatus.java
public AsyncOperationStatus status() { Assert.notNull(monitorUrl, "[monitorUrl] is required"); URI uri = null;//from w w w .j a v a 2 s . c om try { uri = new URI(monitorUrl); } catch (URISyntaxException e) { e.printStackTrace(); } ResponseEntity<AsyncOperationStatus> response = getOneDrive().getRestTemplate().exchange(uri, HttpMethod.GET, null, AsyncOperationStatus.class); AsyncOperationStatus monitor = response.getBody(); if (monitor == null) { monitor = new AsyncOperationStatus(getOneDrive()); } monitor.setMonitorUrl(monitorUrl); return monitor; }
From source file:org.kalypsodeegree_impl.gml.binding.commons.Image.java
public URI getUri() { try {//from w w w . j a va 2 s . com final String uriString = getProperty(PROPERTY_URI, String.class); if (StringUtils.isBlank(uriString)) return null; return URIUtil.fromString(uriString); } catch (final URISyntaxException e) { e.printStackTrace(); return null; } }
From source file:org.apache.wink.test.mock.SpringAwareTestCase.java
/** * @return application context path, override to change the application * context path construction/*from w w w . j av a2s. c o m*/ */ private String getApplicationContextPath() { ArrayList<String> contextList = new ArrayList<String>(); List<String> additionalContextNames = getAdditionalContextNames(); if (!additionalContextNames.isEmpty()) { contextList.addAll(additionalContextNames); } try { String classPathName = getPackagePath() + File.separator + getClass().getSimpleName() + "Context.xml"; URL resource = getClass().getClassLoader().getResource(classPathName); if (resource != null) { File file = new File(resource.toURI()); if (file.isFile()) { contextList.add(classPathName); } } } catch (URISyntaxException e) { e.printStackTrace(); } StringBuilder buf = new StringBuilder(contextList.get(0)); for (int i = 1; i < contextList.size(); ++i) { buf.append(','); buf.append(contextList.get(i)); } return buf.toString(); }
From source file:com.subgraph.vega.impl.scanner.handlers.DirParentCheck.java
private HttpUriRequest createRequest(IWebPath path) { final IWebPath parent = path.getParentPath(); String basePath = parent.getParentPath().getFullPath(); String newPath = basePath + "foo/" + path.getPathComponent(); final URI originalUri = path.getUri(); try {//www . j a va2 s . c om final URI newUri = new URI(originalUri.getScheme(), originalUri.getAuthority(), newPath, null, null); return new HttpGet(newUri); } catch (URISyntaxException e) { // TODO Auto-generated catch block e.printStackTrace(); return null; } }
From source file:com.twosigma.beakerx.inspect.Inspect.java
private File getInspectFile() { Path workingDirectory = null; try {/* w w w . j a v a2s . c om*/ workingDirectory = Paths .get(BeakerxWidget.class.getProtectionDomain().getCodeSource().getLocation().toURI()) .getParent().getParent(); } catch (URISyntaxException e) { e.printStackTrace(); } return new File(workingDirectory.toFile(), inspectDataPath); }
From source file:nl.esciencecenter.octopus.webservice.mac.MacCredentialTest.java
@Before public void setup() { try {/*from w w w .j a v a2 s. c om*/ cred = new MacCredential("id", "key", new URI("http://localhost")); } catch (URISyntaxException e) { e.printStackTrace(); } }
From source file:com.vnet.demo.service.AzureStorgeService.java
/** * check file is exsit in azure storgae contain * * @param id/*from ww w . j a va 2 s. co m*/ * @return */ public boolean checkFileExist(Long id) { Storage storage = storageDao.findById(id); try { if (storage.getIsPub()) { CloudBlockBlob blob = storageSessionFactory.getPubContainer() .getBlockBlobReference(storage.getPath()); return blob.exists(); } else { CloudBlockBlob blob = storageSessionFactory.getPrivateContainer() .getBlockBlobReference(storage.getPath()); return blob.exists(); } } catch (URISyntaxException e) { e.printStackTrace(); } catch (StorageException e) { e.printStackTrace(); } return false; }