@@ -1717,17 +1717,17 @@ public static Checksum checksum(File file, Checksum checksum) throws IOException
17171717 *
17181718 * @param srcDir the directory to be moved
17191719 * @param destDir the destination directory
1720- * @throws IllegalArgumentException if source or destination is <code>null</code>
1720+ * @throws NullPointerException if source or destination is <code>null</code>
17211721 * @throws IOException if source or destination is invalid
17221722 * @throws IOException if an IO error occurs moving the file
17231723 * @since Commons IO 1.4
17241724 */
17251725 public static void moveDirectory (File srcDir , File destDir ) throws IOException {
17261726 if (srcDir == null ) {
1727- throw new IllegalArgumentException ("Source must not be null" );
1727+ throw new NullPointerException ("Source must not be null" );
17281728 }
17291729 if (destDir == null ) {
1730- throw new IllegalArgumentException ("Destination must not be null" );
1730+ throw new NullPointerException ("Destination must not be null" );
17311731 }
17321732 if (!srcDir .exists ()) {
17331733 throw new FileNotFoundException ("Source '" + srcDir + "' does not exist" );
@@ -1756,17 +1756,17 @@ public static void moveDirectory(File srcDir, File destDir) throws IOException {
17561756 * @param destDir the destination file
17571757 * @param createDestDir If <code>true</code> create the destination directory,
17581758 * otherwise if <code>false</code> throw an IOException
1759- * @throws IllegalArgumentException if source or destination is <code>null</code>
1759+ * @throws NullPointerException if source or destination is <code>null</code>
17601760 * @throws IOException if source or destination is invalid
17611761 * @throws IOException if an IO error occurs moving the file
17621762 * @since Commons IO 1.4
17631763 */
17641764 public static void moveDirectoryToDirectory (File src , File destDir , boolean createDestDir ) throws IOException {
17651765 if (src == null ) {
1766- throw new IllegalArgumentException ( "Source must not be null" );
1766+ throw new NullPointerException ( "Source must not be null" );
17671767 }
17681768 if (destDir == null ) {
1769- throw new IllegalArgumentException ("Destination directory must not be null" );
1769+ throw new NullPointerException ("Destination directory must not be null" );
17701770 }
17711771 if (!destDir .exists () && createDestDir ) {
17721772 destDir .mkdirs ();
@@ -1789,17 +1789,17 @@ public static void moveDirectoryToDirectory(File src, File destDir, boolean crea
17891789 *
17901790 * @param srcFile the file to be moved
17911791 * @param destFile the destination file
1792- * @throws IllegalArgumentException if source or destination is <code>null</code>
1792+ * @throws NullPointerException if source or destination is <code>null</code>
17931793 * @throws IOException if source or destination is invalid
17941794 * @throws IOException if an IO error occurs moving the file
17951795 * @since Commons IO 1.4
17961796 */
17971797 public static void moveFile (File srcFile , File destFile ) throws IOException {
17981798 if (srcFile == null ) {
1799- throw new IllegalArgumentException ( "Source must not be null" );
1799+ throw new NullPointerException ( "Source must not be null" );
18001800 }
18011801 if (destFile == null ) {
1802- throw new IllegalArgumentException ("Destination must not be null" );
1802+ throw new NullPointerException ("Destination must not be null" );
18031803 }
18041804 if (!srcFile .exists ()) {
18051805 throw new FileNotFoundException ("Source '" + srcFile + "' does not exist" );
@@ -1831,17 +1831,17 @@ public static void moveFile(File srcFile, File destFile) throws IOException {
18311831 * @param destDir the destination file
18321832 * @param createDestDir If <code>true</code> create the destination directory,
18331833 * otherwise if <code>false</code> throw an IOException
1834- * @throws IllegalArgumentException if source or destination is <code>null</code>
1834+ * @throws NullPointerException if source or destination is <code>null</code>
18351835 * @throws IOException if source or destination is invalid
18361836 * @throws IOException if an IO error occurs moving the file
18371837 * @since Commons IO 1.4
18381838 */
18391839 public static void moveFileToDirectory (File srcFile , File destDir , boolean createDestDir ) throws IOException {
18401840 if (srcFile == null ) {
1841- throw new IllegalArgumentException ( "Source must not be null" );
1841+ throw new NullPointerException ( "Source must not be null" );
18421842 }
18431843 if (destDir == null ) {
1844- throw new IllegalArgumentException ("Destination directory must not be null" );
1844+ throw new NullPointerException ("Destination directory must not be null" );
18451845 }
18461846 if (!destDir .exists () && createDestDir ) {
18471847 destDir .mkdirs ();
@@ -1865,17 +1865,17 @@ public static void moveFileToDirectory(File srcFile, File destDir, boolean creat
18651865 * @param destDir the destination directory
18661866 * @param createDestDir If <code>true</code> create the destination directory,
18671867 * otherwise if <code>false</code> throw an IOException
1868- * @throws IllegalArgumentException if source or destination is <code>null</code>
1868+ * @throws NullPointerException if source or destination is <code>null</code>
18691869 * @throws IOException if source or destination is invalid
18701870 * @throws IOException if an IO error occurs moving the file
18711871 * @since Commons IO 1.4
18721872 */
18731873 public static void moveToDirectory (File src , File destDir , boolean createDestDir ) throws IOException {
18741874 if (src == null ) {
1875- throw new IllegalArgumentException ( "Source must not be null" );
1875+ throw new NullPointerException ( "Source must not be null" );
18761876 }
18771877 if (destDir == null ) {
1878- throw new IllegalArgumentException ("Destination must not be null" );
1878+ throw new NullPointerException ("Destination must not be null" );
18791879 }
18801880 if (!src .exists ()) {
18811881 throw new FileNotFoundException ("Source '" + src + "' does not exist" );
0 commit comments