Example usage for java.util InvalidPropertiesFormatException printStackTrace

List of usage examples for java.util InvalidPropertiesFormatException printStackTrace

Introduction

In this page you can find the example usage for java.util InvalidPropertiesFormatException printStackTrace.

Prototype

public void printStackTrace() 

Source Link

Document

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

Usage

From source file:com.wallabystreet.kinjo.common.transport.protocol.jxta.JXTAPeer.java

/**
 * /*from  ww w . ja  v  a  2 s  . c  om*/
 */
protected JXTAPeer() {
    File f = null;
    try {
        super.loadProperties(f);
    } catch (InvalidPropertiesFormatException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    this.serviceHandlers = new HashMap<ServiceDescriptor, ServiceHandler>();
    this.initialize();
    /*
     * XXX: At the moment, this class is not configurable. Therefore, the
     * peer group in which this JXTAPeer runs is never put into the AbstractPeer
     * class' property list.
     * 
     * However, since other classes depend on this, we have to force the
     * value into the Properties object, which -- of course -- is bad style.
     */
    super.getProperties().put("jxta.peerGroup", this.group);
}

From source file:com.wallabystreet.kinjo.common.transport.protocol.jxta.Peer.java

/**
 * /*  www  .j  av a 2 s. c  o m*/
 */
protected Peer() {
    File f = null;
    try {
        super.loadProperties(f);
    } catch (InvalidPropertiesFormatException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (FileNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
    this.serviceHandlers = new HashMap<ServiceDescriptor, JXTAServiceHandler>();
    this.initialize();
    /*
     * XXX: At the moment, this class is not configurable. Therefore, the
     * peer group in which this JXTAPeer runs is never put into the
     * AbstractPeer class' property list.
     * 
     * However, since other classes depend on this, we have to force the
     * value into the Properties object, which -- of course -- is bad style.
     */
    super.getProperties().put("jxta.peerGroup", this.group);
}

From source file:org.kalypso.commons.patternreplace.TemplateDomLoader.java

/**
 * TODO: check if this is really a good idea. Try to read the chart as properties file that describes the real chart
 * location + the replacement properties.
 *//*w ww  .  j  a  va  2  s . com*/
private String readAsProperties() throws CoreException {
    InputStream inputStream = null;
    try {
        inputStream = openStream();
        m_templateProperties.loadFromXML(inputStream);

        // OK, it WAS a properties file -> load the real .kod and search/replace all tokens

        /* Resolve url and read file into string */
        final String templateUriProp = m_templateProperties.getProperty(PROP_TEMPLATE_URI);
        final URL context = asUrl();

        m_realTemplateLocation = new URL(context, templateUriProp);
        final IFile realFile = ResourceUtilities.findFileFromURL(m_realTemplateLocation);
        m_templateCharset = realFile.getCharset();
        return FileUtilities.toString(realFile);
    } catch (final InvalidPropertiesFormatException e) {
        // ignore: it is not a properties file -> proceed to load normally
        // TODO: we should keep the exception, in case that we also cannot load the chart normally, maybe it was a bad
        // properties file
        return null;
    } catch (final Exception e) {
        e.printStackTrace();
        throw new CoreException(new Status(IStatus.ERROR, KalypsoCommonsPlugin.getID(),
                Messages.getString("TemplateDomLoader_3"), e)); //$NON-NLS-1$
    } finally {
        IOUtils.closeQuietly(inputStream);
    }
}