Package com.google.common.io

Examples of com.google.common.io.Closer.rethrow()


            writeMetricValues(buildTimer, testTimer, outputRow, accumulators);
            bus.post(JobEvents.finished(this));
        } catch (Throwable th) {
            bus.post(JobEvents.failed(this, th));
            throw closer.rethrow(th, RecommenderBuildException.class);
        } finally {
            try {
                cleanup();
            } finally {
                outputs = null;
View Full Code Here


                }
            }
            // and we're done
            dumper.finish();
        } catch (Throwable th) {
            throw close.rethrow(th);
        } finally {
            close.close();
        }
    }
View Full Code Here

            case PARTITION_RATINGS:
                writeTTFilesByRatings(trainWriters, testWriters);
                break;
            }
        } catch (Throwable th) {
            throw closer.rethrow(th);
        } finally {
            closer.close();
        }
    }
   
View Full Code Here

      OutputStream os = closer.register(new FileOutputStream(antFile));
      XMLWriter xmlWriter = new XMLWriter(os, OutputFormat.createPrettyPrint());
      xmlWriter.write(doc);
      return antFile;
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      closer.close();
    }
  }
View Full Code Here

            }
            throw new BuildException(message.toString());
        }
      }
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      try {
        closer.close();
      } finally {
        Files.asByteSource(classNamesDynamic).copyTo(Files.asByteSink(classNamesFile, FileWriteMode.APPEND));
View Full Code Here

      OutputStream os = closer.register(new FileOutputStream(antFile));
      XMLWriter xmlWriter = new XMLWriter(os, OutputFormat.createPrettyPrint());
      xmlWriter.write(doc);
      return antFile;
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      closer.close();
    }
  }
View Full Code Here

            Writer out = closer.register(new OutputStreamWriter(socket.getOutputStream()));
            out.write(format("%s %s\n", channel, message));
            out.flush();
        } catch (IOException e) {
            socket.close();
            throw closer.rethrow(e);
        } finally {
            closer.close();
        }
    }
View Full Code Here

                                synchronized (this) {
                                    this.notifyAll();
                                }
                            } catch (IOException ioe) {
                                socket.close();
                                closer.rethrow(ioe);
                            } finally {
                                closer.close();
                            }
                        }
                    } catch (IOException ioe) {
View Full Code Here

    } catch (NoSuchAlgorithmException e) {
      throw new RuntimeException("integrity check algorithm is unavailable", e);
    } catch (IOException e) {
      throw new RuntimeException("I/O error or a bad password", e);
    } catch (Throwable e) { // Prescribed Closer pattern.
      throw closer.rethrow(e);
    } finally {
      closer.close();
    }
    return keyStore;
  }
View Full Code Here

                    out.append(m.getConfig().getName()).append('\t')
                       .append(m.getConfig().getTags().toString()).append('\t')
                       .append(m.getValue().toString()).append('\n');
                }
            } catch (Throwable t) {
                throw closer.rethrow(t);
            } finally {
                closer.close();
            }
        } catch (IOException e) {
            incrementFailedCount();
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.