Example usage for java.io IOException toString

List of usage examples for java.io IOException toString

Introduction

In this page you can find the example usage for java.io IOException toString.

Prototype

public String toString() 

Source Link

Document

Returns a short description of this throwable.

Usage

From source file:org.callimachusproject.client.HttpUriClient.java

@Override
public HttpParams getParams() {
    try {//  w ww  .j av  a 2  s  .co m
        return getDelegate().getParams();
    } catch (IOException e) {
        logger.error(e.toString(), e);
        return null;
    }
}

From source file:org.callimachusproject.client.HttpUriClient.java

@Override
public ClientConnectionManager getConnectionManager() {
    try {//from ww  w  .  ja  v  a2  s  .c om
        return getDelegate().getConnectionManager();
    } catch (IOException e) {
        logger.error(e.toString(), e);
        return null;
    }
}

From source file:com.streamsets.lib.security.http.PlainSSOTokenParser.java

@SuppressWarnings("unchecked")
protected SSOUserPrincipal parsePrincipal(String tokenStr, String dataB64) throws IOException {
    SSOUserPrincipalJson principal = null;
    try {/*w w  w  . j a  va 2 s  .c  o  m*/
        byte[] data = Base64.decodeBase64(dataB64);
        principal = OBJECT_MAPPER.readValue(data, SSOUserPrincipalJson.class);
        principal.setTokenStr(tokenStr);
        principal.lock();
    } catch (IOException ex) {
        LOG.warn("Could not parse principal payload: {}", ex.toString(), ex);
    }
    return principal;
}

From source file:com.nubits.nubot.tests.TestRPC.java

private void setup(String exchangeName, String custodianAddress, CurrencyPair pair, String user, String pass) {
    String folderName = "tests_" + System.currentTimeMillis() + "/";
    String logsFolder = Global.settings.getProperty("log_path") + folderName;
    //Create log dir
    FileSystem.mkdir(logsFolder);
    try {/*w w w.  j  a  v  a 2s  .  co m*/
        NuLogger.setup(verbose, logsFolder);
    } catch (IOException ex) {
        LOG.severe(ex.toString());
    }

    System.setProperty("javax.net.ssl.trustStore", Global.settings.getProperty("keystore_path"));
    System.setProperty("javax.net.ssl.trustStorePassword", Global.settings.getProperty("keystore_pass"));

    Global.publicAddress = custodianAddress;

    //Create the client
    Global.rpcClient = new NuRPCClient(ipTest, portTest, user, pass, verbose, useIdentifier, custodianAddress,
            pair, exchangeName);
}

From source file:ws.util.AbstractJSONCoder.java

@Override
public T decode(String json) throws DecodeException {
    //            logger.log(Level.INFO, new StringBuilder()
    //                  .append("[coder] decoding.. ")
    //                  .append(json)
    //                  .toString());
    try {//from  ww  w .  ja va2  s. c  o m
        // TODO: ?????Jacson Jr????Jr??????
        T pojo = JSON.std.beanFrom(type, json);
        //                  logger.log(Level.INFO, new StringBuilder()
        //                        .append("[coder] done ")
        //                        .append(message)
        //                        .toString());
        return pojo;
    } catch (IOException e) {
        logger.log(Level.SEVERE, e.toString());
        throw new DecodeException(json, e.getMessage());
    }
}

From source file:com.photon.phresco.nativeapp.unit.test.testcases.B_CategoryListActivityTest.java

/**
 *  get the category list//  w w w  .  ja v  a 2 s  .  c  om
 *  from web server
 *
 */
@Test
public final void testCategoryList() {

    Category category = new Category();
    try {
        PhrescoLogger.info(TAG + " testCategory -------------- START ");

        JSONObject categoryJSONObj = category.getCategoryJSONObject(
                Constants.getWebContextURL() + Constants.getRestAPI() + Constants.CATEGORIES_URL);
        assertNotNull(categoryJSONObj);
        JSONArray categoryArray = categoryJSONObj.getJSONArray("category");
        assertTrue("Categories available", categoryArray.length() > 0);

        PhrescoLogger.info(TAG + " testCategory -------------- END ");
    } catch (IOException ex) {
        PhrescoLogger.info(TAG + "testCategory - IOException: " + ex.toString());
        PhrescoLogger.warning(ex);
    } catch (JSONException ex) {
        PhrescoLogger.info(TAG + "testCategory - JSONException: " + ex.toString());
        PhrescoLogger.warning(ex);
    }
}

From source file:org.jahia.test.services.modulemanager.ModuleManagerDeploymentTest.java

@Test
public void testInstallArticle() throws RepositoryException {
    try {//from  w  w  w .j a v a 2 s.co m
        File tmpFile = File.createTempFile("module", ".jar");
        InputStream stream = managerService.getTemplatePackageById("jahia-test-module")
                .getResource("dummy1-1.0.jar").getInputStream();
        FileUtils.copyInputStreamToFile(ModuleUtils.addModuleDependencies(stream), tmpFile);
        getModuleManager().install(new FileSystemResource(tmpFile), "");
        tmpFile.delete();
    } catch (IOException e) {
        fail(e.toString());
    }

    try {
        Thread.sleep(5000);
    } catch (InterruptedException e) {

    }
    assertTrue(managerService.getTemplatePackageRegistry().getAvailableVersionsForModule("dummy1")
            .contains(new ModuleVersion("1.0")));

}

From source file:kr.co.bitnine.octopus.util.VersionInfo.java

private VersionInfo(String component) {
    info = new Properties();
    String versionInfoFile = component + "-version-info.properties";
    InputStream is = null;// www.  j a  va  2  s.c o m
    try {
        is = Thread.currentThread().getContextClassLoader().getResourceAsStream(versionInfoFile);
        if (is == null)
            throw new IOException("Resource not found");
        info.load(is);
    } catch (IOException e) {
        LOG.warn("Could not read '" + versionInfoFile + "', " + e.toString(), e);
    } finally {
        IOUtils.closeStream(is);
    }
}

From source file:org.jfree.chart.demo.ImageMapDemo6.java

/**
 * Saves the chart image and HTML.//  ww  w.j  a  v  a2  s .  c  om
 */
public void saveImageAndHTML() {

    final CategoryDataset dataset = createDataset();
    final JFreeChart chart = createChart(dataset);

    // ****************************************************************************
    // * JFREECHART DEVELOPER GUIDE                                               *
    // * The JFreeChart Developer Guide, written by David Gilbert, is available   *
    // * to purchase from Object Refinery Limited:                                *
    // *                                                                          *
    // * http://www.object-refinery.com/jfreechart/guide.html                     *
    // *                                                                          *
    // * Sales are used to provide funding for the JFreeChart project - please    * 
    // * support us so that we can continue developing free software.             *
    // ****************************************************************************

    // save it to an image
    try {
        final ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
        final File file1 = new File("multipiechart100.png");
        ChartUtilities.saveChartAsPNG(file1, chart, 600, 400, info);

        // write an HTML page incorporating the image with an image map
        final File file2 = new File("multipiechart100.html");
        final OutputStream out = new BufferedOutputStream(new FileOutputStream(file2));
        final PrintWriter writer = new PrintWriter(out);
        writer.println("<HTML>");
        writer.println("<HEAD><TITLE>JFreeChart Image Map Demo</TITLE></HEAD>");
        writer.println("<BODY>");
        //            ChartUtilities.writeImageMap(writer, "chart", info);
        writer.println("<IMG SRC=\"multipiechart100.png\" "
                + "WIDTH=\"600\" HEIGHT=\"400\" BORDER=\"0\" USEMAP=\"#chart\">");
        writer.println("</BODY>");
        writer.println("</HTML>");
        writer.close();

    } catch (IOException e) {
        System.out.println(e.toString());
    }
}

From source file:com.nubits.nubot.NTP.NTPClient.java

public Date getTime(String host) {
    try {//  w w  w . j  av  a2 s. c  om
        return getTimeImpl(host);
    } catch (IOException ex) {
        LOG.severe("Cannot read the date from the time server " + host + "\n" + ex.toString());
        return new Date();
    }
}