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

FileSystem should be a platform-specific class to avoid native code

XMLWordPrintable

    • b64
    • generic
    • solaris_2.6
    • Not verified

      Subject: Re: FileSystem.getFileSystem()
         Date: Wed, 19 May 1999 15:09:40 -0700
         From: Mark Reinhold <###@###.###>
           To: Dean Long <###@###.###>

      > Mark, is there any reason why this couldn't be a Java method that did
      > Class.forName/newInstance on a "filesystem.class" property, similar
      > to AWT's "awt.toolkit" and java.net's "impl.prefix"? It would be one
      > less native method. If "impl.prefix" is not meant to be java.net only,
      > then I suppose you could also use it as "java.io." + impl_prefix +
      > "FileSystem" to get the filesystem class.

      Actually we can do even better than that by having the platform-specific
      filesystem class just be named java.io.FileSystem in the first place and doing
      away with the indirection. It's a pretty simple set of changes. File an RFE
      and I'll assign someone to do it for Kestrel fcs (it's too late for beta).

      - Mark


      dean.long@Eng 1999-05-19

      If we make this class platform-specific, then I think that we can also
      make all the methods static and avoid making an instance of it.

      In addition, it would be nice if platform-specific class naming (java.*
      vs. sun.*) and lookup (native method vs. property vs. Java file in
      src/<platform>/classes) was handled consistently. For example, consider
      the different ways Runtime.execInternal gets a platform Process,
      Toolkit.getDefaultToolkit() gets a platform Toolkit, InetAddress and
      DatagramSocket get a InetAdressImpl and DatagramSocketImpl.
      There are probably more examples, and they are probably all different.

      dean.long@Eng 1999-05-21

            dxu Dan Xu (Inactive)
            dlong Dean Long
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: