jdk/src/java.base/share/classes/jdk/internal/jrtfs/JrtFileAttributeView.java
author sherman
Fri, 15 Apr 2016 13:05:52 -0700
changeset 37365 9cc4eb4d7491
parent 36511 9d0388c6b336
permissions -rw-r--r--
8147460: Clean-up jrtfs implementation Reviewed-by: alanb, jlaskey, sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     1
/*
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     2
 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     4
 *
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    10
 *
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    15
 * accompanied this code).
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    16
 *
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    20
 *
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    23
 * questions.
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    24
 */
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    25
package jdk.internal.jrtfs;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    26
31673
135283550686 8080511: Refresh of jimage support
jfdenise
parents: 27565
diff changeset
    27
import java.nio.file.LinkOption;
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    28
import java.nio.file.attribute.*;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    29
import java.io.IOException;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    30
import java.util.LinkedHashMap;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    31
import java.util.Map;
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    32
import java.util.Objects;
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    33
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    34
/**
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    35
 * File attribute view for jrt file system.
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    36
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    37
 * @implNote This class needs to maintain JDK 8 source compatibility.
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    38
 *
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    39
 * It is used internally in the JDK to implement jimage/jrtfs access,
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    40
 * but also compiled and delivered as part of the jrtfs.jar to support access
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    41
 * to the jimage file provided by the shipped JDK by tools running on JDK 8.
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    42
 */
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    43
final class JrtFileAttributeView implements BasicFileAttributeView {
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    44
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    45
    private static enum AttrID {
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    46
        size,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    47
        creationTime,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    48
        lastAccessTime,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    49
        lastModifiedTime,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    50
        isDirectory,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    51
        isRegularFile,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    52
        isSymbolicLink,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    53
        isOther,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    54
        fileKey,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    55
        compressedSize,
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    56
        extension
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    57
    };
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    58
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    59
    private final JrtPath path;
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    60
    private final boolean isJrtView;
31673
135283550686 8080511: Refresh of jimage support
jfdenise
parents: 27565
diff changeset
    61
    private final LinkOption[] options;
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    62
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    63
    private JrtFileAttributeView(JrtPath path, boolean isJrtView, LinkOption... options) {
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    64
        this.path = path;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    65
        this.isJrtView = isJrtView;
31673
135283550686 8080511: Refresh of jimage support
jfdenise
parents: 27565
diff changeset
    66
        this.options = options;
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    67
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    68
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    69
    @SuppressWarnings("unchecked") // Cast to V
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    70
    static <V extends FileAttributeView> V get(JrtPath path, Class<V> type, LinkOption... options) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    71
        Objects.requireNonNull(type);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    72
        if (type == BasicFileAttributeView.class) {
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    73
            return (V) new JrtFileAttributeView(path, false, options);
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    74
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    75
        if (type == JrtFileAttributeView.class) {
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    76
            return (V) new JrtFileAttributeView(path, true, options);
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    77
        }
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    78
        return null;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    79
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    80
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    81
    static JrtFileAttributeView get(JrtPath path, String type, LinkOption... options) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    82
        Objects.requireNonNull(type);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    83
        if (type.equals("basic")) {
31673
135283550686 8080511: Refresh of jimage support
jfdenise
parents: 27565
diff changeset
    84
            return new JrtFileAttributeView(path, false, options);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    85
        }
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    86
        if (type.equals("jrt")) {
31673
135283550686 8080511: Refresh of jimage support
jfdenise
parents: 27565
diff changeset
    87
            return new JrtFileAttributeView(path, true, options);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    88
        }
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    89
        return null;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    90
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    91
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    92
    @Override
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    93
    public String name() {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
    94
        return isJrtView ? "jrt" : "basic";
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    95
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    96
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
    97
    @Override
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
    98
    public JrtFileAttributes readAttributes() throws IOException {
31673
135283550686 8080511: Refresh of jimage support
jfdenise
parents: 27565
diff changeset
    99
        return path.getAttributes(options);
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   100
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   101
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   102
    @Override
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   103
    public void setTimes(FileTime lastModifiedTime,
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   104
                         FileTime lastAccessTime,
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   105
                         FileTime createTime) throws IOException {
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   106
        path.setTimes(lastModifiedTime, lastAccessTime, createTime);
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   107
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   108
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   109
    static void setAttribute(JrtPath path, String attribute, Object value)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   110
            throws IOException {
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   111
        int colonPos = attribute.indexOf(':');
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   112
        if (colonPos != -1) {    // type = "basic", if no ":"
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   113
            String type = attribute.substring(0, colonPos++);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   114
            if (!type.equals("basic") && !type.equals("jrt")) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   115
                throw new UnsupportedOperationException(
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   116
                    "view <" + type + "> is not supported");
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   117
            }
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   118
            attribute = attribute.substring(colonPos);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   119
        }
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   120
        try {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   121
            AttrID id = AttrID.valueOf(attribute);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   122
            if (id == AttrID.lastModifiedTime) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   123
                path.setTimes((FileTime) value, null, null);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   124
            } else if (id == AttrID.lastAccessTime) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   125
                path.setTimes(null, (FileTime) value, null);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   126
            } else if (id == AttrID.creationTime) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   127
                path.setTimes(null, null, (FileTime) value);
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   128
            }
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   129
            return;
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   130
        } catch (IllegalArgumentException x) {}
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   131
        throw new UnsupportedOperationException("'" + attribute
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   132
                + "' is unknown or read-only attribute");
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   133
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   134
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   135
    static Map<String, Object> readAttributes(JrtPath path, String attributes,
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   136
                                              LinkOption... options)
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   137
            throws IOException {
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   138
        int colonPos = attributes.indexOf(':');
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   139
        boolean isJrtView = false;
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   140
        if (colonPos != -1) {    // type = "basic", if no ":"
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   141
            String type = attributes.substring(0, colonPos++);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   142
            if (!type.equals("basic") && !type.equals("jrt")) {
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   143
                throw new UnsupportedOperationException("view <" + type +
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   144
                                                        "> is not supported");
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   145
            }
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   146
            isJrtView = true;
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   147
            attributes = attributes.substring(colonPos);
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   148
        }
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   149
        JrtFileAttributes jrtfas = path.getAttributes();
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   150
        LinkedHashMap<String, Object> map = new LinkedHashMap<>();
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   151
        if ("*".equals(attributes)) {
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   152
            for (AttrID id : AttrID.values()) {
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   153
                map.put(id.name(), attribute(id, jrtfas, isJrtView));
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   154
            }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   155
        } else {
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   156
            String[] as = attributes.split(",");
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   157
            for (String a : as) {
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   158
                //throw IllegalArgumentException
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   159
                map.put(a, attribute(AttrID.valueOf(a), jrtfas, isJrtView));
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   160
            }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   161
        }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   162
        return map;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   163
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   164
37365
9cc4eb4d7491 8147460: Clean-up jrtfs implementation
sherman
parents: 36511
diff changeset
   165
    static Object attribute(AttrID id, JrtFileAttributes jrtfas, boolean isJrtView) {
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   166
        switch (id) {
36511
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   167
            case size:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   168
                return jrtfas.size();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   169
            case creationTime:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   170
                return jrtfas.creationTime();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   171
            case lastAccessTime:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   172
                return jrtfas.lastAccessTime();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   173
            case lastModifiedTime:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   174
                return jrtfas.lastModifiedTime();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   175
            case isDirectory:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   176
                return jrtfas.isDirectory();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   177
            case isRegularFile:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   178
                return jrtfas.isRegularFile();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   179
            case isSymbolicLink:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   180
                return jrtfas.isSymbolicLink();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   181
            case isOther:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   182
                return jrtfas.isOther();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   183
            case fileKey:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   184
                return jrtfas.fileKey();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   185
            case compressedSize:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   186
                if (isJrtView) {
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   187
                    return jrtfas.compressedSize();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   188
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   189
                break;
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   190
            case extension:
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   191
                if (isJrtView) {
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   192
                    return jrtfas.extension();
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   193
                }
9d0388c6b336 8142968: Module System implementation
alanb
parents: 31673
diff changeset
   194
                break;
27565
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   195
        }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   196
        return null;
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   197
    }
729f9700483a 8049367: Modular Run-Time Images
chegar
parents:
diff changeset
   198
}