Skip to content

Commit 027d941

Browse files
committed
Javadoc, Checkstyle. More precise throw clause in private method.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/io/trunk@1299815 13f79535-47bb-0310-9956-ffa450edef68
1 parent 3278b1b commit 027d941

3 files changed

Lines changed: 32 additions & 14 deletions

File tree

src/main/java/org/apache/commons/io/FileUtils.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -480,20 +480,26 @@ private static void validateListFilesParameters(File directory, IOFileFilter fil
480480
}
481481
}
482482

483+
/**
484+
* Returns a filter that accepts files in addition to the {@link File} objects accepted by the given filter.
485+
*
486+
* @param fileFilter a base filter to add to
487+
* @return a filter that accepts files
488+
*/
483489
private static IOFileFilter setUpEffectiveFileFilter(IOFileFilter fileFilter) {
484490
return FileFilterUtils.and(fileFilter, FileFilterUtils.notFileFilter(DirectoryFileFilter.INSTANCE));
485491
}
486492

487-
private static IOFileFilter setUpEffectiveDirFilter(IOFileFilter dirFilter) {
488-
IOFileFilter effDirFilter;
489-
if (dirFilter == null) {
490-
effDirFilter = FalseFileFilter.INSTANCE;
491-
} else {
492-
effDirFilter = FileFilterUtils.and(dirFilter,
493+
/**
494+
* Returns a filter that accepts directories in addition to the {@link File} objects accepted by the given filter.
495+
*
496+
* @param dirFilter a base filter to add to
497+
* @return a filter that accepts directories
498+
*/
499+
private static IOFileFilter setUpEffectiveDirFilter(IOFileFilter dirFilter) {
500+
return dirFilter == null ? FalseFileFilter.INSTANCE : FileFilterUtils.and(dirFilter,
493501
DirectoryFileFilter.INSTANCE);
494-
}
495-
return effDirFilter;
496-
}
502+
}
497503

498504
/**
499505
* Finds files within a given directory (and optionally its
@@ -571,10 +577,9 @@ public static Iterator<File> iterateFiles(
571577
* @see org.apache.commons.io.filefilter.FileFilterUtils
572578
* @see org.apache.commons.io.filefilter.NameFileFilter
573579
*/
574-
public static Iterator<File> iterateFilesAndDirs(
575-
File directory, IOFileFilter fileFilter, IOFileFilter dirFilter) {
576-
return listFilesAndDirs(directory, fileFilter, dirFilter).iterator();
577-
}
580+
public static Iterator<File> iterateFilesAndDirs(File directory, IOFileFilter fileFilter, IOFileFilter dirFilter) {
581+
return listFilesAndDirs(directory, fileFilter, dirFilter).iterator();
582+
}
578583

579584
//-----------------------------------------------------------------------
580585
/**

src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.io.InputStream;
2222
import java.nio.ByteBuffer;
2323
import java.nio.CharBuffer;
24+
import java.nio.charset.CharacterCodingException;
2425
import java.nio.charset.Charset;
2526
import java.nio.charset.CharsetEncoder;
2627
import java.nio.charset.CoderResult;
@@ -93,7 +94,13 @@ public CharSequenceInputStream(final CharSequence s, final String charset) {
9394
this(s, charset, 2048);
9495
}
9596

96-
private void fillBuffer() throws IOException {
97+
/**
98+
* Fills the byte output buffer from the input char buffer.
99+
*
100+
* @throws CharacterCodingException
101+
* an error encoding data
102+
*/
103+
private void fillBuffer() throws CharacterCodingException {
97104
this.bbuf.compact();
98105
CoderResult result = this.encoder.encode(this.cbuf, this.bbuf, true);
99106
if (result.isError()) {

src/main/java/org/apache/commons/io/input/ReaderInputStream.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,12 @@ public ReaderInputStream(Reader reader) {
182182
this(reader, Charset.defaultCharset());
183183
}
184184

185+
/**
186+
* Fills the internal char buffer from the reader.
187+
*
188+
* @throws IOException
189+
* If an I/O error occurs
190+
*/
185191
private void fillBuffer() throws IOException {
186192
if (!endOfInput && (lastCoderResult == null || lastCoderResult.isUnderflow())) {
187193
encoderIn.compact();

0 commit comments

Comments
 (0)