Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Gary Gregory committed Feb 3, 2022
2 parents f94e12b + 2ac1743 commit f8a8069
Show file tree
Hide file tree
Showing 50 changed files with 815 additions and 495 deletions.
6 changes: 4 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@ updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
day: "friday"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
interval: "weekly"
day: "friday"
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Apache Commons IO
[![Travis-CI Status](https://travis-ci.org/apache/commons-io.svg)](https://travis-ci.org/apache/commons-io)
[![GitHub Actions Status](https://github.com/apache/commons-io/workflows/Java%20CI/badge.svg)](https://github.com/apache/commons-io/actions)
[![Coverage Status](https://coveralls.io/repos/apache/commons-io/badge.svg)](https://coveralls.io/r/apache/commons-io)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/commons-io/commons-io/badge.svg)](https://maven-badges.herokuapp.com/maven-central/commons-io/commons-io/)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/commons-io/commons-io/badge.svg?gav=true)](https://maven-badges.herokuapp.com/maven-central/commons-io/commons-io/)
[![Javadocs](https://javadoc.io/badge/commons-io/commons-io/2.11.0.svg)](https://javadoc.io/doc/commons-io/commons-io/2.11.0)

The Apache Commons IO library contains utility classes, stream implementations, file filters,
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ file comparators, endian transformation classes, and much more.
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-inline</artifactId>
<version>4.1.0</version>
<version>4.3.1</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -335,17 +335,17 @@ file comparators, endian transformation classes, and much more.
<commons.scmPubUrl>https://svn.apache.org/repos/infra/websites/production/commons/content/proper/commons-io/</commons.scmPubUrl>
<commons.scmPubCheckoutDirectory>site-content</commons.scmPubCheckoutDirectory>
<commons.javadoc.java.link>${commons.javadoc8.java.link}</commons.javadoc.java.link>
<commons.javadoc.version>3.3.0</commons.javadoc.version>
<commons.javadoc.version>3.3.1</commons.javadoc.version>
<commons.checkstyle-plugin.version>3.1.2</commons.checkstyle-plugin.version>
<checkstyle.impl.version>9.2</checkstyle.impl.version>
<checkstyle.impl.version>9.2.1</checkstyle.impl.version>
<commons.jacoco.version>0.8.7</commons.jacoco.version>
<commons.surefire.version>3.0.0-M5</commons.surefire.version>
<commons.japicmp.version>0.15.3</commons.japicmp.version>
<commons.enforcer.version>3.0.0</commons.enforcer.version>
<commons.moditect.version>1.0.0.RC2</commons.moditect.version>
<spotbugs.plugin.version>4.5.0.0</spotbugs.plugin.version>
<spotbugs.impl.version>4.5.0</spotbugs.impl.version>
<jmh.version>1.33</jmh.version>
<commons.spotbugs.plugin.version>4.5.2.0</commons.spotbugs.plugin.version>
<commons.spotbugs.impl.version>4.5.3</commons.spotbugs.impl.version>
<jmh.version>1.34</jmh.version>
<japicmp.skip>false</japicmp.skip>
<jacoco.skip>${env.JACOCO_SKIP}</jacoco.skip>
<commons.release.isDistModule>true</commons.release.isDistModule>
Expand Down Expand Up @@ -478,12 +478,12 @@ file comparators, endian transformation classes, and much more.
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.plugin.version}</version>
<version>${commons.spotbugs.plugin.version}</version>
<dependencies>
<dependency>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs</artifactId>
<version>${spotbugs.impl.version}</version>
<version>${commons.spotbugs.impl.version}</version>
</dependency>
</dependencies>
<configuration>
Expand All @@ -506,7 +506,7 @@ file comparators, endian transformation classes, and much more.
<plugin>
<groupId>com.github.spotbugs</groupId>
<artifactId>spotbugs-maven-plugin</artifactId>
<version>${spotbugs.plugin.version}</version>
<version>${commons.spotbugs.plugin.version}</version>
<configuration>
<excludeFilterFile>${basedir}/spotbugs-exclude-filter.xml</excludeFilterFile>
</configuration>
Expand Down
41 changes: 34 additions & 7 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,24 @@ The <action> type attribute can be add,update,fix,remove.
<action issue="IO-751" dev="ggregory" type="fix" due-to="Gary Gregory, Richard Cyganiak">
When deleting symlinks, File/PathUtils.deleteDirectory() changes file permissions of the target.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
ReaderInputStream maps null Charset, Charset name, and CharsetEncoder to the platform default instead of throwing a NullPointerException.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
CharSequenceInputStream maps null Charset and Charset name to the platform default instead of throwing a NullPointerException.
</action>
<action dev="ggregory" type="fix" due-to="Gary Gregory">
WriterOutputStream maps null Charset, Charset name, and CharsetEncoder name to the platform default instead of throwing a NullPointerException.
</action>
<action dev="ggregory" type="fix" due-to="Chad Wilson, Gary Gregory">
FileUtils.copyURLToFile should create target parent directories and overwrite target file #319.
</action>
<action issue="IO-484" dev="ggregory" type="fix" due-to="Marcono1234, Gary Gregory">
Fix incorrect FilenameUtils Javadoc for null bytes #310.
</action>
<action issue="IO-484" dev="ggregory" type="fix" due-to="Arturo Bernal">
Change to uppercase variable constant. #323.
</action>
<!-- ADD -->
<action issue="IO-726" dev="ggregory" type="fix" due-to="shollander, Gary Gregory">
Add MemoryMappedFileInputStream #215.
Expand Down Expand Up @@ -293,33 +311,39 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add and reuse IOConsumer.forEach(T[], IOConsumer) and forEachIndexed(Stream, IOConsumer).
</action>
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add CharsetEncoders.
</action>
<action dev="ggregory" type="add" due-to="Gary Gregory">
Add CharsetDecoders.
</action>
<!-- UPDATE -->
<action dev="ggregory" type="add" due-to="Gary Gregory">
Update FileEntry to use FileTime instead of long for file time stamps.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump Maven Javadoc plugin from 3.2.0 to 3.3.0.
<action dev="ggregory" type="update" due-to="Dependabot, Gary Gregory">
Bump Maven Javadoc plugin from 3.2.0 to 3.3.1.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump spotbugs-maven-plugin from 4.2.3 to 4.5.0.0 #250, #259, #272, #274, #285, #288, #289, #305.
Bump spotbugs-maven-plugin from 4.2.3 to 4.5.2.0 #250, #259, #272, #274, #285, #288, #289, #305, #315.
</action>
<action dev="ggregory" type="update" due-to="Gary Gregory">
Bump JUnit from 5.7.2 to 5.8.0-M1.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump maven-enforcer-plugin from 3.0.0-M3 to 3.0.0 #255.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump checkstyle from 8.44 to 9.2 #256, #257, #266, #279, #292. #308.
<action dev="ggregory" type="update" due-to="Dependabot, Gary Gregory">
Bump checkstyle from 8.44 to 9.2.1 #256, #257, #266, #279, #292. #308.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump junit-bom from 5.8.0-M1 to 5.8.2 #260, #271, #275, #309.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump mockito-inline from 3.11.2 to 4.1.0 #262, #264, #282, #306
Bump mockito-inline from 3.11.2 to 4.3.1 #262, #264, #282, #306, #314.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump jmh.version from 1.32 to 1.33 #258.
Bump jmh.version from 1.32 to 1.34 #258, #316.
</action>
<action dev="ggregory" type="update" due-to="Dependabot">
Bump actions/checkout from 2.3.4 to 2.4.0 #286, #298.
Expand All @@ -333,6 +357,9 @@ The <action> type attribute can be add,update,fix,remove.
<action dev="kinow" type="update" due-to="Dependabot">
Bump actions/cache from 2.1.6 to 2.1.7 #307.
</action>
<action dev="kinow" type="update" due-to="Dependabot">
Bump spotbugs from 4.5.2 to 4.5.3 #313, #317.
</action>
</release>
<release version="2.11.0" date="2021-07-09" description="Java 8 required.">
<!-- FIX -->
Expand Down
10 changes: 6 additions & 4 deletions src/main/java/org/apache/commons/io/FileUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public static long checksumCRC32(final File file) throws IOException {
* @see #forceDelete(File)
*/
public static void cleanDirectory(final File directory) throws IOException {
IOConsumer.forEach(listFiles(directory, null), file -> forceDelete(file));
IOConsumer.forEach(listFiles(directory, null), FileUtils::forceDelete);
}

/**
Expand All @@ -354,7 +354,7 @@ public static void cleanDirectory(final File directory) throws IOException {
* @see #forceDeleteOnExit(File)
*/
private static void cleanDirectoryOnExit(final File directory) throws IOException {
IOConsumer.forEach(listFiles(directory, null), file -> forceDeleteOnExit(file));
IOConsumer.forEach(listFiles(directory, null), FileUtils::forceDeleteOnExit);
}

/**
Expand Down Expand Up @@ -1060,7 +1060,9 @@ public static void copyToFile(final InputStream inputStream, final File file) th
*/
public static void copyURLToFile(final URL source, final File destination) throws IOException {
try (final InputStream stream = source.openStream()) {
Files.copy(stream, destination.toPath());
final Path path = destination.toPath();
PathUtils.createParentDirectories(path);
Files.copy(stream, path, StandardCopyOption.REPLACE_EXISTING);
}
}

Expand Down Expand Up @@ -2449,7 +2451,7 @@ public static void moveToDirectory(final File src, final File destDir, final boo
* @since 2.12.0
*/
public static OutputStream newOutputStream(final File file, final boolean append) throws IOException {
return PathUtils.newOutputStream(file.toPath(), append);
return PathUtils.newOutputStream(Objects.requireNonNull(file, "file").toPath(), append);
}

/**
Expand Down
Loading

0 comments on commit f8a8069

Please sign in to comment.