author | thartmann |
Fri, 24 Aug 2018 08:17:23 +0200 | |
changeset 51514 | 1e332d63bd96 |
parent 47216 | 71c04702a3d5 |
child 53043 | fd2e8f941ded |
permissions | -rw-r--r-- |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
1 |
/* |
23925
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
2 |
* Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved. |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
4 |
* |
23925
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
10 |
* |
23925
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
15 |
* accompanied this code). |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
16 |
* |
23925
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
20 |
* |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
23 |
* questions. |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
24 |
*/ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
25 |
|
23925
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
26 |
package jdk.nio.zipfs; |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
27 |
|
8165
b67d8b1f4e46
7015391: (zipfs) Update zip provider for 1/2011 changes
sherman
parents:
7531
diff
changeset
|
28 |
import java.nio.file.attribute.*; |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
29 |
import java.io.IOException; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
30 |
import java.util.LinkedHashMap; |
8165
b67d8b1f4e46
7015391: (zipfs) Update zip provider for 1/2011 changes
sherman
parents:
7531
diff
changeset
|
31 |
import java.util.Map; |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
32 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
33 |
/* |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
34 |
* @author Xueming Shen, Rajendra Gutupalli, Jaya Hangal |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
35 |
*/ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
36 |
|
23925
0d5f2d863262
8038500: (zipfs) Upgrade ZIP provider to be a supported provider
sherman
parents:
10292
diff
changeset
|
37 |
class ZipFileAttributeView implements BasicFileAttributeView |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
38 |
{ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
39 |
private static enum AttrID { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
40 |
size, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
41 |
creationTime, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
42 |
lastAccessTime, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
43 |
lastModifiedTime, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
44 |
isDirectory, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
45 |
isRegularFile, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
46 |
isSymbolicLink, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
47 |
isOther, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
48 |
fileKey, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
49 |
compressedSize, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
50 |
crc, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
51 |
method |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
52 |
}; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
53 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
54 |
private final ZipPath path; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
55 |
private final boolean isZipView; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
56 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
57 |
private ZipFileAttributeView(ZipPath path, boolean isZipView) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
58 |
this.path = path; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
59 |
this.isZipView = isZipView; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
60 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
61 |
|
25798
0b2f54e47bc4
8054050: Fix stay raw and unchecked lint warnings in core libs
darcy
parents:
23925
diff
changeset
|
62 |
@SuppressWarnings("unchecked") // Cast to V |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
63 |
static <V extends FileAttributeView> V get(ZipPath path, Class<V> type) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
64 |
if (type == null) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
65 |
throw new NullPointerException(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
66 |
if (type == BasicFileAttributeView.class) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
67 |
return (V)new ZipFileAttributeView(path, false); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
68 |
if (type == ZipFileAttributeView.class) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
69 |
return (V)new ZipFileAttributeView(path, true); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
70 |
return null; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
71 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
72 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
73 |
static ZipFileAttributeView get(ZipPath path, String type) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
74 |
if (type == null) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
75 |
throw new NullPointerException(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
76 |
if (type.equals("basic")) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
77 |
return new ZipFileAttributeView(path, false); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
78 |
if (type.equals("zip")) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
79 |
return new ZipFileAttributeView(path, true); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
80 |
return null; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
81 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
82 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
83 |
@Override |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
84 |
public String name() { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
85 |
return isZipView ? "zip" : "basic"; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
86 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
87 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
88 |
public ZipFileAttributes readAttributes() throws IOException |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
89 |
{ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
90 |
return path.getAttributes(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
91 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
92 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
93 |
@Override |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
94 |
public void setTimes(FileTime lastModifiedTime, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
95 |
FileTime lastAccessTime, |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
96 |
FileTime createTime) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
97 |
throws IOException |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
98 |
{ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
99 |
path.setTimes(lastModifiedTime, lastAccessTime, createTime); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
100 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
101 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
102 |
void setAttribute(String attribute, Object value) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
103 |
throws IOException |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
104 |
{ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
105 |
try { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
106 |
if (AttrID.valueOf(attribute) == AttrID.lastModifiedTime) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
107 |
setTimes ((FileTime)value, null, null); |
7189 | 108 |
if (AttrID.valueOf(attribute) == AttrID.lastAccessTime) |
109 |
setTimes (null, (FileTime)value, null); |
|
110 |
if (AttrID.valueOf(attribute) == AttrID.creationTime) |
|
111 |
setTimes (null, null, (FileTime)value); |
|
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
112 |
return; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
113 |
} catch (IllegalArgumentException x) {} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
114 |
throw new UnsupportedOperationException("'" + attribute + |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
115 |
"' is unknown or read-only attribute"); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
116 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
117 |
|
8165
b67d8b1f4e46
7015391: (zipfs) Update zip provider for 1/2011 changes
sherman
parents:
7531
diff
changeset
|
118 |
Map<String, Object> readAttributes(String attributes) |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
119 |
throws IOException |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
120 |
{ |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
121 |
ZipFileAttributes zfas = readAttributes(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
122 |
LinkedHashMap<String, Object> map = new LinkedHashMap<>(); |
8165
b67d8b1f4e46
7015391: (zipfs) Update zip provider for 1/2011 changes
sherman
parents:
7531
diff
changeset
|
123 |
if ("*".equals(attributes)) { |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
124 |
for (AttrID id : AttrID.values()) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
125 |
try { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
126 |
map.put(id.name(), attribute(id, zfas)); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
127 |
} catch (IllegalArgumentException x) {} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
128 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
129 |
} else { |
8165
b67d8b1f4e46
7015391: (zipfs) Update zip provider for 1/2011 changes
sherman
parents:
7531
diff
changeset
|
130 |
String[] as = attributes.split(","); |
6699
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
131 |
for (String a : as) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
132 |
try { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
133 |
map.put(a, attribute(AttrID.valueOf(a), zfas)); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
134 |
} catch (IllegalArgumentException x) {} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
135 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
136 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
137 |
return map; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
138 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
139 |
|
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
140 |
Object attribute(AttrID id, ZipFileAttributes zfas) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
141 |
switch (id) { |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
142 |
case size: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
143 |
return zfas.size(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
144 |
case creationTime: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
145 |
return zfas.creationTime(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
146 |
case lastAccessTime: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
147 |
return zfas.lastAccessTime(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
148 |
case lastModifiedTime: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
149 |
return zfas.lastModifiedTime(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
150 |
case isDirectory: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
151 |
return zfas.isDirectory(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
152 |
case isRegularFile: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
153 |
return zfas.isRegularFile(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
154 |
case isSymbolicLink: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
155 |
return zfas.isSymbolicLink(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
156 |
case isOther: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
157 |
return zfas.isOther(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
158 |
case fileKey: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
159 |
return zfas.fileKey(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
160 |
case compressedSize: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
161 |
if (isZipView) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
162 |
return zfas.compressedSize(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
163 |
break; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
164 |
case crc: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
165 |
if (isZipView) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
166 |
return zfas.crc(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
167 |
break; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
168 |
case method: |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
169 |
if (isZipView) |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
170 |
return zfas.method(); |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
171 |
break; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
172 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
173 |
return null; |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
174 |
} |
d8229570529d
6990846: Demo: NIO.2 filesystem provider for zip/jar archives
sherman
parents:
diff
changeset
|
175 |
} |