File.copyTo(File) to simply copy a file to specified directory

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Duplicate
    • Priority: P5
    • None
    • Affects Version/s: 6
    • Component/s: core-libs
    • x86
    • windows_xp

      A DESCRIPTION OF THE REQUEST :
      It would be incredibly nice to have a copyTo feature added to the File (Java.io.File) class that function like this:

      File file = new File("the directory");
      File fileDest = new File("the destination directory");
      file.copyTo(fileDest);

      That would be very very good for all of us developers

      JUSTIFICATION :
      it would drastically shorten code lengths and also make the programming process much better

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      make a copy of the selected file and paste it in the specified directory
      ACTUAL -
      see above^

      ---------- BEGIN SOURCE ----------
      import java.io.File;

      try
      {
            File file = new File("the directory");
            File fileDest = new File("the destination directory");
            file.copyTo(fileDest);
         }
      catch(Exception e)
         {
            System.err.println("Error!");
         }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      write a really long unneccessary code i guess....

            Assignee:
            Alan Bateman
            Reporter:
            Nelson Dcosta (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: