jaxp/src/java.xml/share/classes/javax/xml/catalog/Util.java
author joehw
Tue, 12 Apr 2016 14:44:23 -0700
changeset 37382 c7d898d8da12
parent 36700 3afcaff239f5
child 38497 06b1977d0f4f
permissions -rw-r--r--
8151162: Public entries not searched when prefer='system' Reviewed-by: lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
33542
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     1
/*
36700
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
     2
 * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
33542
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     4
 *
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    10
 *
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    15
 * accompanied this code).
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    16
 *
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    20
 *
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    23
 * questions.
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    24
 */
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    25
package javax.xml.catalog;
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    26
36700
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    27
import java.io.File;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    28
import java.net.MalformedURLException;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    29
import java.net.URI;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    30
import java.net.URISyntaxException;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    31
import java.net.URL;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    32
import java.nio.file.Path;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    33
import java.nio.file.Paths;
33542
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    34
import jdk.xml.internal.SecuritySupport;
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    35
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    36
/**
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    37
 *
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    38
 * @since 9
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    39
 */
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
    40
class Util {
36700
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    41
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    42
    /**
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    43
     * Resolves the specified file path to an absolute systemId. If it is
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    44
     * relative, it shall be resolved using the base or user.dir property if
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    45
     * base is not specified.
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    46
     *
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    47
     * @param file The specified file path
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    48
     * @param baseURI the base URI
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    49
     * @return The URI
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    50
     * @throws CatalogException if the specified file path can not be converted
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    51
     * to a system id
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    52
     */
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    53
    static URI verifyAndGetURI(String file, URL baseURI)
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    54
            throws MalformedURLException, URISyntaxException, IllegalArgumentException {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    55
        URL filepath;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    56
        URI temp;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    57
        if (file != null && file.length() > 0) {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    58
            File f = new File(file);
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    59
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    60
            if (baseURI != null && !f.isAbsolute()) {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    61
                filepath = new URL(baseURI, fixSlashes(file));
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    62
                temp = filepath.toURI();
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    63
            } else {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    64
                temp = resolveURI(file);
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    65
            }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    66
            //Paths.get may throw IllegalArgumentException
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    67
            Path path = Paths.get(temp);
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    68
            if (path.toFile().isFile()) {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    69
                return temp;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    70
            }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    71
        }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    72
        return null;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    73
    }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    74
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    75
    /**
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    76
     * Resolves the specified uri. If the uri is relative, makes it absolute by
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    77
     * the user.dir directory.
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    78
     *
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    79
     * @param uri The specified URI.
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    80
     * @return The resolved URI
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    81
     */
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    82
    static URI resolveURI(String uri) throws MalformedURLException {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    83
        if (uri == null) {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    84
            uri = "";
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    85
        }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    86
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    87
        URI temp = null;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    88
        try {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    89
            URL url = new URL(uri);
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    90
            temp = url.toURI();
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    91
        } catch (MalformedURLException | URISyntaxException mue) {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    92
            File file = new File(uri);
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    93
            temp = file.toURI();
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    94
        }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    95
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    96
        return temp;
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    97
    }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    98
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
    99
    /**
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   100
     * Replace backslashes with forward slashes. (URLs always use forward
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   101
     * slashes.)
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   102
     *
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   103
     * @param sysid The input system identifier.
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   104
     * @return The same system identifier with backslashes turned into forward
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   105
     * slashes.
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   106
     */
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   107
    static String fixSlashes(String sysid) {
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   108
        return sysid.replace('\\', '/');
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   109
    }
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   110
33542
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   111
    /**
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   112
     * Find catalog file paths by reading the system property, and then
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   113
     * jaxp.properties if the system property is not specified.
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   114
     *
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   115
     * @param sysPropertyName the name of system property
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   116
     * @return the catalog file paths, or null if not found.
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   117
     */
36700
3afcaff239f5 8151154: IllegalArgumentException not thrown when wrong syntax value is set for javax.xml.catalog.files
joehw
parents: 33542
diff changeset
   118
    static String[] getCatalogFiles(String sysPropertyName) {
33542
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   119
        String value = SecuritySupport.getJAXPSystemProperty(sysPropertyName);
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   120
        if (value != null && !value.equals("")) {
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   121
            return value.split(";");
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   122
        }
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   123
        return null;
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   124
    }
37382
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   125
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   126
    /**
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   127
     * Checks whether the specified string is null or empty, returns the original
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   128
     * string with leading and trailing spaces removed if not.
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   129
     * @param test the string to be tested
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   130
     * @return the original string with leading and trailing spaces removed,
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   131
     * or null if it is null or empty
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   132
     *
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   133
     */
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   134
    static String getNotNullOrEmpty(String test) {
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   135
        if (test == null) {
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   136
            return test;
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   137
        } else {
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   138
            String temp = test.trim();
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   139
            if (temp.length() == 0) {
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   140
                return null;
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   141
            } else {
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   142
                return temp;
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   143
            }
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   144
        }
c7d898d8da12 8151162: Public entries not searched when prefer='system'
joehw
parents: 36700
diff changeset
   145
    }
33542
9f0eef87e8c1 8081248: Implement JEP 268: XML Catalog API
joehw
parents:
diff changeset
   146
}