Package com.google.common.io

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


        String h = "backup { /path/to/oak/repository | mongodb://host:port/database } <path/to/backup>";
        try {
            NodeStore store = bootstrapNodeStore(args, closer, h);
            FileStoreBackup.backup(store, new File(args[1]));
        } catch (Throwable e) {
            throw closer.rethrow(e);
        } finally {
            closer.close();
        }
    }
View Full Code Here


        String h = "restore { /path/to/oak/repository | mongodb://host:port/database } <path/to/backup>";
        try {
            NodeStore store = bootstrapNodeStore(args, closer, h);
            FileStoreRestore.restore(new File(args[1]), store);
        } catch (Throwable e) {
            throw closer.rethrow(e);
        } finally {
            closer.close();
        }
    }
View Full Code Here

            CloseableIterable<NodeDocument> docs = seeker.getCandidates(0);
            closer.register(docs);
            boolean dryRun = Arrays.asList(args).contains("dryRun");
            agent.recover(docs.iterator(), dns.getClusterId(), dryRun);
        } catch (Throwable e) {
            throw closer.rethrow(e);
        } 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

            input.skipValue();
        }
        input.endArray();
      }
    } catch (Throwable t) {
      throw closer.rethrow(t);
    } finally {
      closer.close();
    }
  }
}
View Full Code Here

        w.write("=");
        joiner.appendTo(w, e.getValue());
        w.write("\n");
      }
    } 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

      InputStream inputStream = closer.register(inputStreamSupplier.getInput());
      KeyStore keyStore = KeyStore.getInstance("JKS");
      keyStore.load(inputStream, KEYSTORE_PASSWORD);
      return keyStore;
    } catch (Throwable e) {
      throw closer.rethrow(e);
    } finally {
      closer.close();
    }
  }
View Full Code Here

        throw new IOException("Couldn't find resource " + path);
      in = closer.register(resourceProvider.getInputStream(path));
      return peek(in);
    } catch (Throwable e)
    {
      throw closer.rethrow(e, InvalidVersionException.class);
    } finally
    {
      closer.close();
    }
  }
View Full Code Here

        MainWindow.this.toolWindowManager.getPersistenceDelegate().merge(loadSource, MergePolicy.RESET);
        LOGGER.info("Successfull loaded workspace settings.");
        success = true;
      } catch (Throwable ex) {
        success = false;
        closer.rethrow(ex);
      } finally {
        closer.close();
      }
    } catch (IOException ex) {
      LOGGER.error("Exeption thrown while loading workspace settings.", ex);
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.