This is an automated email from the ASF dual-hosted git repository.

elharo pushed a commit to branch fileutils
in repository https://gitbox.apache.org/repos/asf/maven-javadoc-plugin.git

commit 74a8e35c75d398ac053f69b5ff3a4d9a08146694
Author: Elliotte Rusty Harold <elh...@ibiblio.org>
AuthorDate: Mon Nov 18 04:32:33 2024 -0500

    Replace some deprecated FileUtils methods
---
 .../java/org/apache/maven/plugins/javadoc/JavadocUtil.java    | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java 
b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
index ecd5d77b..519a92fc 100644
--- a/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
+++ b/src/main/java/org/apache/maven/plugins/javadoc/JavadocUtil.java
@@ -269,7 +269,7 @@ public class JavadocUtil {
     }
 
     /**
-     * Convenience method that copy all <code>doc-files</code> directories 
from <code>javadocDir</code> to the
+     * Convenience method that copies all <code>doc-files</code> directories 
from <code>javadocDir</code> to the
      * <code>outputDirectory</code>.
      *
      * @param outputDirectory the output directory
@@ -299,7 +299,7 @@ public class JavadocUtil {
                 javadocDir, "resources,**/doc-files", String.join(",", 
excludes), false, true);
         for (String docFile : docFiles) {
             File docFileOutput = new File(outputDirectory, docFile);
-            FileUtils.mkdir(docFileOutput.getAbsolutePath());
+            
Files.createDirectories(Paths.get(docFileOutput.getAbsolutePath()));
             FileUtils.copyDirectoryStructure(new File(javadocDir, docFile), 
docFileOutput);
             List<String> files = FileUtils.getFileAndDirectoryNames(
                     docFileOutput, String.join(",", excludes), null, true, 
true, true, true);
@@ -851,13 +851,12 @@ public class JavadocUtil {
      *
      * @param javaFile not null
      * @param encoding could be null
-     * @return the content with unified line separator of the given javaFile 
using the given encoding.
-     * @see FileUtils#fileRead(File, String)
+     * @return the content of the given javaFile using the given encoding
      * @since 2.6.1
      */
     protected static String readFile(final File javaFile, final String 
encoding) {
         try {
-            return FileUtils.fileRead(javaFile, encoding);
+            return new String(Files.readAllBytes(javaFile.toPath()), 
Charset.forName(encoding));
         } catch (IOException e) {
             return null;
         }
@@ -875,7 +874,7 @@ public class JavadocUtil {
      *
      * @param path which can contain multiple paths separated with a colon 
(<code>:</code>) or a semi-colon
      *            (<code>;</code>), platform independent. Could be null.
-     * @return the path splitted by colon or semi-colon or <code>null</code> 
if path was <code>null</code>.
+     * @return the path split by colon or semi-colon or <code>null</code> if 
path was <code>null</code>.
      * @since 2.6.1
      */
     protected static String[] splitPath(final String path) {

Reply via email to