This is an automated email from the ASF dual-hosted git repository.
veithen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ws-axiom.git
The following commit(s) were added to refs/heads/master by this push:
new 462b17c6e Enforce consistent formatting in all components submodules
462b17c6e is described below
commit 462b17c6e49025e93aa54729b2679cc37c177e02
Author: Andreas Veithen-Knowles <[email protected]>
AuthorDate: Sat Jan 10 11:45:42 2026 +0000
Enforce consistent formatting in all components submodules
---
.../util/base64/AbstractBase64DecodingWriter.java | 43 ++++++--------
.../base64/AbstractBase64EncodingOutputStream.java | 67 +++++++++++-----------
.../apache/axiom/util/base64/Base64Constants.java | 30 ++++------
.../base64/Base64DecodingOutputStreamWriter.java | 4 +-
.../util/base64/Base64EncodingOutputStream.java | 16 +++---
.../Base64EncodingStringBufferOutputStream.java | 10 ++--
.../base64/Base64EncodingWriterOutputStream.java | 35 ++++++-----
components/blob/pom.xml | 16 ------
components/core-streams/pom.xml | 16 ------
.../org/apache/axiom/ext/io/ReadFromSupport.java | 23 ++++----
.../apache/axiom/ext/io/StreamCopyException.java | 36 ++++++------
.../java/org/apache/axiom/util/io/IOUtils.java | 24 ++++----
components/pom.xml | 11 ++++
components/xml-utils/pom.xml | 16 ------
14 files changed, 142 insertions(+), 205 deletions(-)
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64DecodingWriter.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64DecodingWriter.java
index eef3889fb..5375432c7 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64DecodingWriter.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64DecodingWriter.java
@@ -22,18 +22,16 @@ package org.apache.axiom.util.base64;
import java.io.IOException;
import java.io.Writer;
-/**
- * Base class for {@link Writer} implementations that decode data in base64.
- */
+/** Base class for {@link Writer} implementations that decode data in base64.
*/
public abstract class AbstractBase64DecodingWriter extends Writer {
private final char[] in = new char[4];
private final byte[] out = new byte[3];
private int rest; // Number of characters remaining in the in buffer
private static boolean isWhitespace(int c) {
- return c <= 32 && (c == ' ' || c == '\n' || c == '\r' || c == '\t');
+ return c <= 32 && (c == ' ' || c == '\n' || c == '\r' || c == '\t');
}
-
+
@Override
public final void write(char[] cbuf, int off, int len) throws IOException {
while (len > 0) {
@@ -55,7 +53,7 @@ public abstract class AbstractBase64DecodingWriter extends
Writer {
@Override
public final void write(int c) throws IOException {
if (!isWhitespace(c)) {
- in[rest++] = (char)c;
+ in[rest++] = (char) c;
if (rest == 4) {
decode(in, 0);
rest = 0;
@@ -74,19 +72,19 @@ public abstract class AbstractBase64DecodingWriter extends
Writer {
}
throw new IOException("Invalid base64 char '" + c + "'");
}
-
+
private void decode(char[] data, int off) throws IOException {
int outlen = 3;
- if (data[off+3] == Base64Constants.S_BASE64PAD) {
+ if (data[off + 3] == Base64Constants.S_BASE64PAD) {
outlen = 2;
}
- if (data[off+2] == Base64Constants.S_BASE64PAD) {
+ if (data[off + 2] == Base64Constants.S_BASE64PAD) {
outlen = 1;
}
int b0 = decode(data[off]);
- int b1 = decode(data[off+1]);
- int b2 = decode(data[off+2]);
- int b3 = decode(data[off+3]);
+ int b1 = decode(data[off + 1]);
+ int b2 = decode(data[off + 2]);
+ int b3 = decode(data[off + 3]);
switch (outlen) {
case 1:
out[0] = (byte) (b0 << 2 & 0xfc | b1 >> 4 & 0x3);
@@ -102,20 +100,15 @@ public abstract class AbstractBase64DecodingWriter
extends Writer {
}
doWrite(out, outlen);
}
-
+
/**
- * Write base64 decoded data. If necessary, the implementation should
- * accumulate the data in a buffer before writing it to the underlying
- * stream. The maximum number of bytes passed to this method in a single
- * call is 3.
- *
- * @param b
- * the byte array containing the data to write, starting at
- * offset 0
- * @param len
- * the number of bytes to write
- * @throws IOException
- * if an I/O error occurs
+ * Write base64 decoded data. If necessary, the implementation should
accumulate the data in a
+ * buffer before writing it to the underlying stream. The maximum number
of bytes passed to this
+ * method in a single call is 3.
+ *
+ * @param b the byte array containing the data to write, starting at
offset 0
+ * @param len the number of bytes to write
+ * @throws IOException if an I/O error occurs
*/
protected abstract void doWrite(byte[] b, int len) throws IOException;
}
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64EncodingOutputStream.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64EncodingOutputStream.java
index c8d43620b..f599bb04b 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64EncodingOutputStream.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/AbstractBase64EncodingOutputStream.java
@@ -22,9 +22,7 @@ package org.apache.axiom.util.base64;
import java.io.IOException;
import java.io.OutputStream;
-/**
- * Base class for {@link OutputStream} implementations that encode data in
base64.
- */
+/** Base class for {@link OutputStream} implementations that encode data in
base64. */
public abstract class AbstractBase64EncodingOutputStream extends OutputStream {
private final boolean ignoreFlush;
private final byte[] in = new byte[3];
@@ -34,29 +32,27 @@ public abstract class AbstractBase64EncodingOutputStream
extends OutputStream {
/**
* Constructor.
- *
- * @param ignoreFlush
- * Specifies if calls to {@link #flush()} should be ignored.
Setting this to
- * <code>true</code> is particular useful in conjunction with
- * {@code DataHandler.writeTo(OutputStream)}: that method may
call {@link #flush()}
- * after writing the data, but the call to {@code
DataHandler.writeTo(OutputStream)}
- * must be followed by a call to {@link #close()} or {@link
#complete()} which would
- * then output a single chunk with a few bytes. In some cases
this may be
- * inconvenient.
+ *
+ * @param ignoreFlush Specifies if calls to {@link #flush()} should be
ignored. Setting this to
+ * <code>true</code> is particular useful in conjunction with {@code
+ * DataHandler.writeTo(OutputStream)}: that method may call {@link
#flush()} after writing
+ * the data, but the call to {@code DataHandler.writeTo(OutputStream)}
must be followed by a
+ * call to {@link #close()} or {@link #complete()} which would then
output a single chunk
+ * with a few bytes. In some cases this may be inconvenient.
*/
public AbstractBase64EncodingOutputStream(boolean ignoreFlush) {
this.ignoreFlush = ignoreFlush;
}
-
+
/**
- * Default constructor. This constructor does the same as
- * {@link #AbstractBase64EncodingOutputStream(boolean)} with
<code>ignoreFlush</code> set to
- * <code>false</code>.
+ * Default constructor. This constructor does the same as {@link
+ * #AbstractBase64EncodingOutputStream(boolean)} with
<code>ignoreFlush</code> set to <code>
+ * false</code>.
*/
public AbstractBase64EncodingOutputStream() {
this(false);
}
-
+
@Override
public final void write(byte[] b, int off, int len) throws IOException {
if (completed) {
@@ -85,7 +81,7 @@ public abstract class AbstractBase64EncodingOutputStream
extends OutputStream {
@Override
public final void write(int b) throws IOException {
- in[rest++] = (byte)b;
+ in[rest++] = (byte) b;
if (rest == 3) {
encode(in, 0, 3);
rest = 0;
@@ -94,7 +90,7 @@ public abstract class AbstractBase64EncodingOutputStream
extends OutputStream {
/**
* Write out any pending data, including padding if necessary.
- *
+ *
* @throws IOException if an I/O error occurs
*/
public final void complete() throws IOException {
@@ -106,7 +102,7 @@ public abstract class AbstractBase64EncodingOutputStream
extends OutputStream {
completed = true;
}
}
-
+
private void encode(byte[] data, int off, int len) throws IOException {
if (len == 1) {
int i = data[off] & 0xff;
@@ -121,9 +117,10 @@ public abstract class AbstractBase64EncodingOutputStream
extends OutputStream {
out[2] = Base64Constants.S_BASE64CHAR[(i << 2) & 0x3f];
out[3] = Base64Constants.S_BASE64PAD;
} else {
- int i = ((data[off] & 0xff) << 16)
- + ((data[off + 1] & 0xff) << 8)
- + (data[off + 2] & 0xff);
+ int i =
+ ((data[off] & 0xff) << 16)
+ + ((data[off + 1] & 0xff) << 8)
+ + (data[off + 2] & 0xff);
out[0] = Base64Constants.S_BASE64CHAR[i >> 18];
out[1] = Base64Constants.S_BASE64CHAR[(i >> 12) & 0x3f];
out[2] = Base64Constants.S_BASE64CHAR[(i >> 6) & 0x3f];
@@ -145,34 +142,34 @@ public abstract class AbstractBase64EncodingOutputStream
extends OutputStream {
complete();
doClose();
}
-
+
/**
- * Write base64 encoded data. If necessary, the implementation should
accumulate
- * the data in a buffer before writing it to the underlying stream.
- *
+ * Write base64 encoded data. If necessary, the implementation should
accumulate the data in a
+ * buffer before writing it to the underlying stream.
+ *
* @param b a byte array of length 4
* @throws IOException if an I/O error occurs
*/
protected abstract void doWrite(byte[] b) throws IOException;
-
+
/**
- * Write any pending data to the underlying stream, if applicable.
- * Note that implementations should not flush the underlying stream.
- *
+ * Write any pending data to the underlying stream, if applicable. Note
that implementations
+ * should not flush the underlying stream.
+ *
* @throws IOException if an I/O error occurs
*/
protected abstract void flushBuffer() throws IOException;
-
+
/**
* Flush the underlying stream, if applicable.
- *
+ *
* @throws IOException if an I/O error occurs
*/
protected abstract void doFlush() throws IOException;
-
+
/**
* Close the underlying stream, if applicable.
- *
+ *
* @throws IOException if an I/O error occurs
*/
protected abstract void doClose() throws IOException;
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64Constants.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64Constants.java
index 18f2da4ce..341a07ec8 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64Constants.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64Constants.java
@@ -21,32 +21,26 @@ package org.apache.axiom.util.base64;
// For internal use only
class Base64Constants {
- static final byte[] S_BASE64CHAR = { 'A', 'B', 'C', 'D', 'E', 'F',
- 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S',
- 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
- 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's',
- 't', 'u', 'v', 'w', 'x', 'y', 'z', '0', '1', '2', '3', '4', '5',
- '6', '7', '8', '9', '+', '/' };
+ static final byte[] S_BASE64CHAR = {
+ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N',
'O', 'P', 'Q', 'R',
+ 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f',
'g', 'h', 'i', 'j',
+ 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x',
'y', 'z', '0', '1',
+ '2', '3', '4', '5', '6', '7', '8', '9', '+', '/'
+ };
static final byte S_BASE64PAD = '=';
- /**
- * Used in {@link #S_DECODETABLE} to indicate that a character is the
padding character.
- */
+ /** Used in {@link #S_DECODETABLE} to indicate that a character is the
padding character. */
static final byte PADDING = -1;
-
- /**
- * Used in {@link #S_DECODETABLE} to indicate that a character is white
space.
- */
+
+ /** Used in {@link #S_DECODETABLE} to indicate that a character is white
space. */
static final byte WHITE_SPACE = -2;
-
- /**
- * Used in {@link #S_DECODETABLE} to indicate that a character is invalid.
- */
+
+ /** Used in {@link #S_DECODETABLE} to indicate that a character is
invalid. */
static final byte INVALID = -3;
static final byte[] S_DECODETABLE = new byte[128];
-
+
static {
for (int i = 0; i < S_DECODETABLE.length; i++) {
S_DECODETABLE[i] = INVALID;
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64DecodingOutputStreamWriter.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64DecodingOutputStreamWriter.java
index 6d6cd91a8..e6cc30eae 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64DecodingOutputStreamWriter.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64DecodingOutputStreamWriter.java
@@ -23,8 +23,8 @@ import java.io.IOException;
import java.io.OutputStream;
/**
- * {@link java.io.Writer} implementation that decodes base64 data and writes it
- * to a an {@link OutputStream}.
+ * {@link java.io.Writer} implementation that decodes base64 data and writes
it to a an {@link
+ * OutputStream}.
*/
public class Base64DecodingOutputStreamWriter extends
AbstractBase64DecodingWriter {
private final OutputStream stream;
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingOutputStream.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingOutputStream.java
index 921815405..54830fbaa 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingOutputStream.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingOutputStream.java
@@ -23,18 +23,18 @@ import java.io.IOException;
import java.io.OutputStream;
/**
- * {@link OutputStream} implementation that writes base64 encoded data to
another
- * {@link OutputStream} using ASCII encoding. This class internally buffers
the data before writing
- * it to the underlying stream.
+ * {@link OutputStream} implementation that writes base64 encoded data to
another {@link
+ * OutputStream} using ASCII encoding. This class internally buffers the data
before writing it to
+ * the underlying stream.
*/
public class Base64EncodingOutputStream extends
AbstractBase64EncodingOutputStream {
private final OutputStream parent;
private final byte[] buffer;
private int len;
-
+
/**
* Constructor.
- *
+ *
* @param parent the stream to write the encoded data to
* @param bufferSize the buffer size to use
*/
@@ -42,10 +42,10 @@ public class Base64EncodingOutputStream extends
AbstractBase64EncodingOutputStre
this.parent = parent;
buffer = new byte[bufferSize];
}
-
+
/**
* Constructor that sets the buffer size to its default value of 4096
characters.
- *
+ *
* @param parent the stream to write the encoded data to
*/
public Base64EncodingOutputStream(OutputStream parent) {
@@ -60,7 +60,7 @@ public class Base64EncodingOutputStream extends
AbstractBase64EncodingOutputStre
System.arraycopy(b, 0, buffer, len, 4);
len += 4;
}
-
+
@Override
protected void flushBuffer() throws IOException {
parent.write(buffer, 0, len);
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingStringBufferOutputStream.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingStringBufferOutputStream.java
index f3cae1000..b5198f4d7 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingStringBufferOutputStream.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingStringBufferOutputStream.java
@@ -31,7 +31,7 @@ public class Base64EncodingStringBufferOutputStream extends
AbstractBase64Encodi
/**
* Constructor.
- *
+ *
* @param buffer the buffer to append the encoded data to
*/
public Base64EncodingStringBufferOutputStream(StringBuffer buffer) {
@@ -40,7 +40,7 @@ public class Base64EncodingStringBufferOutputStream extends
AbstractBase64Encodi
/**
* Constructor.
- *
+ *
* @param buffer the buffer to append the encoded data to
*/
public Base64EncodingStringBufferOutputStream(StringBuilder buffer) {
@@ -49,8 +49,8 @@ public class Base64EncodingStringBufferOutputStream extends
AbstractBase64Encodi
@Override
protected void doWrite(byte[] b) throws IOException {
- for (int i=0; i<4; i++) {
- buffer.append((char)(b[i] & 0xFF));
+ for (int i = 0; i < 4; i++) {
+ buffer.append((char) (b[i] & 0xFF));
}
}
@@ -58,7 +58,7 @@ public class Base64EncodingStringBufferOutputStream extends
AbstractBase64Encodi
protected void flushBuffer() throws IOException {
// Nothing to do
}
-
+
@Override
protected void doClose() throws IOException {
// Nothing to do
diff --git
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingWriterOutputStream.java
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingWriterOutputStream.java
index 31ad9dd7b..9391fabef 100644
---
a/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingWriterOutputStream.java
+++
b/components/base64-utils/src/main/java/org/apache/axiom/util/base64/Base64EncodingWriterOutputStream.java
@@ -24,45 +24,42 @@ import java.io.OutputStream;
import java.io.Writer;
/**
- * {@link OutputStream} implementation that writes base64 encoded data to a
{@link Writer}.
- * This class internally buffers the data before writing it to the underlying
stream.
+ * {@link OutputStream} implementation that writes base64 encoded data to a
{@link Writer}. This
+ * class internally buffers the data before writing it to the underlying
stream.
*/
public class Base64EncodingWriterOutputStream extends
AbstractBase64EncodingOutputStream {
private final Writer writer;
private final char[] buffer;
private int len;
-
+
/**
* Constructor.
- *
- * @param writer
- * the stream to write the encoded data to
- * @param bufferSize
- * the buffer size to use
- * @param ignoreFlush
- * specifies if calls to {@link #flush()} should be ignored; see
- * {@link
AbstractBase64EncodingOutputStream#AbstractBase64EncodingOutputStream(boolean)}
- * for more information
+ *
+ * @param writer the stream to write the encoded data to
+ * @param bufferSize the buffer size to use
+ * @param ignoreFlush specifies if calls to {@link #flush()} should be
ignored; see {@link
+ *
AbstractBase64EncodingOutputStream#AbstractBase64EncodingOutputStream(boolean)}
for more
+ * information
*/
public Base64EncodingWriterOutputStream(Writer writer, int bufferSize,
boolean ignoreFlush) {
super(ignoreFlush);
this.writer = writer;
buffer = new char[bufferSize];
}
-
+
/**
* Constructor.
- *
+ *
* @param writer the stream to write the encoded data to
* @param bufferSize the buffer size to use
*/
public Base64EncodingWriterOutputStream(Writer writer, int bufferSize) {
this(writer, bufferSize, false);
}
-
+
/**
* Constructor that sets the buffer size to its default value of 4096
characters.
- *
+ *
* @param writer the stream to write the encoded data to
*/
public Base64EncodingWriterOutputStream(Writer writer) {
@@ -74,11 +71,11 @@ public class Base64EncodingWriterOutputStream extends
AbstractBase64EncodingOutp
if (buffer.length - len < 4) {
flushBuffer();
}
- for (int i=0; i<4; i++) {
- buffer[len++] = (char)(b[i] & 0xFF);
+ for (int i = 0; i < 4; i++) {
+ buffer[len++] = (char) (b[i] & 0xFF);
}
}
-
+
@Override
protected void flushBuffer() throws IOException {
writer.write(buffer, 0, len);
diff --git a/components/blob/pom.xml b/components/blob/pom.xml
index a8d1b4590..fafa551cd 100644
--- a/components/blob/pom.xml
+++ b/components/blob/pom.xml
@@ -52,20 +52,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>
diff --git a/components/core-streams/pom.xml b/components/core-streams/pom.xml
index ca68b6ec3..2163e9c0e 100644
--- a/components/core-streams/pom.xml
+++ b/components/core-streams/pom.xml
@@ -80,20 +80,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>
diff --git
a/components/io/src/main/java/org/apache/axiom/ext/io/ReadFromSupport.java
b/components/io/src/main/java/org/apache/axiom/ext/io/ReadFromSupport.java
index ecb5863fe..d00c8841e 100644
--- a/components/io/src/main/java/org/apache/axiom/ext/io/ReadFromSupport.java
+++ b/components/io/src/main/java/org/apache/axiom/ext/io/ReadFromSupport.java
@@ -23,24 +23,23 @@ import java.io.InputStream;
/**
* Optional interface implemented by {@link java.io.OutputStream}
implementations that support
- * transferring data from an {@link InputStream}. This interface may be used
to avoid allocating
- * a temporary buffer when there is a need to copy data from an input stream
to an output stream.
+ * transferring data from an {@link InputStream}. This interface may be used
to avoid allocating a
+ * temporary buffer when there is a need to copy data from an input stream to
an output stream.
*/
public interface ReadFromSupport {
/**
- * Read data from the given input stream and write it to this output
stream.
- * The method transfers data until one of the following conditions is met:
+ * Read data from the given input stream and write it to this output
stream. The method
+ * transfers data until one of the following conditions is met:
+ *
* <ul>
* <li>The end of the input stream is reached.
- * <li>The value of the <code>length</code> argument is different from
<code>-1</code>
- * and the number of bytes transferred is equal to
<code>length</code>.
+ * <li>The value of the <code>length</code> argument is different from
<code>-1</code> and the
+ * number of bytes transferred is equal to <code>length</code>.
* </ul>
- *
- * @param inputStream
- * An input stream to read data from. This method will not
close the stream.
- * @param length
- * the number of bytes to transfer, or <code>-1</code> if the
method should
- * transfer data until the end of the input stream is reached
+ *
+ * @param inputStream An input stream to read data from. This method will
not close the stream.
+ * @param length the number of bytes to transfer, or <code>-1</code> if
the method should
+ * transfer data until the end of the input stream is reached
* @throws StreamCopyException
* @return the number of bytes transferred
*/
diff --git
a/components/io/src/main/java/org/apache/axiom/ext/io/StreamCopyException.java
b/components/io/src/main/java/org/apache/axiom/ext/io/StreamCopyException.java
index 4a81c7df1..20c457f56 100644
---
a/components/io/src/main/java/org/apache/axiom/ext/io/StreamCopyException.java
+++
b/components/io/src/main/java/org/apache/axiom/ext/io/StreamCopyException.java
@@ -23,35 +23,32 @@ import java.io.IOException;
/**
* Signals that an I/O exception occurred while copying data from an input
stream (or other data
- * source) to an output stream (or other data sink). The exception wraps the
original
- * {@link IOException} together with information about the type of operation
(read or write) that
- * failed.
+ * source) to an output stream (or other data sink). The exception wraps the
original {@link
+ * IOException} together with information about the type of operation (read or
write) that failed.
*/
public class StreamCopyException extends IOException {
private static final long serialVersionUID = -6489101119109339448L;
-
+
/**
- * Indicates that the wrapped exception was triggered while reading from
the input stream
- * (or data source).
+ * Indicates that the wrapped exception was triggered while reading from
the input stream (or
+ * data source).
*/
public static final int READ = 1;
-
+
/**
- * Indicates that the wrapped exception was triggered while writing to the
output stream
- * (or data sink).
+ * Indicates that the wrapped exception was triggered while writing to the
output stream (or
+ * data sink).
*/
public static final int WRITE = 2;
-
+
private final int operation;
-
+
/**
* Constructor.
- *
- * @param operation
- * indicates the type of operation that caused the exception;
must be {@link #READ}
- * or {@link #WRITE}
- * @param cause
- * the wrapped exception
+ *
+ * @param operation indicates the type of operation that caused the
exception; must be {@link
+ * #READ} or {@link #WRITE}
+ * @param cause the wrapped exception
*/
public StreamCopyException(int operation, IOException cause) {
super(cause);
@@ -60,7 +57,7 @@ public class StreamCopyException extends IOException {
/**
* Get information about the type of operation that fails.
- *
+ *
* @return one of {@link #READ} or {@link #WRITE}
*/
public int getOperation() {
@@ -69,7 +66,6 @@ public class StreamCopyException extends IOException {
@Override
public String getMessage() {
- return operation == READ ? "Error reading from source"
- : "Error writing to destination";
+ return operation == READ ? "Error reading from source" : "Error
writing to destination";
}
}
diff --git a/components/io/src/main/java/org/apache/axiom/util/io/IOUtils.java
b/components/io/src/main/java/org/apache/axiom/util/io/IOUtils.java
index 074dc848b..0f8cf4969 100644
--- a/components/io/src/main/java/org/apache/axiom/util/io/IOUtils.java
+++ b/components/io/src/main/java/org/apache/axiom/util/io/IOUtils.java
@@ -28,24 +28,22 @@ import org.apache.axiom.ext.io.StreamCopyException;
public final class IOUtils {
private IOUtils() {}
-
+
/**
* Copy bytes between streams. This method supports the {@link
ReadFromSupport} interface. It
* will not call {@link Closeable#close()} on either of the two streams.
- *
- * @param in
- * the stream to read bytes from
- * @param out
- * the stream to write bytes to
- * @param length
- * the maximum number of bytes to copy, or -1 to copy an
unlimited number of bytes
+ *
+ * @param in the stream to read bytes from
+ * @param out the stream to write bytes to
+ * @param length the maximum number of bytes to copy, or -1 to copy an
unlimited number of bytes
* @return the number of bytes copied
- * @throws StreamCopyException
- * if a read/write operation on one of the streams triggered
an {@link IOException}
+ * @throws StreamCopyException if a read/write operation on one of the
streams triggered an
+ * {@link IOException}
*/
- public static long copy(InputStream in, OutputStream out, long length)
throws StreamCopyException {
+ public static long copy(InputStream in, OutputStream out, long length)
+ throws StreamCopyException {
if (out instanceof ReadFromSupport) {
- return ((ReadFromSupport)out).readFrom(in, length);
+ return ((ReadFromSupport) out).readFrom(in, length);
} else {
byte[] buffer = new byte[4096];
long read = 0;
@@ -53,7 +51,7 @@ public final class IOUtils {
while (toRead > 0) {
int c;
try {
- c = in.read(buffer, 0, (int)Math.min(toRead,
buffer.length));
+ c = in.read(buffer, 0, (int) Math.min(toRead,
buffer.length));
} catch (IOException ex) {
throw new StreamCopyException(StreamCopyException.READ,
ex);
}
diff --git a/components/pom.xml b/components/pom.xml
index 74f7019f5..d26445da2 100644
--- a/components/pom.xml
+++ b/components/pom.xml
@@ -52,6 +52,17 @@
</execution>
</executions>
</plugin>
+ <plugin>
+ <groupId>com.spotify.fmt</groupId>
+ <artifactId>fmt-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <goals>
+ <goal>check</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
</plugins>
</build>
</project>
diff --git a/components/xml-utils/pom.xml b/components/xml-utils/pom.xml
index c86dd85db..e58646d45 100644
--- a/components/xml-utils/pom.xml
+++ b/components/xml-utils/pom.xml
@@ -42,20 +42,4 @@
<scope>test</scope>
</dependency>
</dependencies>
-
- <build>
- <plugins>
- <plugin>
- <groupId>com.spotify.fmt</groupId>
- <artifactId>fmt-maven-plugin</artifactId>
- <executions>
- <execution>
- <goals>
- <goal>check</goal>
- </goals>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
</project>