src/java.base/windows/classes/sun/nio/fs/WindowsUserDefinedFileAttributeView.java

Print this page
rev 12972 : 8140606: Update library code to use internal Unsafe
Reviewed-by: duke


  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.nio.fs;
  27 
  28 import java.nio.file.*;
  29 import static java.nio.file.StandardOpenOption.*;
  30 import java.nio.ByteBuffer;
  31 import java.nio.channels.FileChannel;
  32 import java.io.IOException;
  33 import java.util.*;
  34 import sun.misc.Unsafe;
  35 
  36 import static sun.nio.fs.WindowsNativeDispatcher.*;
  37 import static sun.nio.fs.WindowsConstants.*;
  38 
  39 /**
  40  * Windows emulation of NamedAttributeView using Alternative Data Streams
  41  */
  42 
  43 class WindowsUserDefinedFileAttributeView
  44     extends AbstractUserDefinedFileAttributeView
  45 {
  46     private static final Unsafe unsafe = Unsafe.getUnsafe();
  47 
  48     // syntax to address named streams
  49     private String join(String file, String name) {
  50         if (name == null)
  51             throw new NullPointerException("'name' is null");
  52         return file + ":" + name;
  53     }
  54     private String join(WindowsPath file, String name) throws WindowsException {




  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package sun.nio.fs;
  27 
  28 import java.nio.file.*;
  29 import static java.nio.file.StandardOpenOption.*;
  30 import java.nio.ByteBuffer;
  31 import java.nio.channels.FileChannel;
  32 import java.io.IOException;
  33 import java.util.*;
  34 import jdk.internal.misc.Unsafe;
  35 
  36 import static sun.nio.fs.WindowsNativeDispatcher.*;
  37 import static sun.nio.fs.WindowsConstants.*;
  38 
  39 /**
  40  * Windows emulation of NamedAttributeView using Alternative Data Streams
  41  */
  42 
  43 class WindowsUserDefinedFileAttributeView
  44     extends AbstractUserDefinedFileAttributeView
  45 {
  46     private static final Unsafe unsafe = Unsafe.getUnsafe();
  47 
  48     // syntax to address named streams
  49     private String join(String file, String name) {
  50         if (name == null)
  51             throw new NullPointerException("'name' is null");
  52         return file + ":" + name;
  53     }
  54     private String join(WindowsPath file, String name) throws WindowsException {