stdOut = IoUtils.streamToString(process.getInputStream()).trim(); stdErr = IoUtils.streamToString(process.getErrorStream()).trim();
.split(","); try { String cookiesFileContent = IoUtils.streamToString(IoUtils.readFile(PhantomJsDriver.cookiesFile)); for (String cookieName : cookieNames) { int cookieIndex = cookiesFileContent.indexOf(cookieName + "=");
/** * Check if the body is from the content type and returns it if not attachment * * @param mimePart * @param contentType * @return null if not with specific content type or part is attachment */ private String getBodyIfNotAttachment( BodyPart mimePart, String contentType ) throws MessagingException, IOException { String mimePartContentType = mimePart.getContentType().toLowerCase(); if (mimePartContentType.startsWith(contentType)) { // found a part with given mime type String contentDisposition = mimePart.getDisposition(); if (!Part.ATTACHMENT.equalsIgnoreCase(contentDisposition)) { Object partContent = mimePart.getContent(); if (partContent instanceof InputStream) { return IoUtils.streamToString((InputStream) partContent); } else { return partContent.toString(); } } } return null; }
try { is = resultSet.getAsciiStream(index); value = IoUtils.streamToString(is); } finally { IoUtils.closeStream(is);
try { is = resultSet.getAsciiStream(index); value = IoUtils.streamToString(is); } finally { IoUtils.closeStream(is);
try { Process p = Runtime.getRuntime().exec( cmdCommand ); String result = IoUtils.streamToString( p.getInputStream() ).trim(); String[] lines = result.split( "[\r\n]+" ); String matchedLine = null;
if (uuiFile.exists()) { String uuiFileContent = IoUtils.streamToString(IoUtils.readFile(uuiFileLocation)); if (uuiFileContent.contains(userWorkingDirectory)) {
try { Process p = Runtime.getRuntime().exec( cmdCommand ); result = IoUtils.streamToString( p.getInputStream() ).trim(); } catch( Exception e ) { throw new RuntimeException( "Error getting devices to monitor for IO (Read/Write) transfer. lspv command invoke error",
if (verificationToken != null) { final String responseBody = IoUtils.streamToString( ((InputStream) httpConnection.getContent())); log.debug("Get '" + urlString + "' returned:\n" + responseBody); if (!responseBody.contains(verificationToken)) {
String uuiFileContent = IoUtils.streamToString(IoUtils.readFile(uuiFileLocation)); if (uuiFileContent.contains(userWorkingDirectory)) { for (String line : uuiFileContent.split("\n")) {