src/java.base/linux/classes/sun/nio/fs/DefaultFileSystemProvider.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 52727 396dfb0e8ba5
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
43544
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     1
/*
52727
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
     2
 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
43544
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     4
 *
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    10
 *
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    15
 * accompanied this code).
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    16
 *
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    20
 *
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    23
 * questions.
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    24
 */
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    25
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    26
package sun.nio.fs;
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    27
52727
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    28
import java.nio.file.FileSystem;
43544
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    29
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    30
/**
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    31
 * Creates this platform's default FileSystemProvider.
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    32
 */
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    33
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    34
public class DefaultFileSystemProvider {
52727
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    35
    private static final LinuxFileSystemProvider INSTANCE
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    36
        = new LinuxFileSystemProvider();
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    37
43544
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    38
    private DefaultFileSystemProvider() { }
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    39
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    40
    /**
52727
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    41
     * Returns the platform's default file system provider.
43544
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    42
     */
52727
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    43
    public static LinuxFileSystemProvider instance() {
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    44
        return INSTANCE;
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    45
    }
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    46
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    47
    /**
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    48
     * Returns the platform's default file system.
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    49
     */
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    50
    public static FileSystem theFileSystem() {
396dfb0e8ba5 8213406: (fs) More than one instance of built-in FileSystem observed in heap
martin
parents: 47216
diff changeset
    51
        return INSTANCE.theFileSystem();
43544
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    52
    }
457673db6798 8173982: (fs) DefaultFileSystemProvider should be split into platform specific versions
redestad
parents:
diff changeset
    53
}