Author: ningjiang
Date: Sun Jul 27 20:36:21 2008
New Revision: 680242
URL: http://svn.apache.org/viewvc?rev=680242&view=rev
Log:
Fixed some cs errors
Modified:
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpUtils.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
activemq/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
Modified:
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java
Sun Jul 27 20:36:21 2008
@@ -21,13 +21,10 @@
import java.util.concurrent.ScheduledExecutorService;
import org.apache.camel.Processor;
-import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.util.ObjectHelper;
import org.apache.camel.component.file.FileComponent;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.commons.net.ftp.FTPClient;
-import org.apache.commons.net.ftp.FTPConnectionClosedException;
import org.apache.commons.net.ftp.FTPFile;
public class FtpConsumer extends RemoteFileConsumer<RemoteFileExchange> {
@@ -68,8 +65,8 @@
disconnect();
} catch (Exception e) {
// ignore just log a warning
- LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
}
super.doStop();
}
@@ -114,11 +111,11 @@
} catch (Exception e) {
if (isStopping() || isStopped()) {
// if we are stopping then ignore any exception during a poll
- LOG.warn( "Consumer is stopping. Ignoring caught exception: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Consumer is stopping. Ignoring caught exception: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
} else {
- LOG.warn("Exception occured during polling: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during polling: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
disconnect();
// Rethrow to signify that we didn't poll
throw e;
@@ -219,7 +216,7 @@
String originalName = ftpFile.getName();
String newName = originalName + ".camelExclusiveRead";
boolean exclusive = false;
- while (! exclusive) {
+ while (!exclusive) {
exclusive = client.rename(originalName, newName);
if (exclusive) {
if (LOG.isDebugEnabled()) {
Modified:
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpProducer.java
Sun Jul 27 20:36:21 2008
@@ -50,11 +50,11 @@
} catch (Exception e) {
if (isStopping() || isStopped()) {
// if we are stopping then ignore any exception during a poll
- LOG.warn( "Producer is stopping. Ignoring caught exception: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Producer is stopping. Ignoring caught exception: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
} else {
- LOG.warn("Exception occured during processing: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during processing: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
disconnect();
// Rethrow to signify that we didn't poll
throw e;
@@ -121,8 +121,8 @@
disconnect();
} catch (Exception e) {
// ignore just log a warning
- LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
}
super.doStop();
}
Modified:
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpUtils.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpUtils.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpUtils.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpUtils.java
Sun Jul 27 20:36:21 2008
@@ -23,7 +23,7 @@
/**
* Utility methods for FTP.
*/
-public class FtpUtils {
+public final class FtpUtils {
private FtpUtils() {
}
Modified:
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java
Sun Jul 27 20:36:21 2008
@@ -18,8 +18,8 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.util.concurrent.ScheduledExecutorService;
import java.util.Vector;
+import java.util.concurrent.ScheduledExecutorService;
import com.jcraft.jsch.ChannelSftp;
import com.jcraft.jsch.JSchException;
@@ -68,8 +68,8 @@
disconnect();
} catch (Exception e) {
// ignore just log a warning
- LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
}
super.doStop();
}
@@ -127,11 +127,11 @@
} catch (Exception e) {
if (isStopping() || isStopped()) {
// if we are stopping then ignore any exception during a poll
- LOG.warn( "Consumer is stopping. Ignoring caught exception: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Consumer is stopping. Ignoring caught exception: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
} else {
- LOG.warn("Exception occured during polling: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during polling: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
disconnect();
// Rethrow to signify that we didn't poll
throw e;
@@ -229,7 +229,7 @@
String originalName = sftpFile.getFilename();
String newName = originalName + ".camelExclusiveRead";
boolean exclusive = false;
- while (! exclusive) {
+ while (!exclusive) {
try {
channel.rename(originalName, newName);
exclusive = true;
Modified:
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpProducer.java
Sun Jul 27 20:36:21 2008
@@ -53,11 +53,11 @@
} catch (Exception e) {
if (isStopping() || isStopped()) {
// if we are stopping then ignore any exception during a poll
- LOG.warn( "Producer is stopping. Ignoring caught exception: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Producer is stopping. Ignoring caught exception: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
} else {
- LOG.warn("Exception occured during processing: " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during processing: "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
disconnect();
// Rethrow to signify that we didn't poll
throw e;
@@ -132,8 +132,8 @@
disconnect();
} catch (Exception e) {
// ignore just log a warning
- LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". " +
- e.getClass().getCanonicalName() + " message: " +
e.getMessage());
+ LOG.warn("Exception occured during disconecting from " +
remoteServer() + ". "
+ + e.getClass().getCanonicalName() + " message: " +
e.getMessage());
}
super.doStop();
}
Modified:
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildDirectoryTest.java
Sun Jul 27 20:36:21 2008
@@ -18,12 +18,11 @@
import java.io.File;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.converter.IOConverter;
import org.apache.camel.component.file.FileComponent;
+import org.apache.camel.converter.IOConverter;
/**
- * Unit test to verify that Camel can build remote directory on FTP server if
missing (full or part of).
+ * Unit test to verify that Camel can build remote directory on FTP server if
missing (full or part of).
*/
public class FtpProducerBuildDirectoryTest extends FtpServerTestSupport {
Modified:
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
(original)
+++
activemq/camel/trunk/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/FtpProducerBuildPartOfDirectoryTest.java
Sun Jul 27 20:36:21 2008
@@ -18,9 +18,8 @@
import java.io.File;
-import org.apache.camel.ContextTestSupport;
-import org.apache.camel.converter.IOConverter;
import org.apache.camel.component.file.FileComponent;
+import org.apache.camel.converter.IOConverter;
/**
* Unit test to verify that Camel can build remote directory on FTP server if
missing (full or part of).
Modified:
activemq/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
URL:
http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java?rev=680242&r1=680241&r2=680242&view=diff
==============================================================================
---
activemq/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
(original)
+++
activemq/camel/trunk/components/camel-xstream/src/test/java/org/apache/camel/dataformat/xstream/MarshalListTest.java
Sun Jul 27 20:36:21 2008
@@ -33,7 +33,7 @@
public void testMarshalList() throws Exception {
MockEndpoint mock = getMockEndpoint("mock:result");
mock.expectedMessageCount(1);
- mock.expectedBodiesReceived( "<?xml version='1.0' encoding='UTF-8'?>"
+ mock.expectedBodiesReceived("<?xml version='1.0' encoding='UTF-8'?>"
+ "<list><string>Hello World</string></list>");
List<String> body = new ArrayList<String>();