private synchronized OutputStream current() throws IOException { if (current==null) try { current = new FileOutputStream(out,appendOnNextOpen); } catch (FileNotFoundException e) { throw new IOException2("Failed to open "+out,e); } return current; }
private synchronized OutputStream current() throws IOException { if (current==null) try { current = new FileOutputStream(out,appendOnNextOpen); } catch (FileNotFoundException e) { throw new IOException2("Failed to open "+out,e); } return current; }
private synchronized OutputStream current() throws IOException { if (current == null) { try { current = new FileOutputStream(out, appendOnNextOpen); } catch (FileNotFoundException e) { throw new IOException2("Failed to open " + out, e); } } return current; }
private synchronized OutputStream current() throws IOException { if (current==null) try { current = new FileOutputStream(out,appendOnNextOpen); } catch (FileNotFoundException e) { throw new IOException2("Failed to open "+out,e); } return current; }
/*package*/ static long parseTimestampFromBuildDir(File buildDir) throws IOException { try { return ID_FORMATTER.get().parse(buildDir.getName()).getTime(); } catch (ParseException e) { throw new IOException2("Invalid directory name "+buildDir,e); } catch (NumberFormatException e) { throw new IOException2("Invalid directory name "+buildDir,e); } }
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { try { serveFile(req,rsp,base,icon,serveDirIndex); } catch (InterruptedException e) { throw new IOException2("interrupted",e); } }
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { try { serveFile(req, rsp, base, icon, serveDirIndex); } catch (InterruptedException e) { throw new IOException2("interrupted", e); } }
private void join(Future<Void> task) throws InterruptedException, IOException { try { task.get(); } catch (ExecutionException e) { throw new IOException2(e); } }
public void generateResponse(StaplerRequest req, StaplerResponse rsp, Object node) throws IOException, ServletException { try { serveFile(req,rsp,base,icon,serveDirIndex); } catch (InterruptedException e) { throw new IOException2("interrupted",e); } }
public FilePath call() throws IOException { final File hprof = File.createTempFile("hudson-heapdump", "hprof"); hprof.delete(); try { MBeanServer server = ManagementFactory.getPlatformMBeanServer(); server.invoke(new ObjectName("com.sun.management:type=HotSpotDiagnostic"), "dumpHeap", new Object[]{hprof.getAbsolutePath(), true}, new String[]{String.class.getName(), boolean.class.getName()}); return new FilePath(hprof); } catch (JMException e) { throw new IOException2(e); } }
private void join(Future<Void> task) throws InterruptedException, IOException { try { task.get(); } catch (ExecutionException e) { throw new IOException2(e); } }
public Channel launchChannel(String[] cmd, OutputStream out, FilePath _workDir, Map<String, String> envVars) throws IOException, InterruptedException { printCommandLine(cmd, _workDir); try { Process proc = launcher.launch(Util.join(asList(cmd), " "), _workDir.getRemote()); return new Channel("channel over named pipe to "+launcher.getHostName(), Computer.threadPoolForRemoting, proc.getInputStream(), new BufferedOutputStream(proc.getOutputStream())); } catch (JIException e) { throw new IOException2(e); } }
public Channel launchChannel(String[] cmd, OutputStream out, FilePath _workDir, Map<String, String> envVars) throws IOException, InterruptedException { printCommandLine(cmd, _workDir); try { Process proc = launcher.launch(Util.join(asList(cmd), " "), _workDir.getRemote()); return new Channel("channel over named pipe to "+launcher.getHostName(), Computer.threadPoolForRemoting, proc.getInputStream(), new BufferedOutputStream(proc.getOutputStream())); } catch (JIException e) { throw new IOException2(e); } }
public InputStream extract(InputStream _in) throws IOException { HeadBufferingStream in = new HeadBufferingStream(_in,SIDE_BUFFER_SIZE); try { return new GZIPInputStream(in, BUFFER_SIZE); } catch (IOException e) { // various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better in.fillSide(); throw new IOException2(e.getMessage()+"\nstream="+Util.toHexString(in.getSideBuffer()),e); } } public OutputStream compress(OutputStream out) throws IOException {
private void testConnection(URL url) throws IOException { try { Util.copyStreamAndClose(ProxyConfiguration.open(url).getInputStream(), new NullOutputStream()); } catch (SSLHandshakeException e) { if (e.getMessage().contains("PKIX path building failed")) // fix up this illegible error message from JDK { throw new IOException2("Failed to validate the SSL certificate of " + url, e); } } } }
public InputStream extract(InputStream _in) throws IOException { HeadBufferingStream in = new HeadBufferingStream(_in,SIDE_BUFFER_SIZE); try { return new GZIPInputStream(in, BUFFER_SIZE); } catch (IOException e) { // various people reported "java.io.IOException: Not in GZIP format" here, so diagnose this problem better in.fillSide(); throw new IOException2(e.getMessage()+"\nstream="+Util.toHexString(in.getSideBuffer()),e); } } public OutputStream compress(OutputStream out) throws IOException {
private void testConnection(URL url) throws IOException { try { Util.copyStreamAndClose(ProxyConfiguration.open(url).getInputStream(),new NullOutputStream()); } catch (SSLHandshakeException e) { if (e.getMessage().contains("PKIX path building failed")) // fix up this crappy error message from JDK throw new IOException2("Failed to validate the SSL certificate of "+url,e); } } }
private void testConnection(URL url) throws IOException { try { Util.copyStreamAndClose(ProxyConfiguration.open(url).getInputStream(),new NullOutputStream()); } catch (SSLHandshakeException e) { if (e.getMessage().contains("PKIX path building failed")) // fix up this illegible error message from JDK throw new IOException2("Failed to validate the SSL certificate of "+url,e); } } }
public CoverageReport(VectorCASTBuildAction action, InputStream... xmlReports) throws IOException { this(action); for (InputStream is: xmlReports) { try { createDigester().parse(is); } catch (SAXException e) { throw new IOException2("Failed to parse XML",e); } } setParent(null); }
public CoverageReport(VectorCASTBuildAction action, File xmlReport) throws IOException { this(action); try { createDigester().parse(xmlReport); } catch (SAXException e) { throw new IOException2("Failed to parse "+xmlReport,e); } setParent(null); }