You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/05/27 15:45:02 UTC

[GitHub] [maven-shared-utils] elharo opened a new pull request #36: [MSHARED-893] deprecate more file methods we don't need in Java 7+

elharo opened a new pull request #36:
URL: https://github.com/apache/maven-shared-utils/pull/36


   @michael-o 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-shared-utils] michael-o commented on a change in pull request #36: [MSHARED-893] deprecate more file methods we don't need in Java 7+

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #36:
URL: https://github.com/apache/maven-shared-utils/pull/36#discussion_r431262786



##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -573,10 +575,10 @@ private static boolean isValidFile( @Nonnull String file, @Nonnull String... ext
     }
 
     /**
-     * Simple way to make a directory
+     * Simple way to make a directory.
      *
      * @param dir the directory to create
-     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS.
+     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS
      * @see #INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME
      */
     public static void mkdir( @Nonnull String dir )

Review comment:
       Why didn't you deprecate this one?

##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -784,7 +792,9 @@ private static void copyFileToDirectoryIfModified( @Nonnull final File source,
      * @throws IOException  if <code>source</code> does not exist, <code>destination</code> cannot be
      *                      written to, or an IO error occurs during copying
      * @throws java.io.FileNotFoundException if <code>destination</code> is a directory
+     * @deprecated use {@code org.apache.commons.io.FileUtils.copyFile()}

Review comment:
       What about `Files#copy(Path, Path, Option...)`.

##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -913,7 +923,9 @@ public static void copyURLToFile( @Nonnull final URL source, @Nonnull final File
      *                     <li><code>destination</code> cannot be written to</li>
      *                     <li>an IO error occurs during copying</li>
      *                     </ul>
+     * @deprecated use {@code org.apache.commons.io.FileUtils.copyInputStreamToFile()}

Review comment:
       Available in `Files` too.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-shared-utils] michael-o commented on a change in pull request #36: [MSHARED-893] deprecate more file methods we don't need in Java 7+

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #36:
URL: https://github.com/apache/maven-shared-utils/pull/36#discussion_r431312220



##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -573,10 +575,10 @@ private static boolean isValidFile( @Nonnull String file, @Nonnull String... ext
     }
 
     /**
-     * Simple way to make a directory
+     * Simple way to make a directory.
      *
      * @param dir the directory to create
-     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS.
+     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS
      * @see #INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME
      */
     public static void mkdir( @Nonnull String dir )

Review comment:
       Won't Files#createDirectory()` properly fail in such a case? If so, I would rather rely on this one.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-shared-utils] elharo commented on a change in pull request #36: [MSHARED-893] deprecate more file methods we don't need in Java 7+

Posted by GitBox <gi...@apache.org>.
elharo commented on a change in pull request #36:
URL: https://github.com/apache/maven-shared-utils/pull/36#discussion_r431314890



##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -573,10 +575,10 @@ private static boolean isValidFile( @Nonnull String file, @Nonnull String... ext
     }
 
     /**
-     * Simple way to make a directory
+     * Simple way to make a directory.
      *
      * @param dir the directory to create
-     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS.
+     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS
      * @see #INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME
      */
     public static void mkdir( @Nonnull String dir )

Review comment:
       OK




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-shared-utils] michael-o commented on a change in pull request #36: [MSHARED-893] deprecate more file methods we don't need in Java 7+

Posted by GitBox <gi...@apache.org>.
michael-o commented on a change in pull request #36:
URL: https://github.com/apache/maven-shared-utils/pull/36#discussion_r431312220



##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -573,10 +575,10 @@ private static boolean isValidFile( @Nonnull String file, @Nonnull String... ext
     }
 
     /**
-     * Simple way to make a directory
+     * Simple way to make a directory.
      *
      * @param dir the directory to create
-     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS.
+     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS
      * @see #INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME
      */
     public static void mkdir( @Nonnull String dir )

Review comment:
       Won't `Files#createDirectory()` properly fail in such a case? If so, I would rather rely on this one.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [maven-shared-utils] elharo commented on a change in pull request #36: [MSHARED-893] deprecate more file methods we don't need in Java 7+

Posted by GitBox <gi...@apache.org>.
elharo commented on a change in pull request #36:
URL: https://github.com/apache/maven-shared-utils/pull/36#discussion_r431307484



##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -913,7 +923,9 @@ public static void copyURLToFile( @Nonnull final URL source, @Nonnull final File
      *                     <li><code>destination</code> cannot be written to</li>
      *                     <li>an IO error occurs during copying</li>
      *                     </ul>
+     * @deprecated use {@code org.apache.commons.io.FileUtils.copyInputStreamToFile()}

Review comment:
       done

##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -784,7 +792,9 @@ private static void copyFileToDirectoryIfModified( @Nonnull final File source,
      * @throws IOException  if <code>source</code> does not exist, <code>destination</code> cannot be
      *                      written to, or an IO error occurs during copying
      * @throws java.io.FileNotFoundException if <code>destination</code> is a directory
+     * @deprecated use {@code org.apache.commons.io.FileUtils.copyFile()}

Review comment:
       good idea, done

##########
File path: src/main/java/org/apache/maven/shared/utils/io/FileUtils.java
##########
@@ -573,10 +575,10 @@ private static boolean isValidFile( @Nonnull String file, @Nonnull String... ext
     }
 
     /**
-     * Simple way to make a directory
+     * Simple way to make a directory.
      *
      * @param dir the directory to create
-     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS.
+     * @throws IllegalArgumentException if the dir contains illegal Windows characters under Windows OS
      * @see #INVALID_CHARACTERS_FOR_WINDOWS_FILE_NAME
      */
     public static void mkdir( @Nonnull String dir )

Review comment:
       This one has some weird logic for handling file names on Windows I'm not sure is available elsewhere. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org