commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1299815 - in /commons/proper/io/trunk/src/main/java/org/apache/commons/io: FileUtils.java input/CharSequenceInputStream.java input/ReaderInputStream.java
Date Mon, 12 Mar 2012 20:03:46 GMT
Author: ggregory
Date: Mon Mar 12 20:03:46 2012
New Revision: 1299815

URL: http://svn.apache.org/viewvc?rev=1299815&view=rev
Log:
Javadoc, Checkstyle. More precise throw clause in private method.

Modified:
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
    commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReaderInputStream.java

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java?rev=1299815&r1=1299814&r2=1299815&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java (original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/FileUtils.java Mon Mar 12
20:03:46 2012
@@ -480,20 +480,26 @@ public class FileUtils {
         }
     }
 
+    /**
+     * Returns a filter that accepts files in addition to the {@link File} objects accepted
by the given filter.
+     * 
+     * @param fileFilter a base filter to add to
+     * @return a filter that accepts files 
+     */
     private static IOFileFilter setUpEffectiveFileFilter(IOFileFilter fileFilter) {
         return FileFilterUtils.and(fileFilter, FileFilterUtils.notFileFilter(DirectoryFileFilter.INSTANCE));
     }
 
-	private static IOFileFilter setUpEffectiveDirFilter(IOFileFilter dirFilter) {
-		IOFileFilter effDirFilter;
-        if (dirFilter == null) {
-            effDirFilter = FalseFileFilter.INSTANCE;
-        } else {
-            effDirFilter = FileFilterUtils.and(dirFilter,
+    /**
+     * Returns a filter that accepts directories in addition to the {@link File} objects
accepted by the given filter.
+     * 
+     * @param dirFilter a base filter to add to
+     * @return a filter that accepts directories 
+     */
+    private static IOFileFilter setUpEffectiveDirFilter(IOFileFilter dirFilter) {
+        return dirFilter == null ? FalseFileFilter.INSTANCE : FileFilterUtils.and(dirFilter,
                 DirectoryFileFilter.INSTANCE);
-        }
-        return effDirFilter;
-	}
+    }
 
     /**
      * Finds files within a given directory (and optionally its
@@ -571,10 +577,9 @@ public class FileUtils {
      * @see org.apache.commons.io.filefilter.FileFilterUtils
      * @see org.apache.commons.io.filefilter.NameFileFilter
      */
-	public static Iterator<File> iterateFilesAndDirs(
-			File directory,	IOFileFilter fileFilter, IOFileFilter dirFilter) {
-		return listFilesAndDirs(directory, fileFilter, dirFilter).iterator();
-	}
+    public static Iterator<File> iterateFilesAndDirs(File directory, IOFileFilter fileFilter,
IOFileFilter dirFilter) {
+        return listFilesAndDirs(directory, fileFilter, dirFilter).iterator();
+    }
 
     //-----------------------------------------------------------------------
     /**

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java?rev=1299815&r1=1299814&r2=1299815&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
Mon Mar 12 20:03:46 2012
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.nio.ByteBuffer;
 import java.nio.CharBuffer;
+import java.nio.charset.CharacterCodingException;
 import java.nio.charset.Charset;
 import java.nio.charset.CharsetEncoder;
 import java.nio.charset.CoderResult;
@@ -93,7 +94,13 @@ public class CharSequenceInputStream ext
         this(s, charset, 2048);
     }
 
-    private void fillBuffer() throws IOException {
+    /**
+     * Fills the byte output buffer from the input char buffer.
+     * 
+     * @throws CharacterCodingException
+     *             an error encoding data
+     */
+    private void fillBuffer() throws CharacterCodingException {
         this.bbuf.compact();
         CoderResult result = this.encoder.encode(this.cbuf, this.bbuf, true);
         if (result.isError()) {

Modified: commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
URL: http://svn.apache.org/viewvc/commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReaderInputStream.java?rev=1299815&r1=1299814&r2=1299815&view=diff
==============================================================================
--- commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
(original)
+++ commons/proper/io/trunk/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
Mon Mar 12 20:03:46 2012
@@ -182,6 +182,12 @@ public class ReaderInputStream extends I
         this(reader, Charset.defaultCharset());
     }
 
+    /**
+     * Fills the internal char buffer from the reader.
+     * 
+     * @throws IOException
+     *             If an I/O error occurs
+     */
     private void fillBuffer() throws IOException {
         if (!endOfInput && (lastCoderResult == null || lastCoderResult.isUnderflow()))
{
             encoderIn.compact();



Mime
View raw message