Home | History | Annotate | Download | only in io

Lines Matching defs:destDir

553      * @param destDir  the directory to place the copy in, must not be <code>null</code>
560 public static void copyFileToDirectory(File srcFile, File destDir) throws IOException {
561 copyFileToDirectory(srcFile, destDir, true);
573 * @param destDir the directory to place the copy in, must not be <code>null</code>
583 public static void copyFileToDirectory(File srcFile, File destDir, boolean preserveFileDate) throws IOException {
584 if (destDir == null) {
587 if (destDir.exists() && destDir.isDirectory() == false) {
588 throw new IllegalArgumentException("Destination '" + destDir + "' is not a directory");
590 copyFile(srcFile, new File(destDir, srcFile.getName()), preserveFileDate);
705 * @param destDir the directory to place the copy in, must not be <code>null</code>
712 public static void copyDirectoryToDirectory(File srcDir, File destDir) throws IOException {
717 throw new IllegalArgumentException("Source '" + destDir + "' is not a directory");
719 if (destDir == null) {
722 if (destDir.exists() && destDir.isDirectory() == false) {
723 throw new IllegalArgumentException("Destination '" + destDir + "' is not a directory");
725 copyDirectory(srcDir, new File(destDir, srcDir.getName()), true);
740 * @param destDir the new directory, must not be <code>null</code>
748 public static void copyDirectory(File srcDir, File destDir) throws IOException {
749 copyDirectory(srcDir, destDir, true);
763 * @param destDir the new directory, must not be <code>null</code>
772 public static void copyDirectory(File srcDir, File destDir,
774 copyDirectory(srcDir, destDir, null, preserveFileDate);
790 * FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY);
803 * FileUtils.copyDirectory(srcDir, destDir, filter);
807 * @param destDir the new directory, must not be <code>null</code>
816 public static void copyDirectory(File srcDir, File destDir,
818 copyDirectory(srcDir, destDir, filter, true);
834 * FileUtils.copyDirectory(srcDir, destDir, DirectoryFileFilter.DIRECTORY, false);
847 * FileUtils.copyDirectory(srcDir, destDir, filter, false);
851 * @param destDir the new directory, must not be <code>null</code>
861 public static void copyDirectory(File srcDir, File destDir,
866 if (destDir == null) {
875 if (srcDir.getCanonicalPath().equals(destDir.getCanonicalPath())) {
876 throw new IOException("Source '" + srcDir + "' and destination '" + destDir + "' are the same");
881 if (destDir.getCanonicalPath().startsWith(srcDir.getCanonicalPath())) {
886 File copiedFile = new File(destDir, srcFiles[i].getName());
891 doCopyDirectory(srcDir, destDir, filter, preserveFileDate, exclusionList);
898 * @param destDir the validated destination directory, must not be <code>null</code>
905 private static void doCopyDirectory(File srcDir, File destDir, FileFilter filter,
907 if (destDir.exists()) {
908 if (destDir.isDirectory() == false) {
909 throw new IOException("Destination '" + destDir + "' exists but is not a directory");
912 if (destDir.mkdirs() == false) {
913 throw new IOException("Destination '" + destDir + "' directory cannot be created");
916 destDir.setLastModified(srcDir.lastModified());
919 if (destDir.canWrite() == false) {
920 throw new IOException("Destination '" + destDir + "' cannot be written to");
928 File copiedFile = new File(destDir, files[i].getName());
1723 * @param destDir the destination directory
1729 public static void moveDirectory(File srcDir, File destDir) throws IOException {
1733 if (destDir == null) {
1742 if (destDir.exists()) {
1743 throw new IOException("Destination '" + destDir + "' already exists");
1745 boolean rename = srcDir.renameTo(destDir);
1747 copyDirectory( srcDir, destDir );
1751 "' after copy to '" + destDir + "'");
1760 * @param destDir the destination file
1768 public static void moveDirectoryToDirectory(File src, File destDir, boolean createDestDir) throws IOException {
1772 if (destDir == null) {
1775 if (!destDir.exists() && createDestDir) {
1776 destDir.mkdirs();
1778 if (!destDir.exists()) {
1779 throw new FileNotFoundException("Destination directory '" + destDir +
1782 if (!destDir.isDirectory()) {
1783 throw new IOException("Destination '" + destDir + "' is not a directory");
1785 moveDirectory(src, new File(destDir, src.getName()));
1835 * @param destDir the destination file
1843 public static void moveFileToDirectory(File srcFile, File destDir, boolean createDestDir) throws IOException {
1847 if (destDir == null) {
1850 if (!destDir.exists() && createDestDir) {
1851 destDir.mkdirs();
1853 if (!destDir.exists()) {
1854 throw new FileNotFoundException("Destination directory '" + destDir +
1857 if (!destDir.isDirectory()) {
1858 throw new IOException("Destination '" + destDir + "' is not a directory");
1860 moveFile(srcFile, new File(destDir, srcFile.getName()));
1869 * @param destDir the destination directory
1877 public static void moveToDirectory(File src, File destDir, boolean createDestDir) throws IOException {
1881 if (destDir == null) {
1888 moveDirectoryToDirectory(src, destDir, createDestDir);
1890 moveFileToDirectory(src, destDir, createDestDir);