@Override public boolean shouldRetryRequest(HttpCommand command, HttpResponse response) { int statusCode = response.getStatusCode(); System.out.println("Response status code: " + statusCode); logger.error("StatusCode", statusCode); return true; } }
@Override public InputStream apply(URI input) { try { if (input.getScheme() != null && input.getScheme().equals("classpath")) return getClass().getResourceAsStream(input.getPath()); return input.toURL().openStream(); } catch (IOException e) { logger.error(e, "URI could not be read: %s", url); throw Throwables.propagate(e); } }
@Override public InputStream apply(URI input) { try { if (input.getScheme() != null && input.getScheme().equals("classpath")) return getClass().getResourceAsStream(input.getPath()); return input.toURL().openStream(); } catch (IOException e) { logger.error(e, "URI could not be read: %s", url); throw Throwables.propagate(e); } }
@Override public InputStream apply(URI input) { try { if (input.getScheme() != null && input.getScheme().equals("classpath")) return getClass().getResourceAsStream(input.getPath()); return input.toURL().openStream(); } catch (IOException e) { logger.error(e, "URI could not be read: %s", url); throw Throwables.propagate(e); } }
private static void logException(Logger logger, String logPrefix, int total, int complete, int errors, long start, Exception e) { String message = message(logPrefix, total, complete, errors, start); logger.error(e, message); }
private static void logException(Logger logger, String logPrefix, int total, int complete, int errors, long start, Exception e) { String message = message(logPrefix, total, complete, errors, start); logger.error(e, message); }
private void output(final File out) { checkNotNull(out, "output"); InputStream in = null; try { in = new FileInputStream(out); wire(">> ", in); } catch (FileNotFoundException e) { logger.error(e, "Error tapping file: %s", out); } finally { closeQuietly(in); } }
private static void logException(Logger logger, String logPrefix, int total, int complete, int errors, long start, Exception e) { String message = message(logPrefix, total, complete, errors, start); logger.error(e, message); }
private static void logException(Logger logger, String logPrefix, int total, int complete, int errors, long start, Exception e) { String message = message(logPrefix, total, complete, errors, start); logger.error(e, message); }
private void output(final File out) { checkNotNull(out, "output"); InputStream in = null; try { in = new FileInputStream(out); wire(">> ", in); } catch (FileNotFoundException e) { logger.error(e, "Error tapping file: %s", out); } finally { closeQuietly(in); } }
public void deleteDirectory(String container, String directory) { // create complete dir path String fullDirPath = buildPathStartingFromBaseDir(container, directory); try { Utils.deleteRecursively(new File(fullDirPath)); } catch (IOException ex) { logger.error("An error occurred removing directory %s.", fullDirPath); Throwables.propagate(ex); } }
public void deleteDirectory(String container, String directory) { // create complete dir path String fullDirPath = buildPathStartingFromBaseDir(container, directory); try { Utils.deleteRecursively(new File(fullDirPath)); } catch (IOException ex) { logger.error("An error occurred removing directory %s.", fullDirPath); Throwables.propagate(ex); } }
private void output(final File out) { checkNotNull(out, "output"); InputStream in = null; try { in = new FileInputStream(out); wire(">> ", in); } catch (FileNotFoundException e) { logger.error(e, "Error tapping file: %s", out); } finally { closeQuietly(in); } }
public void deleteDirectory(String container, String directory) { // create complete dir path String fullDirPath = buildPathStartingFromBaseDir(container, directory); try { Utils.deleteRecursively(new File(fullDirPath)); } catch (IOException ex) { logger.error("An error occurred removing directory %s.", fullDirPath); Throwables.propagate(ex); } }
private void output(final File out) { checkNotNull(out, "output"); InputStream in = null; try { in = new FileInputStream(out); wire(">> ", in); } catch (FileNotFoundException e) { logger.error(e, "Error tapping file: %s", out); } finally { closeQuietly(in); } }
@VisibleForTesting SshException propagate(Exception e, String message) { message += ": " + e.getMessage(); logger.error(e, "<< " + message); if (e instanceof UserAuthException) throw new AuthorizationException("(" + toString() + ") " + message, e); throw e instanceof SshException ? SshException.class.cast(e) : new SshException( "(" + toString() + ") " + message, e); }
@VisibleForTesting SshException propagate(Exception e, String message) { message += ": " + e.getMessage(); logger.error(e, "<< " + message); if (e instanceof UserAuthException) throw new AuthorizationException("(" + toString() + ") " + message, e); throw e instanceof SshException ? SshException.class.cast(e) : new SshException( "(" + toString() + ") " + message, e); }
@VisibleForTesting SshException propagate(Exception e, String message) { message += ": " + e.getMessage(); logger.error(e, "<< " + message); if (e instanceof UserAuthException) throw new AuthorizationException("(" + toString() + ") " + message, e); throw e instanceof SshException ? SshException.class.cast(e) : new SshException( "(" + toString() + ") " + message, e); }
@Override public boolean blobExists(String container, String key) { filesystemContainerNameValidator.validate(container); filesystemBlobKeyValidator.validate(key); try { return buildPathAndChecksIfBlobExists(container, key); } catch (IOException e) { logger.error(e, "An error occurred while checking key %s in container %s", container, key); throw Throwables.propagate(e); } }
@Override public boolean blobExists(String container, String key) { filesystemContainerNameValidator.validate(container); filesystemBlobKeyValidator.validate(key); try { return buildPathAndChecksIfBlobExists(container, key); } catch (IOException e) { logger.error(e, "An error occurred while checking key %s in container %s", container, key); throw Throwables.propagate(e); } }