Javadoc. Use the same param names as the JDK to avoid confusion.
MODIFY
src/main/java/org/apache/commons/io/output/LockableFileWriter.java
src/main/java/org/apache/commons/io/output/LockableFileWriter.java
* <p>
* This class provides a simple alternative to <code>FileWriter</code>
* that will use a lock file to prevent duplicate writes.
+ * </p>
* <p>
- * <b>N.B.</b> the lock file is deleted when {@link #close()} is called
+ * <b>Note:</b> The lock file is deleted when {@link #close()} is called
* - or if the main file cannot be opened initially.
* In the (unlikely) event that the lock file cannot be deleted,
* this is not reported, and subsequent requests using
* the same lock file will fail.
+ * </p>
* <p>
* By default, the file will be overwritten, but this may be changed to append.
* The lock directory may be specified, but defaults to the system property
* <code>java.io.tmpdir</code>.
* The encoding may also be specified, and defaults to the platform default.
- *
+ * </p>
*/
public class LockableFileWriter extends Writer {
// Cannot extend ProxyWriter, as requires writer to be
/** The writer to decorate. */
private final Writer out;
+
/** The lock file. */
private final File lockFile;
@@ -217,7 +220,6 @@ public LockableFileWriter(final File file, final String charsetName, final boole
this(file, Charsets.toCharset(charsetName), append, lockDir);
}
- //-----------------------------------------------------------------------
/**
* Tests that we can write to the lock directory.
*
@@ -252,7 +254,7 @@ private void createLock() throws IOException {
}
/**
- * Initialize the wrapped file writer.
+ * Initializes the wrapped file writer.
* Ensure that a cleanup occurs if the writer creation fails.
*
* @param file the file to be accessed
@@ -276,7 +278,6 @@ private Writer initWriter(final File file, final Charset charset, final boolean
}
}
- //-----------------------------------------------------------------------
/**
* Closes the file writer and deletes the lock file (if possible).
*
@@ -291,41 +292,40 @@ public void close() throws IOException {
}
}
- //-----------------------------------------------------------------------
/**
- * Write a character.
- * @param idx the character to write
+ * Writes a character.
+ * @param c the character to write
* @throws IOException if an I/O error occurs
*/
@Override
- public void write(final int idx) throws IOException {
- out.write(idx);
+ public void write(final int c) throws IOException {
+ out.write(c);
}
/**
- * Write the characters from an array.
- * @param chr the characters to write
+ * Writes the characters from an array.
+ * @param cbuf the characters to write
* @throws IOException if an I/O error occurs
*/
@Override
- public void write(final char[] chr) throws IOException {
- out.write(chr);
+ public void write(final char[] cbuf) throws IOException {
+ out.write(cbuf);
}
/**
- * Write the specified characters from an array.
- * @param chr the characters to write
- * @param st The start offset
- * @param end The number of characters to write
+ * Writes the specified characters from an array.
+ * @param cbuf the characters to write
+ * @param off The start offset
+ * @param len The number of characters to write
* @throws IOException if an I/O error occurs
*/
@Override
- public void write(final char[] chr, final int st, final int end) throws IOException {
- out.write(chr, st, end);
+ public void write(final char[] cbuf, final int off, final int len) throws IOException {
+ out.write(cbuf, off, len);
}
/**
- * Write the characters from a string.
+ * Writes the characters from a string.
* @param str the string to write
* @throws IOException if an I/O error occurs
*/
@@ -335,19 +335,19 @@ public void write(final String str) throws IOException {
}
/**
- * Write the specified characters from a string.
+ * Writes the specified characters from a string.
* @param str the string to write
- * @param st The start offset
- * @param end The number of characters to write
+ * @param off The start offset
+ * @param len The number of characters to write
* @throws IOException if an I/O error occurs
*/
@Override
- public void write(final String str, final int st, final int end) throws IOException {
- out.write(str, st, end);
+ public void write(final String str, final int off, final int len) throws IOException {
+ out.write(str, off, len);
}
/**
- * Flush the stream.
+ * Flushes the stream.
* @throws IOException if an I/O error occurs
*/
@Override

Javadoc. Use the same param names as the JDK to avoid confusion.