Package com.google.common.io

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


      } else {
        stream = closer.register(new FileInputStream(configuration.getQuartPropertiesFile()));
      }
      serverSchedFact.initialize(stream);
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      closer.close();
    }
    Scheduler scheduler = serverSchedFact.getScheduler();
    scheduler.setJobFactory(jobFactory);
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

            try {
                FileOutputStream output = closer.register(new FileOutputStream(target));
                InputStream input = closer.register(url.openStream());
                ByteStreams.copy(input, output);
            } catch (Throwable e) {
                closer.rethrow(e);
            } finally {
                closer.close();
            }
            return resourceDir.getName() + '/' + encodeUrl(base);
        }
View Full Code Here

        // Write overview index?
        try {
            closer.register(mWriter);
            writeOverview(errorCount, warningCount, projects);
        } catch (Throwable e) {
            throw closer.rethrow(e);
        } finally {
            closer.close();
        }

        if (mDisplayEmpty || errorCount > 0 || warningCount > 0) {
View Full Code Here

      }
      if (sb.length() > 0) {
        throw new RuntimeException(sb.toString());
      }
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      closer.close();
    }
  }
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.