/** * Log that the file did not get deleted but prevent the request from failing by eating the exception. * Register the file to be deleted on exit, so it will get deleted eventually. * * @param tempRequestFile - * @param ex - a null may be passed in which case this param gets ignored. */ private void handleFileNotDeletedError(File tempRequestFile, Exception ex) { LogMessages.LOGGER.warn(Messages.MESSAGES.couldNotDeleteFile(tempRequestFile.getAbsolutePath()), ex); tempRequestFile.deleteOnExit(); }
LogMessages.LOGGER.warn(Messages.MESSAGES.couldNotCloseHttpResponse(), e);
/** * Log that the file did not get deleted but prevent the request from failing by eating the exception. * Register the file to be deleted on exit, so it will get deleted eventually. * * @param tempRequestFile - * @param ex - a null may be passed in which case this param gets ignored. */ private void handleFileNotDeletedError(File tempRequestFile, Exception ex) { LogMessages.LOGGER.warn(Messages.MESSAGES.couldNotDeleteFile(tempRequestFile.getAbsolutePath()), ex); tempRequestFile.deleteOnExit(); }
/** * Log that the file did not get deleted but prevent the request from failing by eating the exception. * Register the file to be deleted on exit, so it will get deleted eventually. * * @param tempRequestFile - * @param ex - a null may be passed in which case this param gets ignored. */ private void handleFileNotDeletedError(File tempRequestFile, Exception ex) { LogMessages.LOGGER.warn(Messages.MESSAGES.couldNotDeleteFile(tempRequestFile.getAbsolutePath()), ex); tempRequestFile.deleteOnExit(); }
private static boolean isUsingOldStyleConfiguration(HttpClient client) { /** if(!isConfigurableAvailable()) { return true; } if(!(client instanceof Configurable)) // Yep, they could be using a new style config with a client that we can't actually use { LogMessages.LOGGER.warn("Please consider updating the version of Apache HttpClient being used. Version 4.3.6+ is recommended."); return true; } RequestConfig config = ((Configurable) client).getConfig(); return config == null; **/ boolean isOld = true; try { client.getParams(); LogMessages.LOGGER.warn(Messages.MESSAGES.pleaseConsiderUnpdating()); } catch (UnsupportedOperationException e) { isOld = false; } return isOld; }
LogMessages.LOGGER.warn(Messages.MESSAGES.couldNotCloseHttpResponse(), e);
private static boolean isUsingOldStyleConfiguration(HttpClient client) { /** if(!isConfigurableAvailable()) { return true; } if(!(client instanceof Configurable)) // Yep, they could be using a new style config with a client that we can't actually use { LogMessages.LOGGER.warn("Please consider updating the version of Apache HttpClient being used. Version 4.3.6+ is recommended."); return true; } RequestConfig config = ((Configurable) client).getConfig(); return config == null; **/ boolean isOld = true; try { client.getParams(); LogMessages.LOGGER.warn(Messages.MESSAGES.pleaseConsiderUnpdating()); } catch (UnsupportedOperationException e) { isOld = false; } return isOld; }
public static ClientHttpEngine createWithDefaultProxy(HttpHost defaultProxy) { if(isConfigurableAvailable()) { ApacheHttpClient4Engine engine = new ApacheHttpClient43Engine(defaultProxy); //We have to check that the HttpClient to be used has the configurable interface if(isUsingOldStyleConfiguration(engine.getHttpClient())) { LogMessages.LOGGER.warn(Messages.MESSAGES.pleaseConsiderUnpdating()); engine.close(); return new ApacheHttpClient4Engine(defaultProxy); } return engine; } else { return new ApacheHttpClient4Engine(defaultProxy); } }
public static ClientHttpEngine createWithDefaultProxy(HttpHost defaultProxy) { if(isConfigurableAvailable()) { ApacheHttpClient4Engine engine = new ApacheHttpClient43Engine(defaultProxy); //We have to check that the HttpClient to be used has the configurable interface if(isUsingOldStyleConfiguration(engine.getHttpClient())) { LogMessages.LOGGER.warn(Messages.MESSAGES.pleaseConsiderUnpdating()); engine.close(); return new ApacheHttpClient4Engine(defaultProxy); } return engine; } else { return new ApacheHttpClient4Engine(defaultProxy); } }