List of usage examples for java.io IOException fillInStackTrace
public synchronized Throwable fillInStackTrace()
From source file:uni.bielefeld.cmg.sparkhit.main.Main.java
public static void main(String[] args) { InfoDumper info = new InfoDumper(); info.readParagraphedMessages("SparkHit main initiating ... \ninterpreting parameters."); info.screenDump();/*from w w w .jav a2 s.c o m*/ Parameter parameter = null; try { parameter = new Parameter(args); } catch (IOException e) { e.fillInStackTrace(); } catch (ParseException e) { e.fillInStackTrace(); } DefaultParam param = parameter.importCommandLine(); Pipelines pipes = new Pipelines(); pipes.setParameter(param); pipes.spark(); }
From source file:uni.bielefeld.cmg.sparkhit.main.MainOfParallelizer.java
public static void main(String[] args) { InfoDumper info = new InfoDumper(); info.readParagraphedMessages(//from w w w .ja va 2 s . c om "SparkHit Parallelizer (parallel operation on different nodes) initiating ... \ninterpreting parameters."); info.screenDump(); ParameterForParallelizer parameterV = null; try { parameterV = new ParameterForParallelizer(args); } catch (IOException e) { e.fillInStackTrace(); } catch (ParseException e) { e.fillInStackTrace(); } DefaultParam param = parameterV.importCommandLine(); Pipelines pipes = new Pipelines(); pipes.setParameter(param); pipes.sparkParallelizer(); }
From source file:uni.bielefeld.cmg.sparkhit.main.MainOfStatisticer.java
public static void main(String[] args) { InfoDumper info = new InfoDumper(); info.readParagraphedMessages(/*from ww w.ja va 2 s.c o m*/ "SparkHit Statisticer (HWE, fisher EX, ChiSq) initiating ... \ninterpreting parameters."); info.screenDump(); ParameterForStatisticer parameterS = null; try { parameterS = new ParameterForStatisticer(args); } catch (IOException e) { e.fillInStackTrace(); } catch (ParseException e) { e.fillInStackTrace(); } DefaultParam param = parameterS.importCommandLine(); Pipelines pipes = new Pipelines(); pipes.setParameter(param); pipes.sparkStatisticer(); }
From source file:uni.bielefeld.cmg.sparkhit.main.MainOfVariantCaller.java
public static void main(String[] args) { InfoDumper info = new InfoDumper(); info.readParagraphedMessages(//from ww w. j a v a 2s . com "SparkHit VariantCaller (HDFS bam reader) initiating ... \ninterpreting parameters."); info.screenDump(); ParameterForVariantCaller parameterV = null; try { parameterV = new ParameterForVariantCaller(args); } catch (IOException e) { e.fillInStackTrace(); } catch (ParseException e) { e.fillInStackTrace(); } DefaultParam param = parameterV.importCommandLine(); Pipelines pipes = new Pipelines(); pipes.setParameter(param); pipes.sparkVariantCaller(); }
From source file:org.rhq.plugins.apache.ModJKComponent.java
/** * Delegate method to install a simple mod_jk in an apache httpd * @param serverComponent The parents server component with the configuration * @param params Params we got passed from the GUI * @return The outcome of the operation//from w w w.j ava 2 s. c om * @throws Exception see thrown exception for details; thrown exception summarizes error */ public static OperationResult installModJk(ApacheServerComponent serverComponent, Configuration params) throws Exception { StringBuilder builder = new StringBuilder(); boolean needWorkersProps = false; boolean needUriWorkers = false; // First see (what) if stuff is present File httpdConf = serverComponent.getHttpdConfFile(); String confPath = httpdConf.getAbsolutePath(); // If we can't update the file, then there is nothing left to do. if (!httpdConf.canWrite()) { throw new Exception("Httpd.conf is not writable at " + confPath); } HttpdConfParser cparser = new HttpdConfParser(); cparser.parse(confPath); // TODO back up original file try { BufferedWriter writer = null; try { writer = new BufferedWriter(new FileWriter(httpdConf, true)); if (cparser.isModJkInstalled()) { builder.append("Mod_jk is already installed\n"); if (cparser.getWorkerPropertiesFile() != null) { builder.append("Found a worker.properties file at ") .append(cparser.getWorkerPropertiesFile()); builder.append("\n"); } else needWorkersProps = true; if (cparser.getUriWorkerLocation() != null) { builder.append("Found a urimap file at ").append(cparser.getUriWorkerLocation()); } else needUriWorkers = true; } else { builder.append("No mod_jk installed yet at ").append(confPath).append("\n"); writer.append("LoadModule jk_module modules/mod_jk.so"); // TODO obtain modules location writer.newLine(); builder.append(".. written a LoadModule line \n"); needWorkersProps = true; needUriWorkers = true; } if (needWorkersProps) { writer.append("JkWorkersFile ").append("conf/workers.properties"); writer.newLine(); builder.append(".. installed worker.properties"); } if (needUriWorkers) { writer.append("JkMountFile ").append("conf/uriworkermap"); writer.newLine(); builder.append(".. installed uriworkermap"); } } finally { if (writer != null) { // close automatically flushes! writer.close(); } } } catch (IOException e) { builder.append("Error when installing mod_jk: \n"); builder.append(e.fillInStackTrace()); throw new Exception(builder.toString()); } OperationResult result = new OperationResult(); Configuration complexResults = result.getComplexResults(); complexResults.put(new PropertySimple(OUTPUT_RESULT_PROP, builder.toString())); return result; }
From source file:uk.nhs.cfh.dsp.srth.distribution.TRUDLoginService.java
public TRUDLoginService(FTPClient ftpClient) { this.ftpClient = ftpClient; try {/*from www . j av a2s .co m*/ logger.addHandler(new FileHandler(System.getProperty("java.io.tmpdir") + System.getProperty("file.separator") + "configurator.log", true)); } catch (IOException e) { logger.warning("Nested exception is : " + e.fillInStackTrace().getMessage()); } }
From source file:com.ibm.connectors.splunklog.SplunkHttpConnection.java
public Properties sendLogEvent(SplunkConnectionData connData, byte[] thePayload, Properties properties) throws ConnectorException { HttpClient myhClient = HttpClients.custom().setConnectionManager(this.cm).build(); HttpClientContext myhContext = HttpClientContext.create(); CredentialsProvider credsProvider = new BasicCredentialsProvider(); credsProvider.setCredentials(new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT), new UsernamePasswordCredentials(connData.getUser(), connData.getPass())); AuthCache authCache = new BasicAuthCache(); authCache.put(new HttpHost(connData.getHost(), Integer.parseInt(connData.getPort()), connData.getScheme()), new BasicScheme()); myhContext.setCredentialsProvider(credsProvider); myhContext.setAuthCache(authCache);/*from w w w. j ava2 s . c o m*/ HttpPost myhPost = new HttpPost(connData.getSplunkURI()); ByteArrayEntity payload = new ByteArrayEntity(thePayload); try { myhPost.setEntity(payload); HttpResponse response = myhClient.execute(myhPost, myhContext); Integer statusCode = response.getStatusLine().getStatusCode(); if (statusCode != 200 && !connData.getIgnoreSplunkErrors()) { throw new ConnectorException( "Error posting log event to Splunk: " + response.getStatusLine().toString()); } System.out.println(response.getStatusLine().toString()); properties.setProperty("status", String.valueOf(statusCode)); Integer leasedConns = Integer .valueOf(((PoolingHttpClientConnectionManager) this.cm).getTotalStats().getLeased()); properties.setProperty("conns_leased", leasedConns.toString()); Integer availConns = Integer .valueOf(((PoolingHttpClientConnectionManager) this.cm).getTotalStats().getAvailable()); properties.setProperty("conns_available", availConns.toString()); } catch (IOException e) { e.fillInStackTrace(); throw new ConnectorException(e.toString()); } return properties; }
From source file:uk.nhs.cfh.dsp.srth.distribution.TRUDLoginService.java
@Override public boolean authenticate(String userName, char[] pwd, String server) throws Exception { boolean result = false; try {/*from w ww . j a va 2s . c om*/ int reply; ftpClient.connect(server); logger.info("Connected to " + server + "."); ftpClient.login(userName, String.valueOf(pwd)); logger.info(ftpClient.getReplyString()); // After connection attempt, you should check the reply code to verify success. reply = ftpClient.getReplyCode(); logger.info("reply = " + reply); logger.info("FTPReply.isPositiveCompletion(reply) = " + FTPReply.isPositiveCompletion(reply)); if (!FTPReply.isPositiveCompletion(reply)) { ftpClient.disconnect(); logger.warning("FTP server refused connection."); } else { result = true; } } catch (IOException e) { logger.warning("Nested exception is : " + e.fillInStackTrace()); } return result; }
From source file:uk.nhs.cfh.dsp.snomed.converters.xml.impl.SnomedConceptToXMLRenderer.java
public void exportConceptToXMLDocument(TerminologyConcept concept, File file) { Document doc = convertConceptToXMLDocument(concept); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); try {//from w w w . j a va 2 s . com FileWriter writer = new FileWriter(file); writer.flush(); outputter.output(doc, writer); // close writer writer.close(); logger.info("Finished exporting concept to file : " + file.getPath()); } catch (IOException e) { logger.warn(e.fillInStackTrace()); } }
From source file:uk.nhs.cfh.dsp.snomed.converters.xml.impl.AbstractTerminologyConceptToXMLConverter.java
public void exportConceptToXMLDocument(TerminologyConcept concept, File file) { Document doc = convertConceptToXMLDocument(concept); XMLOutputter outputter = new XMLOutputter(Format.getPrettyFormat()); try {//from w ww. j a va2 s . c o m FileWriter writer = new FileWriter(file); writer.flush(); outputter.output(doc, writer); // close writer writer.close(); } catch (IOException e) { logger.warn(e.fillInStackTrace()); } }