< prev index next >

src/java.base/share/classes/jdk/internal/jrtfs/JrtFileAttributeView.java

Print this page

        

*** 23,32 **** --- 23,33 ---- * questions. */ package jdk.internal.jrtfs; + import java.nio.file.LinkOption; import java.nio.file.attribute.*; import java.io.IOException; import java.util.LinkedHashMap; import java.util.Map;
*** 46,79 **** extension }; private final JrtPath path; private final boolean isJrtView; ! private JrtFileAttributeView(JrtPath path, boolean isJrtView) { this.path = path; this.isJrtView = isJrtView; } @SuppressWarnings("unchecked") // Cast to V ! static <V extends FileAttributeView> V get(JrtPath path, Class<V> type) { if (type == null) throw new NullPointerException(); if (type == BasicFileAttributeView.class) ! return (V)new JrtFileAttributeView(path, false); if (type == JrtFileAttributeView.class) ! return (V)new JrtFileAttributeView(path, true); return null; } ! static JrtFileAttributeView get(JrtPath path, String type) { if (type == null) throw new NullPointerException(); if (type.equals("basic")) ! return new JrtFileAttributeView(path, false); if (type.equals("jjrt")) ! return new JrtFileAttributeView(path, true); return null; } @Override public String name() { --- 47,82 ---- extension }; private final JrtPath path; private final boolean isJrtView; + private final LinkOption[] options; ! private JrtFileAttributeView(JrtPath path, boolean isJrtView, LinkOption... options) { this.path = path; this.isJrtView = isJrtView; + this.options = options; } @SuppressWarnings("unchecked") // Cast to V ! static <V extends FileAttributeView> V get(JrtPath path, Class<V> type, LinkOption... options) { if (type == null) throw new NullPointerException(); if (type == BasicFileAttributeView.class) ! return (V)new JrtFileAttributeView(path, false, options); if (type == JrtFileAttributeView.class) ! return (V)new JrtFileAttributeView(path, true, options); return null; } ! static JrtFileAttributeView get(JrtPath path, String type, LinkOption... options) { if (type == null) throw new NullPointerException(); if (type.equals("basic")) ! return new JrtFileAttributeView(path, false, options); if (type.equals("jjrt")) ! return new JrtFileAttributeView(path, true, options); return null; } @Override public String name() {
*** 81,91 **** } @Override public JrtFileAttributes readAttributes() throws IOException { ! return path.getAttributes(); } @Override public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime, --- 84,94 ---- } @Override public JrtFileAttributes readAttributes() throws IOException { ! return path.getAttributes(options); } @Override public void setTimes(FileTime lastModifiedTime, FileTime lastAccessTime,
< prev index next >