Examples of IOException2


Examples of hudson.util.IOException2

                    result = list.get(0);
                }
            }

        } catch (DocumentException e) {
            throw new IOException2("Failed to do XPath/wrapper handling. XML is as follows:"+sw,e);
        }

        OutputStream o = rsp.getCompressedOutputStream(req);
        try {
            if(result instanceof CharacterData) {
View Full Code Here

Examples of hudson.util.IOException2

    public void parse(File reportFile) throws IOException {
        try {
            for (SuiteResult suiteResult : SuiteResult.parse(reportFile, keepLongStdio))
                add(suiteResult);
        } catch (InterruptedException e) {
            throw new IOException2("Failed to read "+reportFile,e);
        } catch (RuntimeException e) {
            throw new IOException2("Failed to read "+reportFile,e);
        } catch (DocumentException e) {
            if (!reportFile.getPath().endsWith(".xml")) {
                throw new IOException2("Failed to read "+reportFile+"\n"+
                    "Is this really a JUnit report file? Your configuration must be matching too many files",e);
            } else {
                SuiteResult sr = new SuiteResult(reportFile.getName(), "", "");
                StringWriter writer = new StringWriter();
                e.printStackTrace(new PrintWriter(writer));
                String error = "Failed to read test report file "+reportFile.getAbsolutePath()+"\n"+writer.toString();
                sr.addCase(new CaseResult(sr,"<init>",error));
                add(sr);
                throw new IOException2("Failed to read "+reportFile,e);
            }
        }
    }
View Full Code Here

Examples of hudson.util.IOException2

                            req.setAttribute("currentDescriptorByNameUrl",currentDescriptorByNameUrl);
                        }
                    }.invokeScript(req,rsp,bodyStack[0],null);
                } catch (JellyTagException e) {
                    LOGGER.log(Level.WARNING, "Failed to evaluate the template closure", e);
                    throw new IOException2("Failed to evaluate the template closure",e);
                }
            }
        };
    }
View Full Code Here

Examples of hudson.util.IOException2

    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;
    }
View Full Code Here

Examples of hudson.util.IOException2

        try {
            StringBuffer linkName = (StringBuffer) LINKNAME_FIELD.get(e);
            linkName.setLength(0);
            linkName.append(target);
        } catch (IllegalAccessException x) {
            throw new IOException2("Failed to set linkName", x);
        }

        tar.putNextEntry(e);
        entriesWritten++;
    }
View Full Code Here

Examples of hudson.util.IOException2

                        .newTransformer();
                t.transform(source,
                        new StreamResult(out));
                out.close();
            } catch (TransformerException e) {
                throw new IOException2("Failed to persist configuration.xml", e);
            }

            // try to reflect the changes by reloading
            new XmlFile(Items.XSTREAM, out.getTemporaryFile()).unmarshal(this);
            onLoad(getParent(), getRootDir().getName());
View Full Code Here

Examples of hudson.util.IOException2

                    boolean produced = buildTimestamp <= file.lastModified()+2000;

                    try {
                        results.add(new Record(produced,f,file.getName(),new FilePath(file).digest()));
                    } catch (IOException e) {
                        throw new IOException2(Messages.Fingerprinter_DigestFailed(file),e);
                    } catch (InterruptedException e) {
                        throw new IOException2(Messages.Fingerprinter_Aborted(),e);
                    }
                }

                return results;
            }
View Full Code Here

Examples of hudson.util.IOException2

                            private Exception closed;
                            private volatile int count;

                            private void checkNotClosed() throws IOException2 {
                                if (closed != null)
                                    throw new IOException2(closed);
                            }

                            @Override
                            public void write(int b) throws IOException {
                                count++;
View Full Code Here

Examples of hudson.util.IOException2

                            private Exception closed;
                            private volatile int count;

                            private void checkNotClosed() throws IOException2 {
                                if (closed != null)
                                    throw new IOException2(closed);
                            }
View Full Code Here

Examples of hudson.util.IOException2

                    while((len=in.read(buf))>=0) {
                        out.write(buf,0,len);
                        job.status = job.new Installing(total==-1 ? -1 : in.getCount()*100/total);
                    }
                } catch (IOException e) {
                    throw new IOException2("Failed to load "+src+" to "+tmp,e);
                }

                in.close();
                out.close();

                if (total!=-1 && total!=tmp.length()) {
                    // don't know exactly how this happens, but report like
                    // http://www.ashlux.com/wordpress/2009/08/14/hudson-and-the-sonar-plugin-fail-maveninstallation-nosuchmethoderror/
                    // indicates that this kind of inconsistency can happen. So let's be defensive
                    throw new IOException("Inconsistent file length: expected "+total+" but only got "+tmp.length());
                }

                return tmp;
            } catch (IOException e) {
                throw new IOException2("Failed to download from "+src,e);
            }
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.