From 02377824985f6a9e8093ce1dba88a4e2fd79b02a Mon Sep 17 00:00:00 2001 From: Gert Vanthienen Date: Sat, 26 Mar 2011 14:57:00 +0000 Subject: [PATCH] Removing some TABs from the servicemix-utils codebase git-svn-id: https://svn.apache.org/repos/asf/servicemix/utils/trunk@1085730 13f79535-47bb-0310-9956-ffa450edef68 --- .../components/util/DefaultFileMarshaler.java | 10 +- .../components/util/StreamDataSource.java | 2 +- .../executors/impl/FactoryFinder.java | 16 +- .../transformer/PropertyAddTransformer.java | 2 +- .../apache/servicemix/jdbc/Statements.java | 2 +- .../jdbc/adapter/BlobJDBCAdapter.java | 2 +- .../jdbc/adapter/BytesJDBCAdapter.java | 2 +- .../jdbc/adapter/HsqldbJDBCAdapter.java | 2 +- .../jdbc/adapter/ImageBasedJDBCAdaptor.java | 2 +- .../jdbc/adapter/StreamJDBCAdapter.java | 2 +- .../store/hazelcast/HazelcastStore.java | 2 +- .../org/apache/servicemix/util/FileUtil.java | 626 +++++++++--------- .../util/jaf/ByteArrayDataSource.java | 2 +- .../util/DefaultFileMarshalerTest.java | 32 +- .../store/hazelcast/HazelcastStoreTest.java | 2 +- .../tck/mock/MockExchangeFactoryTest.java | 2 +- .../servicemix/components/util/encoding.xml | 2 +- .../expression/expression-editor.xml | 6 +- 18 files changed, 358 insertions(+), 358 deletions(-) diff --git a/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java b/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java index 057254d..7d150a6 100644 --- a/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java +++ b/src/main/java/org/apache/servicemix/components/util/DefaultFileMarshaler.java @@ -75,11 +75,11 @@ public String getOutputName(MessageExchange exchange, NormalizedMessage message) return asString(fileName.evaluate(exchange, message)); } - public String getTempOutputName(MessageExchange exchange, - NormalizedMessage message) throws MessagingException { - Object retVal = tempFileName.evaluate(exchange, message); - return retVal == null ? null : asString(retVal); - } + public String getTempOutputName(MessageExchange exchange, + NormalizedMessage message) throws MessagingException { + Object retVal = tempFileName.evaluate(exchange, message); + return retVal == null ? null : asString(retVal); + } public void writeMessage(MessageExchange exchange, NormalizedMessage message, OutputStream out, String path) throws IOException, JBIException { diff --git a/src/main/java/org/apache/servicemix/components/util/StreamDataSource.java b/src/main/java/org/apache/servicemix/components/util/StreamDataSource.java index 671a9a1..21cbe53 100644 --- a/src/main/java/org/apache/servicemix/components/util/StreamDataSource.java +++ b/src/main/java/org/apache/servicemix/components/util/StreamDataSource.java @@ -27,7 +27,7 @@ */ public class StreamDataSource extends org.apache.servicemix.util.jaf.StreamDataSource { - public StreamDataSource(InputStream in) { + public StreamDataSource(InputStream in) { super(in); } diff --git a/src/main/java/org/apache/servicemix/executors/impl/FactoryFinder.java b/src/main/java/org/apache/servicemix/executors/impl/FactoryFinder.java index 9b03e36..5661dc0 100644 --- a/src/main/java/org/apache/servicemix/executors/impl/FactoryFinder.java +++ b/src/main/java/org/apache/servicemix/executors/impl/FactoryFinder.java @@ -165,14 +165,14 @@ public Object run() { ClassLoader classLoader = findClassLoader(); - try { - // If we are deployed into an OSGi environment, leverage it - Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(iFactoryId); - if (spiClass != null) { - return spiClass.newInstance(); - } - } catch (Throwable e) { - } + try { + // If we are deployed into an OSGi environment, leverage it + Class spiClass = org.apache.servicemix.specs.locator.OsgiLocator.locate(iFactoryId); + if (spiClass != null) { + return spiClass.newInstance(); + } + } catch (Throwable e) { + } // Use the system property first try { diff --git a/src/main/java/org/apache/servicemix/jbi/transformer/PropertyAddTransformer.java b/src/main/java/org/apache/servicemix/jbi/transformer/PropertyAddTransformer.java index fef7100..3ac1eca 100644 --- a/src/main/java/org/apache/servicemix/jbi/transformer/PropertyAddTransformer.java +++ b/src/main/java/org/apache/servicemix/jbi/transformer/PropertyAddTransformer.java @@ -46,4 +46,4 @@ public String getValue() { public void setValue(String value) { this.value = value; } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/jdbc/Statements.java b/src/main/java/org/apache/servicemix/jdbc/Statements.java index 05eef4a..0edbac7 100644 --- a/src/main/java/org/apache/servicemix/jdbc/Statements.java +++ b/src/main/java/org/apache/servicemix/jdbc/Statements.java @@ -210,4 +210,4 @@ public void setCountStatement(String getCountStatement) { this.countStatement = getCountStatement; } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java b/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java index ee9cd1c..a15980d 100644 --- a/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java +++ b/src/main/java/org/apache/servicemix/jdbc/adapter/BlobJDBCAdapter.java @@ -38,4 +38,4 @@ */ public class BlobJDBCAdapter extends DefaultJDBCAdapter { -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java b/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java index 5eea9e5..53f6ae0 100644 --- a/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java +++ b/src/main/java/org/apache/servicemix/jdbc/adapter/BytesJDBCAdapter.java @@ -46,4 +46,4 @@ protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws s.setBytes(index, data); } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/jdbc/adapter/HsqldbJDBCAdapter.java b/src/main/java/org/apache/servicemix/jdbc/adapter/HsqldbJDBCAdapter.java index ce560de..b04b78d 100644 --- a/src/main/java/org/apache/servicemix/jdbc/adapter/HsqldbJDBCAdapter.java +++ b/src/main/java/org/apache/servicemix/jdbc/adapter/HsqldbJDBCAdapter.java @@ -29,4 +29,4 @@ public void setStatements(Statements statements) { super.setStatements(statements); } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/jdbc/adapter/ImageBasedJDBCAdaptor.java b/src/main/java/org/apache/servicemix/jdbc/adapter/ImageBasedJDBCAdaptor.java index 3462aa2..61c0971 100644 --- a/src/main/java/org/apache/servicemix/jdbc/adapter/ImageBasedJDBCAdaptor.java +++ b/src/main/java/org/apache/servicemix/jdbc/adapter/ImageBasedJDBCAdaptor.java @@ -37,4 +37,4 @@ public void setStatements(Statements statements) { super.setStatements(statements); } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/jdbc/adapter/StreamJDBCAdapter.java b/src/main/java/org/apache/servicemix/jdbc/adapter/StreamJDBCAdapter.java index 16bed0d..fb2d1c9 100644 --- a/src/main/java/org/apache/servicemix/jdbc/adapter/StreamJDBCAdapter.java +++ b/src/main/java/org/apache/servicemix/jdbc/adapter/StreamJDBCAdapter.java @@ -67,4 +67,4 @@ protected void setBinaryData(PreparedStatement s, int index, byte[] data) throws s.setBinaryStream(index, new ByteArrayInputStream(data), data.length); } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/store/hazelcast/HazelcastStore.java b/src/main/java/org/apache/servicemix/store/hazelcast/HazelcastStore.java index 60a19ca..3d82555 100644 --- a/src/main/java/org/apache/servicemix/store/hazelcast/HazelcastStore.java +++ b/src/main/java/org/apache/servicemix/store/hazelcast/HazelcastStore.java @@ -167,4 +167,4 @@ private void evict() { } } } -} \ No newline at end of file +} diff --git a/src/main/java/org/apache/servicemix/util/FileUtil.java b/src/main/java/org/apache/servicemix/util/FileUtil.java index 515c071..7b4e550 100644 --- a/src/main/java/org/apache/servicemix/util/FileUtil.java +++ b/src/main/java/org/apache/servicemix/util/FileUtil.java @@ -41,59 +41,59 @@ */ public final class FileUtil { - private FileUtil() { - } + private FileUtil() { + } - /** - * Move a File - * - * @param src - * @param targetDirectory - * @throws IOException - */ - public static void moveFile(File src, File targetDirectory) - throws IOException { - if (src == null || !src.exists() || !src.isFile() || - targetDirectory == null || !targetDirectory.exists() || !targetDirectory.isDirectory() || - !src.renameTo(new File(targetDirectory, src.getName()))) { - // unable to move the file - throw new IOException("Failed to move " + src + " to " + targetDirectory); - } - } + /** + * Move a File + * + * @param src + * @param targetDirectory + * @throws IOException + */ + public static void moveFile(File src, File targetDirectory) + throws IOException { + if (src == null || !src.exists() || !src.isFile() || + targetDirectory == null || !targetDirectory.exists() || !targetDirectory.isDirectory() || + !src.renameTo(new File(targetDirectory, src.getName()))) { + // unable to move the file + throw new IOException("Failed to move " + src + " to " + targetDirectory); + } + } - /** - * Build a path- but do not create it - * - * @param parent - * @param subDirectory - * @return a File representing the path - */ - public static File getDirectoryPath(File parent, String subDirectory) { - File result = null; - if (parent != null) { - result = new File(parent, subDirectory); - } - return result; - } + /** + * Build a path- but do not create it + * + * @param parent + * @param subDirectory + * @return a File representing the path + */ + public static File getDirectoryPath(File parent, String subDirectory) { + File result = null; + if (parent != null) { + result = new File(parent, subDirectory); + } + return result; + } - /** - * Build a directory path - creating directories if neccesary - * - * @param file - * @return true if the directory exists, or making it was successful - */ - public static boolean buildDirectory(File file) { - return file.exists() || file.mkdirs(); - } + /** + * Build a directory path - creating directories if neccesary + * + * @param file + * @return true if the directory exists, or making it was successful + */ + public static boolean buildDirectory(File file) { + return file.exists() || file.mkdirs(); + } - /** - * Count files in a directory (including files in all subdirectories) - * - * @param directory - * the directory to start in - * @return the total number of files - */ - public static int countFilesInDirectory(File directory) { + /** + * Count files in a directory (including files in all subdirectories) + * + * @param directory + * the directory to start in + * @return the total number of files + */ + public static int countFilesInDirectory(File directory) { int count = 0; for (File file : directory.listFiles()) { if (file.isFile()) { @@ -106,280 +106,280 @@ public static int countFilesInDirectory(File directory) { return count; } - /** - * Copy in stream to an out stream - * - * @param in - * @param out - * @throws IOException - */ - public static void copyInputStream(InputStream in, OutputStream out) - throws IOException { - // simply use the fastCopy method - fastCopy(in, out); - } + /** + * Copy in stream to an out stream + * + * @param in + * @param out + * @throws IOException + */ + public static void copyInputStream(InputStream in, OutputStream out) + throws IOException { + // simply use the fastCopy method + fastCopy(in, out); + } - /** - * Unpack a zip file - * - * @param theFile - * @param targetDir - * @return the file - * @throws IOException - */ - public static File unpackArchive(File theFile, File targetDir) - throws IOException { - if (!theFile.exists()) { - throw new IOException(theFile.getAbsolutePath() + " does not exist"); - } - if (!buildDirectory(targetDir)) { - throw new IOException("Could not create directory: " + targetDir); - } - ZipFile zipFile; - zipFile = new ZipFile(theFile); - for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) { - ZipEntry entry = (ZipEntry) entries.nextElement(); - File file = new File(targetDir, File.separator + entry.getName()); - // Take the sledgehammer approach to creating directories - // to work around ZIP's that incorrectly miss directories - if (!buildDirectory(file.getParentFile())) { - throw new IOException("Could not create directory: " - + file.getParentFile()); - } - if (!entry.isDirectory()) { - copyInputStream(zipFile.getInputStream(entry), - new BufferedOutputStream(new FileOutputStream(file))); - } else { - if (!buildDirectory(file)) { - throw new IOException("Could not create directory: " + file); - } - } - } - zipFile.close(); - return theFile; - } + /** + * Unpack a zip file + * + * @param theFile + * @param targetDir + * @return the file + * @throws IOException + */ + public static File unpackArchive(File theFile, File targetDir) + throws IOException { + if (!theFile.exists()) { + throw new IOException(theFile.getAbsolutePath() + " does not exist"); + } + if (!buildDirectory(targetDir)) { + throw new IOException("Could not create directory: " + targetDir); + } + ZipFile zipFile; + zipFile = new ZipFile(theFile); + for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) { + ZipEntry entry = (ZipEntry) entries.nextElement(); + File file = new File(targetDir, File.separator + entry.getName()); + // Take the sledgehammer approach to creating directories + // to work around ZIP's that incorrectly miss directories + if (!buildDirectory(file.getParentFile())) { + throw new IOException("Could not create directory: " + + file.getParentFile()); + } + if (!entry.isDirectory()) { + copyInputStream(zipFile.getInputStream(entry), + new BufferedOutputStream(new FileOutputStream(file))); + } else { + if (!buildDirectory(file)) { + throw new IOException("Could not create directory: " + file); + } + } + } + zipFile.close(); + return theFile; + } - /** - * Unpack an archive from a URL - * - * @param url - * @param targetDir - * @return the file to the url - * @throws IOException - */ - public static File unpackArchive(URL url, File targetDir) - throws IOException { - if (!targetDir.exists()) { - targetDir.mkdirs(); - } - InputStream in = new BufferedInputStream(url.openStream()); - // make sure we get the actual file - File zip = File.createTempFile("arc", ".zip", targetDir); - OutputStream out = new BufferedOutputStream(new FileOutputStream(zip)); - copyInputStream(in, out); - out.close(); - return unpackArchive(zip, targetDir); - } + /** + * Unpack an archive from a URL + * + * @param url + * @param targetDir + * @return the file to the url + * @throws IOException + */ + public static File unpackArchive(URL url, File targetDir) + throws IOException { + if (!targetDir.exists()) { + targetDir.mkdirs(); + } + InputStream in = new BufferedInputStream(url.openStream()); + // make sure we get the actual file + File zip = File.createTempFile("arc", ".zip", targetDir); + OutputStream out = new BufferedOutputStream(new FileOutputStream(zip)); + copyInputStream(in, out); + out.close(); + return unpackArchive(zip, targetDir); + } - /** - * Validate that an archive contains a named entry - * - * @param theFile - * @param name - * @return true if the entry exists - * @throws IOException - */ - public static boolean archiveContainsEntry(File theFile, String name) - throws IOException { - boolean result = false; - ZipFile zipFile; - zipFile = new ZipFile(theFile); - for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) { - ZipEntry entry = (ZipEntry) entries.nextElement(); - if (entry.getName().equals(name)) { - result = true; - break; - } - } - zipFile.close(); - return result; - } + /** + * Validate that an archive contains a named entry + * + * @param theFile + * @param name + * @return true if the entry exists + * @throws IOException + */ + public static boolean archiveContainsEntry(File theFile, String name) + throws IOException { + boolean result = false; + ZipFile zipFile; + zipFile = new ZipFile(theFile); + for (Enumeration entries = zipFile.entries(); entries.hasMoreElements();) { + ZipEntry entry = (ZipEntry) entries.nextElement(); + if (entry.getName().equals(name)) { + result = true; + break; + } + } + zipFile.close(); + return result; + } - /** - * Create a unique directory within a directory 'root' - * - * @param rootDir - * @param seed - * @return unique directory - * @throws IOException - */ - public static synchronized File createUniqueDirectory(File rootDir, - String seed) throws IOException { - int index = seed.lastIndexOf('.'); - if (index > 0) { - seed = seed.substring(0, index); - } - File result = null; - int count = 0; - while (result == null) { - String name = seed + "." + count + ".tmp"; - File file = new File(rootDir, name); - if (!file.exists()) { - file.mkdirs(); - result = file; - } - count++; - } - return result; - } + /** + * Create a unique directory within a directory 'root' + * + * @param rootDir + * @param seed + * @return unique directory + * @throws IOException + */ + public static synchronized File createUniqueDirectory(File rootDir, + String seed) throws IOException { + int index = seed.lastIndexOf('.'); + if (index > 0) { + seed = seed.substring(0, index); + } + File result = null; + int count = 0; + while (result == null) { + String name = seed + "." + count + ".tmp"; + File file = new File(rootDir, name); + if (!file.exists()) { + file.mkdirs(); + result = file; + } + count++; + } + return result; + } - /** - * Delete a file - * - * @param fileToDelete - * @return true if the File is deleted - */ - public static boolean deleteFile(File fileToDelete) { - if (fileToDelete == null || !fileToDelete.exists()) { - return true; - } - boolean result = true; - if (fileToDelete.isDirectory()) { - File[] files = fileToDelete.listFiles(); - if (files == null) { - result = false; - } else { - for (int i = 0; i < files.length; i++) { - File file = files[i]; - if (file.getName().equals(".") - || file.getName().equals("..")) { - continue; - } - if (file.isDirectory()) { - result &= deleteFile(file); - } else { - result &= file.delete(); - } - } - } - } - result &= fileToDelete.delete(); - return result; - } + /** + * Delete a file + * + * @param fileToDelete + * @return true if the File is deleted + */ + public static boolean deleteFile(File fileToDelete) { + if (fileToDelete == null || !fileToDelete.exists()) { + return true; + } + boolean result = true; + if (fileToDelete.isDirectory()) { + File[] files = fileToDelete.listFiles(); + if (files == null) { + result = false; + } else { + for (int i = 0; i < files.length; i++) { + File file = files[i]; + if (file.getName().equals(".") + || file.getName().equals("..")) { + continue; + } + if (file.isDirectory()) { + result &= deleteFile(file); + } else { + result &= file.delete(); + } + } + } + } + result &= fileToDelete.delete(); + return result; + } - /** - * Zip up a directory - * - * @param directory - * @param zipName - * @throws IOException - */ - public static void zipDir(String directory, String zipName) - throws IOException { - // create a ZipOutputStream to zip the data to - ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipName)); - String path = ""; - zipDir(directory, zos, path); - // close the stream - zos.close(); - } + /** + * Zip up a directory + * + * @param directory + * @param zipName + * @throws IOException + */ + public static void zipDir(String directory, String zipName) + throws IOException { + // create a ZipOutputStream to zip the data to + ZipOutputStream zos = new ZipOutputStream(new FileOutputStream(zipName)); + String path = ""; + zipDir(directory, zos, path); + // close the stream + zos.close(); + } - /** - * Zip up a directory path - * - * @param directory - * @param zos - * @param path - * @throws IOException - */ - public static void zipDir(String directory, ZipOutputStream zos, String path) - throws IOException { - File zipDir = new File(directory); - // get a listing of the directory content - String[] dirList = zipDir.list(); - byte[] readBuffer = new byte[2156]; - int bytesIn = 0; - // loop through dirList, and zip the files - for (int i = 0; i < dirList.length; i++) { - File f = new File(zipDir, dirList[i]); - if (f.isDirectory()) { - String filePath = f.getPath(); - zipDir(filePath, zos, path + f.getName() + "/"); - continue; - } - FileInputStream fis = new FileInputStream(f); - try { - ZipEntry anEntry = new ZipEntry(path + f.getName()); - zos.putNextEntry(anEntry); - bytesIn = fis.read(readBuffer); - while (bytesIn != -1) { - zos.write(readBuffer, 0, bytesIn); - bytesIn = fis.read(readBuffer); - } - } finally { - fis.close(); - } - } - } + /** + * Zip up a directory path + * + * @param directory + * @param zos + * @param path + * @throws IOException + */ + public static void zipDir(String directory, ZipOutputStream zos, String path) + throws IOException { + File zipDir = new File(directory); + // get a listing of the directory content + String[] dirList = zipDir.list(); + byte[] readBuffer = new byte[2156]; + int bytesIn = 0; + // loop through dirList, and zip the files + for (int i = 0; i < dirList.length; i++) { + File f = new File(zipDir, dirList[i]); + if (f.isDirectory()) { + String filePath = f.getPath(); + zipDir(filePath, zos, path + f.getName() + "/"); + continue; + } + FileInputStream fis = new FileInputStream(f); + try { + ZipEntry anEntry = new ZipEntry(path + f.getName()); + zos.putNextEntry(anEntry); + bytesIn = fis.read(readBuffer); + while (bytesIn != -1) { + zos.write(readBuffer, 0, bytesIn); + bytesIn = fis.read(readBuffer); + } + } finally { + fis.close(); + } + } + } - /** - * checks whether a file is fully transmitted or still being copied - * - * @param path - * the full file path - * @returns true if the file size didn't change for 100 millis - */ - public static boolean isFileFullyAvailable(String path) { - return isFileFullyAvailable(new File(path)); - } + /** + * checks whether a file is fully transmitted or still being copied + * + * @param path + * the full file path + * @returns true if the file size didn't change for 100 millis + */ + public static boolean isFileFullyAvailable(String path) { + return isFileFullyAvailable(new File(path)); + } - /** - * checks whether a file is fully transmitted or still being copied - * - * @param file - * the file to check - * @returns true if the file size didn't change for 100 millis - */ - public static boolean isFileFullyAvailable(File file) { - // First check to see if the file is still growing - long targetLength = file.length(); - try { - Thread.sleep(100); - } catch (InterruptedException e) { - // Do nothing - } - long target2Length = file.length(); + /** + * checks whether a file is fully transmitted or still being copied + * + * @param file + * the file to check + * @returns true if the file size didn't change for 100 millis + */ + public static boolean isFileFullyAvailable(File file) { + // First check to see if the file is still growing + long targetLength = file.length(); + try { + Thread.sleep(100); + } catch (InterruptedException e) { + // Do nothing + } + long target2Length = file.length(); - if (targetLength != target2Length) { - return false; - } + if (targetLength != target2Length) { + return false; + } - return true; - } + return true; + } - /** - * Copies the whole content from the input stream to the output stream using - * nio channels to speed it up. - * - * @param input the input stream - * @param output the output stream - * @throws IOException if any IO error occurs during read/write - */ - public static void fastCopy(final InputStream input, final OutputStream output) throws IOException { - final ReadableByteChannel src = Channels.newChannel(input); - final WritableByteChannel dest = Channels.newChannel(output); - final ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024); + /** + * Copies the whole content from the input stream to the output stream using + * nio channels to speed it up. + * + * @param input the input stream + * @param output the output stream + * @throws IOException if any IO error occurs during read/write + */ + public static void fastCopy(final InputStream input, final OutputStream output) throws IOException { + final ReadableByteChannel src = Channels.newChannel(input); + final WritableByteChannel dest = Channels.newChannel(output); + final ByteBuffer buffer = ByteBuffer.allocateDirect(16 * 1024); - while (src.read(buffer) != -1) { - buffer.flip(); - dest.write(buffer); - buffer.compact(); - } - buffer.flip(); - while (buffer.hasRemaining()) { - dest.write(buffer); - } - src.close(); - dest.close(); - } -} \ No newline at end of file + while (src.read(buffer) != -1) { + buffer.flip(); + dest.write(buffer); + buffer.compact(); + } + buffer.flip(); + while (buffer.hasRemaining()) { + dest.write(buffer); + } + src.close(); + dest.close(); + } +} diff --git a/src/main/java/org/apache/servicemix/util/jaf/ByteArrayDataSource.java b/src/main/java/org/apache/servicemix/util/jaf/ByteArrayDataSource.java index d4a9cbe..69d06aa 100644 --- a/src/main/java/org/apache/servicemix/util/jaf/ByteArrayDataSource.java +++ b/src/main/java/org/apache/servicemix/util/jaf/ByteArrayDataSource.java @@ -65,4 +65,4 @@ public String getName() { public void setName(String name) { this.name = name; } -} \ No newline at end of file +} diff --git a/src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java b/src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java index cb129f6..63f6a98 100644 --- a/src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java +++ b/src/test/java/org/apache/servicemix/components/util/DefaultFileMarshalerTest.java @@ -89,27 +89,27 @@ private MessageExchange createMockExchange() throws MessagingException { } public void testTempFileNameFromNmsg() throws Exception { - String tmp = "tmp_filename.ext_123"; - MessageExchange exchange = createMockExchange(); - exchange.getMessage("in").setContent(new StringSource(MESSAGE)); - exchange.getMessage("in").setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp); - String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in")); - assertEquals("The temp file name was not extracted correctly", tmp, tempName); + String tmp = "tmp_filename.ext_123"; + MessageExchange exchange = createMockExchange(); + exchange.getMessage("in").setContent(new StringSource(MESSAGE)); + exchange.getMessage("in").setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp); + String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in")); + assertEquals("The temp file name was not extracted correctly", tmp, tempName); } public void testTempFileNameFromExchange() throws Exception { - String tmp = "tmp_filename.ext_123"; - MessageExchange exchange = createMockExchange(); - exchange.getMessage("in").setContent(new StringSource(MESSAGE)); - exchange.setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp); - String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in")); - assertEquals("The temp file name was not extracted correctly", tmp, tempName); + String tmp = "tmp_filename.ext_123"; + MessageExchange exchange = createMockExchange(); + exchange.getMessage("in").setContent(new StringSource(MESSAGE)); + exchange.setProperty(DefaultFileMarshaler.TEMP_FILE_NAME_PROPERTY, tmp); + String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in")); + assertEquals("The temp file name was not extracted correctly", tmp, tempName); } public void testTempFileNameNull() throws Exception { - MessageExchange exchange = createMockExchange(); - exchange.getMessage("in").setContent(new StringSource(MESSAGE)); - String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in")); - assertNull("The temp file name was not null", tempName); + MessageExchange exchange = createMockExchange(); + exchange.getMessage("in").setContent(new StringSource(MESSAGE)); + String tempName = marshaler.getTempOutputName(exchange, exchange.getMessage("in")); + assertNull("The temp file name was not null", tempName); } } diff --git a/src/test/java/org/apache/servicemix/store/hazelcast/HazelcastStoreTest.java b/src/test/java/org/apache/servicemix/store/hazelcast/HazelcastStoreTest.java index 94b369b..2095e0a 100644 --- a/src/test/java/org/apache/servicemix/store/hazelcast/HazelcastStoreTest.java +++ b/src/test/java/org/apache/servicemix/store/hazelcast/HazelcastStoreTest.java @@ -81,4 +81,4 @@ public void testDistributesStoreAndLoad() throws Exception { assertNotNull(data); assertEquals(data, result); } -} \ No newline at end of file +} diff --git a/src/test/java/org/apache/servicemix/tck/mock/MockExchangeFactoryTest.java b/src/test/java/org/apache/servicemix/tck/mock/MockExchangeFactoryTest.java index 6ec4dc6..8849d46 100644 --- a/src/test/java/org/apache/servicemix/tck/mock/MockExchangeFactoryTest.java +++ b/src/test/java/org/apache/servicemix/tck/mock/MockExchangeFactoryTest.java @@ -70,4 +70,4 @@ public void testCreateRobustInOnlyExchange() throws Exception { assertNotNull(exchange.getExchangeId()); assertEquals(MockExchangeFactory.ROBUST_IN_ONLY,exchange.getPattern()); } -} \ No newline at end of file +} diff --git a/src/test/resources/org/apache/servicemix/components/util/encoding.xml b/src/test/resources/org/apache/servicemix/components/util/encoding.xml index 08e6f67..fbf538b 100644 --- a/src/test/resources/org/apache/servicemix/components/util/encoding.xml +++ b/src/test/resources/org/apache/servicemix/components/util/encoding.xml @@ -1,2 +1,2 @@ -l'élève est à l'école \ No newline at end of file +l'élève est à l'école diff --git a/src/test/resources/org/apache/servicemix/expression/expression-editor.xml b/src/test/resources/org/apache/servicemix/expression/expression-editor.xml index 0846ffa..f69527d 100644 --- a/src/test/resources/org/apache/servicemix/expression/expression-editor.xml +++ b/src/test/resources/org/apache/servicemix/expression/expression-editor.xml @@ -20,7 +20,7 @@ - - test - + + test +