Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4141996

File - add copy with metadata to handle resource forks, attributes, etc.

    Details

    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      Name: rm29839 Date: 05/26/98


      This one is simple. At least two platforms, the BeOS and the MacOS, have file
      metadata. This metadata cannot be copied in a platform independent way,
      which makes it very difficult to make a backup copy of a file before writing
      the new one. (I know I can rename the file, but that is not always appropriate,
      if I intend to append, rather than rewrite fresh)

      In order to do a file copy on the MacOS, I need different code than for the
      Windows and Solaris platforms. It is my expectation that file metadata is
      going to get more common, and that a simple, universal method for copying
      data would be useful. If such a method were provided, then it would be up
      to the platform vendors to implement it in a way that properly dealt with
      resource forks, attributes, and metadata, but the individual developer
      would not have to.

      Finally, this can cover the issue of permissions on Unix platforms. If a
      program makes a copy of the file, then the permissions and owner
      could be copied as well.

      Since it is a simple method, the signature would be something like

      copy(File destination, boolean overwrite, boolean copyMetadata) throws IOException

      overwrite is not all that needed, since it is not that hard to check for
      existence first, and, in my mind, copyMetadata should be the default
      behavior all of the time, but some may complain that they do not
      always want all permissions, etc. to be copied.

      Scott
      (Review ID: 29718)
      ======================================================================

      Name: skT88420 Date: 02/03/2000


      java version "1.1.6"

      While trying to copyfiles, the developer has to use the read/write methods on
      files. This results in the destination having the latest timestamp as opposed to
      that of the original file.
      We need a mechanism that essentially results in a filecopy.
      (Review ID: 100727)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                alanb Alan Bateman
                Reporter:
                rmandelsunw Ronan Mandel (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: