Author: norman
Date: Tue Sep 7 16:58:39 2010
New Revision: 993426
URL: http://svn.apache.org/viewvc?rev=993426&view=rev
Log:
Remove some not needed classes which are mostly left-over from old james
versions
Removed:
james/server/trunk/common-util/src/main/java/org/apache/james/util/io/AndFileFilter.java
james/server/trunk/common-util/src/main/java/org/apache/james/util/io/IOUtil.java
james/server/trunk/common-util/src/main/java/org/apache/james/util/io/InvertedFileFilter.java
james/server/trunk/common-util/src/main/java/org/apache/james/util/io/ResettableFileInputStream.java
james/server/trunk/common-util/src/main/java/org/apache/james/util/stream/DotStuffingInputStream.java
Modified:
james/server/trunk/core-library/pom.xml
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageUtil.java
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageWrapper.java
Modified: james/server/trunk/core-library/pom.xml
URL:
http://svn.apache.org/viewvc/james/server/trunk/core-library/pom.xml?rev=993426&r1=993425&r2=993426&view=diff
==============================================================================
--- james/server/trunk/core-library/pom.xml (original)
+++ james/server/trunk/core-library/pom.xml Tue Sep 7 16:58:39 2010
@@ -53,7 +53,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</dependency>
-
+ <dependency>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </dependency>
<dependency>
<groupId>${javax.mail.groupId}</groupId>
<artifactId>${javax.mail.artifactId}</artifactId>
Modified:
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageUtil.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageUtil.java?rev=993426&r1=993425&r2=993426&view=diff
==============================================================================
---
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageUtil.java
(original)
+++
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageUtil.java
Tue Sep 7 16:58:39 2010
@@ -20,8 +20,8 @@
package org.apache.james.core;
+import org.apache.commons.io.IOUtils;
import org.apache.james.util.InternetPrintWriter;
-import org.apache.james.util.io.IOUtil;
import javax.activation.UnsupportedDataTypeException;
import javax.mail.MessagingException;
@@ -174,33 +174,14 @@ public class MimeMessageUtil {
}
try {
- copyStream(bis, bos);
+ IOUtils.copy(bis, bos);
}
finally {
- IOUtil.shutdownStream(bis);
+ IOUtils.closeQuietly(bis);
}
}
/**
- * Convenience method to copy streams
- *
- * @param in the InputStream used as copy source
- * @param out the OutputStram used as copy destination
- * @throws IOException
- */
- public static void copyStream(InputStream in, OutputStream out) throws
IOException {
- // TODO: This is really a bad way to do this sort of thing. A shared
buffer to
- // allow simultaneous read/writes would be a substantial
improvement
- byte[] block = new byte[1024];
- int read = 0;
- while ((read = in.read(block)) > -1) {
- out.write(block, 0, read);
- }
- out.flush();
- }
-
-
- /**
* Write the message headers to the given outputstream
*
* @param message the MimeMessage to read from
Modified:
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageWrapper.java
URL:
http://svn.apache.org/viewvc/james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageWrapper.java?rev=993426&r1=993425&r2=993426&view=diff
==============================================================================
---
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageWrapper.java
(original)
+++
james/server/trunk/core-library/src/main/java/org/apache/james/core/MimeMessageWrapper.java
Tue Sep 7 16:58:39 2010
@@ -21,10 +21,10 @@
package org.apache.james.core;
+import org.apache.commons.io.IOUtils;
import org.apache.james.lifecycle.Disposable;
import org.apache.james.lifecycle.LifecycleUtil;
import org.apache.james.util.InternetPrintWriter;
-import org.apache.james.util.io.IOUtil;
import javax.activation.DataHandler;
import javax.mail.MessagingException;
@@ -179,7 +179,7 @@ public class MimeMessageWrapper
try {
headers = createInternetHeaders(in);
} finally {
- IOUtil.shutdownStream(in);
+ IOUtils.closeQuietly(in);
}
} catch (IOException ioe) {
throw new MessagingException("Unable to parse headers from
stream: " + ioe.getMessage(), ioe);
@@ -209,7 +209,7 @@ public class MimeMessageWrapper
saved = true;
} catch (IOException ioe) {
- IOUtil.shutdownStream(sourceIn);
+ IOUtils.closeQuietly(sourceIn);
sourceIn = null;
throw new MessagingException("Unable to parse stream: " +
ioe.getMessage(), ioe);
}
@@ -236,9 +236,9 @@ public class MimeMessageWrapper
// and write to this outputstream
InputStream in = source.getInputStream();
try {
- MimeMessageUtil.copyStream(in, os);
+ IOUtils.copy(in, os);
} finally {
- IOUtil.shutdownStream(in);
+ IOUtils.closeQuietly(in);
}
} else {
writeTo(os, os);
@@ -275,9 +275,9 @@ public class MimeMessageWrapper
}
pos.println();
pos.flush();
- MimeMessageUtil.copyStream(in, bodyOs);
+ IOUtils.copy(in, bodyOs);
} finally {
- IOUtil.shutdownStream(in);
+ IOUtils.closeQuietly(in);
}
} else {
MimeMessageUtil.writeToInternal(this, headerOs, bodyOs,
ignoreList);
@@ -329,7 +329,7 @@ public class MimeMessageWrapper
} catch (IOException ioe) {
return -1;
} finally {
- IOUtil.shutdownStream(in);
+ IOUtils.closeQuietly(in);
}
}
@@ -463,7 +463,7 @@ public class MimeMessageWrapper
*/
public void dispose() {
if (sourceIn != null) {
- IOUtil.shutdownStream(sourceIn);
+ IOUtils.closeQuietly(sourceIn);
}
if (source != null) {
LifecycleUtil.dispose(source);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]