Example usage for java.net URISyntaxException printStackTrace

List of usage examples for java.net URISyntaxException printStackTrace

Introduction

In this page you can find the example usage for java.net URISyntaxException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

Prints this throwable and its backtrace to the standard error stream.

Usage

From source file:com.bbva.arq.devops.ae.mirrorgate.collectors.jira.config.Config.java

@Bean
public synchronized JiraRestClient getJiraRestClient() {
    if (restClientInstance == null) {
        URI jiraServerUri = null;
        try {/* w w w  . jav  a 2  s.  c  o  m*/
            jiraServerUri = new URI(jiraUrl);
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
        restClientInstance = new AsynchronousJiraRestClientFactory()
                .createWithBasicHttpAuthentication(jiraServerUri, jiraUserName, jiraPassword);
    }
    return restClientInstance;
}

From source file:org.rifidi.designer.library.basemodels.cardbox.CardboxEntity.java

@Override
public void init() {
    if (model == null) {
        try {/*www. j av a  2 s.co  m*/
            URI modelpath = getClass().getClassLoader()
                    .getResource("org/rifidi/designer/library/basemodels/cardbox/cardboardbox.jme").toURI();
            model = (Node) BinaryImporter.getInstance().load(modelpath.toURL());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        } catch (IOException e) {
            logger.error("Unable to load jme: " + e);
        }
    }
    DynamicPhysicsNode node = physicsSpace.createDynamicNode();
    node.setLocalTranslation(startPos);
    if (baseRotation != null) {
        node.getLocalRotation().apply(baseRotation);
    }
    node.attachChild(new SharedNode("sharedCBox_", model));
    //node.attachChild(model);
    node.generatePhysicsGeometry();
    node.setIsCollidable(true);
    node.setActive(true);
    node.setModelBound(new BoundingBox());
    node.updateModelBound();
    setNode(node);
    BinaryPattern pattern = new BinaryPattern();
    pattern.setPattern(new boolean[][] { { true, true }, { true, true } });
    setPattern(pattern);
    setCollides(false);
}

From source file:com.noah.lol.network.RequestNetwork.java

protected String syncRequestGet(String url) throws NetworkException {

    if (url == null) {
        return null;
    }//w w  w . j a v a 2s.  com

    String responseBody = null;
    HttpClient httpclient = new DefaultHttpClient();

    HttpGet httpget = null;
    try {
        httpget = new HttpGet(new URI(url));
        responseBody = httpclient.execute(httpget, responseHandler);
    } catch (URISyntaxException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

    return responseBody;
}

From source file:com.uber.jenkins.phabricator.uberalls.UberallsClient.java

public boolean recordCoverage(String sha, CodeCoverageMetrics codeCoverageMetrics) {
    if (codeCoverageMetrics != null && codeCoverageMetrics.isValid()) {
        JSONObject params = new JSONObject();
        params.put("sha", sha);
        params.put("branch", branch);
        params.put("repository", repository);
        params.put(PACKAGE_COVERAGE_KEY, codeCoverageMetrics.getPackageCoveragePercent());
        params.put(FILES_COVERAGE_KEY, codeCoverageMetrics.getFilesCoveragePercent());
        params.put(CLASSES_COVERAGE_KEY, codeCoverageMetrics.getClassesCoveragePercent());
        params.put(METHOD_COVERAGE_KEY, codeCoverageMetrics.getMethodCoveragePercent());
        params.put(LINE_COVERAGE_KEY, codeCoverageMetrics.getLineCoveragePercent());
        params.put(CONDITIONAL_COVERAGE_KEY, codeCoverageMetrics.getConditionalCoveragePercent());

        try {/*  www .  j  av a2 s .  c o  m*/
            HttpClient client = getClient();
            PostMethod request = new PostMethod(getBuilder().build().toString());
            request.addRequestHeader("Content-Type", "application/json");
            StringRequestEntity requestEntity = new StringRequestEntity(params.toString(),
                    ContentType.APPLICATION_JSON.toString(), "UTF-8");
            request.setRequestEntity(requestEntity);
            int statusCode = client.executeMethod(request);

            if (statusCode != HttpStatus.SC_OK) {
                logger.info(TAG, "Call failed: " + request.getStatusLine());
                return false;
            }
            return true;
        } catch (URISyntaxException e) {
            e.printStackTrace();
        } catch (HttpResponseException e) {
            // e.g. 404, pass
            logger.info(TAG, "HTTP Response error recording metrics: " + e);
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    return false;
}

From source file:com.heliosdecompiler.helios.controller.UpdateController.java

public File getHeliosLocation() {
    ProtectionDomain pd = getClass().getProtectionDomain();
    if (pd != null) {
        CodeSource cs = pd.getCodeSource();
        if (cs != null) {
            URL location = cs.getLocation();
            if (location != null) {
                try {
                    File file = new File(location.toURI().getPath());
                    if (file.isFile()) {
                        return file;
                    }//  ww  w .  ja  v a2  s  .co m
                } catch (URISyntaxException e) {
                    e.printStackTrace();
                    return null;
                }
            }
        }
    }
    return null;
}

From source file:com.recomdata.transmart.data.export.util.ExportImageProcessor.java

public void getImages(List<String> imageURIs) {
    for (String imageURI : imageURIs) {
        try {/*w  w w  . jav a  2  s.c om*/
            getImageFromURI(imageURI, null);
        } catch (URISyntaxException e) {
            System.out.println("Invalid URI for image :: " + imageURI);
            e.printStackTrace();
        }
    }
}

From source file:info.rmapproject.core.model.impl.openrdf.ORMapEventDeletionTest.java

/**
 * Test method for {@link info.rmapproject.core.model.impl.openrdf.ORMapEventDeletion#ORMapEventDeletion(info.rmapproject.core.model.RMapIri, info.rmapproject.core.model.event.RMapEventTargetType, info.rmapproject.core.model.RMapValue)}.
 * @throws RMapDefectiveArgumentException 
 * @throws RMapException /*  w  w  w.j  a  v  a  2 s .  c  o m*/
 */
@Test
public void testORMapEventDeletionRMapIriRMapEventTargetTypeRMapValue()
        throws RMapException, RMapDefectiveArgumentException {
    List<java.net.URI> resourceList = new ArrayList<java.net.URI>();
    try {
        IRI creatorIRI = vf.createIRI("http://orcid.org/0000-0003-2069-1219");
        resourceList.add(new java.net.URI("http://rmap-info.org"));
        resourceList.add(new java.net.URI("https://rmap-project.atlassian.net/wiki/display/RMAPPS/RMap+Wiki"));
        RMapIri associatedAgent = ORAdapter.openRdfIri2RMapIri(creatorIRI);
        RMapLiteral desc = new RMapLiteral("this is a deletion event");

        ORMapDiSCO disco = new ORMapDiSCO(associatedAgent, resourceList);

        RMapRequestAgent requestAgent = new RMapRequestAgent(associatedAgent.getIri(),
                new java.net.URI("ark:/29297/testkey"));
        ORMapEventDeletion event = new ORMapEventDeletion(requestAgent, RMapEventTargetType.DISCO, desc);
        RMapIri discoId = ORAdapter.openRdfIri2RMapIri(disco.getDiscoContext());
        List<RMapIri> deleted = new ArrayList<RMapIri>();
        deleted.add(discoId);
        event.setDeletedObjectIds(deleted);
        Date end = new Date();
        event.setEndTime(end);
        Model eventModel = event.getAsModel();
        assertEquals(9, eventModel.size());
        IRI context = event.getContext();
        for (Statement stmt : eventModel) {
            assertEquals(context, stmt.getContext());
        }
        assertEquals(RMapEventType.DELETION, event.getEventType());
        assertEquals(RMapEventTargetType.DISCO, event.getEventTargetType());
    } catch (URISyntaxException e) {
        e.printStackTrace();
        fail(e.getMessage());
    }
}

From source file:org.bibsonomy.webapp.controller.admin.AdminSyncViewController.java

private URI uriFromString(final String uriString) {
    if (present(uriString) && uriString.length() > 0) {
        try {/*from  w w  w  .j av a2s.c o m*/
            return new URI(uriString);
        } catch (final URISyntaxException ex) {
            log.error("URI is malformed");
            ex.printStackTrace();
        }
    }
    log.error("URI is empty");
    return null;
}

From source file:org.apache.streams.monitoring.tasks.BroadcastMonitorThread.java

/**
 * Go through streams config and set the broadcastURI (if present)
 *//*from  w ww .  j a  v a  2  s .c  o m*/
private void setBroadcastURI() {
    if (streamConfig != null && streamConfig.containsKey("broadcastURI")
            && streamConfig.get("broadcastURI") != null && streamConfig.get("broadcastURI") instanceof String) {
        try {
            broadcastURI = new URI(streamConfig.get("broadcastURI").toString());
        } catch (URISyntaxException e) {
            e.printStackTrace();
        }
    }
}

From source file:org.apache.archiva.repository.features.IndexCreationFeature.java

public IndexCreationFeature(boolean skipPackedIndexCreation) {
    this.skipPackedIndexCreation = skipPackedIndexCreation;
    try {//www.  ja v a 2 s. co m
        this.indexPath = new URI(DEFAULT_INDEX_PATH);
        this.packedIndexPath = new URI(DEFAULT_PACKED_INDEX_PATH);
    } catch (URISyntaxException e) {
        // Does not happen
        e.printStackTrace();
    }
}