< prev index next >

src/jdk.zipfs/share/classes/jdk/nio/zipfs/ZipFileStore.java

Print this page
rev 51866 : 6194856: Zip Files lose ALL ownership and permissions of the files

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -24,25 +24,22 @@
  */
 
 package jdk.nio.zipfs;
 
 import java.io.IOException;
-import java.nio.file.Files;
 import java.nio.file.FileStore;
 import java.nio.file.FileSystems;
+import java.nio.file.Files;
 import java.nio.file.Path;
-import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.BasicFileAttributeView;
 import java.nio.file.attribute.FileAttributeView;
 import java.nio.file.attribute.FileStoreAttributeView;
-import java.nio.file.attribute.BasicFileAttributeView;
-import java.util.Formatter;
+import java.nio.file.attribute.PosixFileAttributeView;
 
-/*
- *
- * @author  Xueming Shen, Rajendra Gutupalli, Jaya Hangal
+/**
+ * @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal
  */
-
 class ZipFileStore extends FileStore {
 
     private final ZipFileSystem zfs;
 
     ZipFileStore(ZipPath zpath) {

@@ -65,20 +62,20 @@
     }
 
     @Override
     public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) {
         return (type == BasicFileAttributeView.class ||
+                type == PosixFileAttributeView.class ||
                 type == ZipFileAttributeView.class);
     }
 
     @Override
     public boolean supportsFileAttributeView(String name) {
-        return name.equals("basic") || name.equals("zip");
+        return name.equals("basic") || name.equals("posix") || name.equals("zip");
     }
 
     @Override
-    @SuppressWarnings("unchecked")
     public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> type) {
         if (type == null)
             throw new NullPointerException();
         return (V)null;
     }
< prev index next >