Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/nio/file/spi/TestProvider.java
38828 views
/*1* Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223import java.nio.file.spi.FileSystemProvider;24import java.nio.file.*;25import java.nio.file.attribute.*;26import java.nio.channels.SeekableByteChannel;27import java.net.URI;28import java.util.*;29import java.io.IOException;3031public class TestProvider extends FileSystemProvider {3233private final FileSystem theFileSystem;3435public TestProvider(FileSystemProvider defaultProvider) {36theFileSystem = new TestFileSystem(this);37}3839@Override40public String getScheme() {41return "file";42}4344@Override45public FileSystem newFileSystem(URI uri, Map<String,?> env) {46throw new RuntimeException("not implemented");47}4849@Override50public FileSystem getFileSystem(URI uri) {51return theFileSystem;52}5354@Override55public Path getPath(URI uri) {56throw new RuntimeException("not implemented");57}5859@Override60public void setAttribute(Path file, String attribute, Object value,61LinkOption... options)62throws IOException63{64throw new RuntimeException("not implemented");65}6667@Override68public Map<String,Object> readAttributes(Path file, String attributes,69LinkOption... options)70throws IOException71{72throw new RuntimeException("not implemented");73}7475@Override76public <A extends BasicFileAttributes> A readAttributes(Path file,77Class<A> type,78LinkOption... options)79throws IOException80{81throw new RuntimeException("not implemented");82}8384@Override85public <V extends FileAttributeView> V getFileAttributeView(Path file,86Class<V> type,87LinkOption... options)88{89throw new RuntimeException("not implemented");90}919293@Override94public void delete(Path file) throws IOException {95throw new RuntimeException("not implemented");96}9798@Override99public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)100throws IOException101{102throw new RuntimeException("not implemented");103}104105@Override106public void createLink(Path link, Path existing) throws IOException {107throw new RuntimeException("not implemented");108}109110@Override111public Path readSymbolicLink(Path link) throws IOException {112throw new RuntimeException("not implemented");113}114115116@Override117public void copy(Path source, Path target, CopyOption... options)118throws IOException119{120throw new RuntimeException("not implemented");121}122123@Override124public void move(Path source, Path target, CopyOption... options)125throws IOException126{127throw new RuntimeException("not implemented");128}129130@Override131public DirectoryStream<Path> newDirectoryStream(Path dir,132DirectoryStream.Filter<? super Path> filter)133throws IOException134{135throw new RuntimeException("not implemented");136}137138@Override139public void createDirectory(Path dir, FileAttribute<?>... attrs)140throws IOException141{142throw new RuntimeException("not implemented");143}144145@Override146public SeekableByteChannel newByteChannel(Path file,147Set<? extends OpenOption> options,148FileAttribute<?>... attrs)149throws IOException150{151throw new RuntimeException("not implemented");152}153154155@Override156public boolean isHidden(Path file) throws IOException {157throw new RuntimeException("not implemented");158}159160@Override161public FileStore getFileStore(Path file) throws IOException {162throw new RuntimeException("not implemented");163}164165@Override166public boolean isSameFile(Path file, Path other) throws IOException {167throw new RuntimeException("not implemented");168}169170@Override171public void checkAccess(Path file, AccessMode... modes)172throws IOException173{174throw new RuntimeException("not implemented");175}176177static class TestFileSystem extends FileSystem {178private final TestProvider provider;179180TestFileSystem(TestProvider provider) {181this.provider = provider;182}183184@Override185public FileSystemProvider provider() {186return provider;187}188189@Override190public void close() throws IOException {191throw new RuntimeException("not implemented");192}193194@Override195public boolean isOpen() {196throw new RuntimeException("not implemented");197}198199@Override200public boolean isReadOnly() {201throw new RuntimeException("not implemented");202}203204@Override205public String getSeparator() {206throw new RuntimeException("not implemented");207}208209@Override210public Iterable<Path> getRootDirectories() {211throw new RuntimeException("not implemented");212}213214@Override215public Iterable<FileStore> getFileStores() {216throw new RuntimeException("not implemented");217}218219@Override220public Set<String> supportedFileAttributeViews() {221throw new RuntimeException("not implemented");222}223224@Override225public Path getPath(String first, String... more) {226throw new RuntimeException("not implemented");227}228229@Override230public PathMatcher getPathMatcher(String syntaxAndPattern) {231throw new RuntimeException("not implemented");232}233234@Override235public UserPrincipalLookupService getUserPrincipalLookupService() {236throw new RuntimeException("not implemented");237}238239@Override240public WatchService newWatchService() throws IOException {241throw new RuntimeException("not implemented");242}243}244}245246247