893N/A/*
3909N/A * Copyright (c) 2008, 2011, Oracle and/or its affiliates. All rights reserved.
893N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
893N/A *
893N/A * This code is free software; you can redistribute it and/or modify it
893N/A * under the terms of the GNU General Public License version 2 only, as
893N/A * published by the Free Software Foundation.
893N/A *
893N/A * This code is distributed in the hope that it will be useful, but WITHOUT
893N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
893N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
893N/A * version 2 for more details (a copy is included in the LICENSE file that
893N/A * accompanied this code).
893N/A *
893N/A * You should have received a copy of the GNU General Public License version
893N/A * 2 along with this work; if not, write to the Free Software Foundation,
893N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
893N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
893N/A */
893N/A
893N/Aimport java.nio.file.spi.FileSystemProvider;
893N/Aimport java.nio.file.*;
893N/Aimport java.nio.file.attribute.*;
3471N/Aimport java.nio.channels.SeekableByteChannel;
893N/Aimport java.net.URI;
893N/Aimport java.util.*;
893N/Aimport java.io.IOException;
893N/A
893N/Apublic class TestProvider extends FileSystemProvider {
893N/A
893N/A private final FileSystem theFileSystem;
893N/A
893N/A public TestProvider(FileSystemProvider defaultProvider) {
893N/A theFileSystem = new TestFileSystem(this);
893N/A }
893N/A
893N/A @Override
893N/A public String getScheme() {
893N/A return "file";
893N/A }
893N/A
893N/A @Override
893N/A public FileSystem newFileSystem(URI uri, Map<String,?> env) {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public FileSystem getFileSystem(URI uri) {
893N/A return theFileSystem;
893N/A }
893N/A
893N/A @Override
893N/A public Path getPath(URI uri) {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
3471N/A @Override
3471N/A public void setAttribute(Path file, String attribute, Object value,
3471N/A LinkOption... options)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public Map<String,Object> readAttributes(Path file, String attributes,
3471N/A LinkOption... options)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public <A extends BasicFileAttributes> A readAttributes(Path file,
3471N/A Class<A> type,
3471N/A LinkOption... options)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public <V extends FileAttributeView> V getFileAttributeView(Path file,
3471N/A Class<V> type,
3471N/A LinkOption... options)
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A
3471N/A @Override
3471N/A public void delete(Path file) throws IOException {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public void createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public void createLink(Path link, Path existing) throws IOException {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public Path readSymbolicLink(Path link) throws IOException {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A
3471N/A @Override
3471N/A public void copy(Path source, Path target, CopyOption... options)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public void move(Path source, Path target, CopyOption... options)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public DirectoryStream<Path> newDirectoryStream(Path dir,
3471N/A DirectoryStream.Filter<? super Path> filter)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public void createDirectory(Path dir, FileAttribute<?>... attrs)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public SeekableByteChannel newByteChannel(Path file,
3471N/A Set<? extends OpenOption> options,
3471N/A FileAttribute<?>... attrs)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A
3471N/A @Override
3471N/A public boolean isHidden(Path file) throws IOException {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public FileStore getFileStore(Path file) throws IOException {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public boolean isSameFile(Path file, Path other) throws IOException {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
3471N/A @Override
3471N/A public void checkAccess(Path file, AccessMode... modes)
3471N/A throws IOException
3471N/A {
3471N/A throw new RuntimeException("not implemented");
3471N/A }
3471N/A
893N/A static class TestFileSystem extends FileSystem {
893N/A private final TestProvider provider;
893N/A
893N/A TestFileSystem(TestProvider provider) {
893N/A this.provider = provider;
893N/A }
893N/A
893N/A @Override
893N/A public FileSystemProvider provider() {
893N/A return provider;
893N/A }
893N/A
893N/A @Override
893N/A public void close() throws IOException {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public boolean isOpen() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public boolean isReadOnly() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public String getSeparator() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public Iterable<Path> getRootDirectories() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public Iterable<FileStore> getFileStores() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public Set<String> supportedFileAttributeViews() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
3471N/A public Path getPath(String first, String... more) {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public PathMatcher getPathMatcher(String syntaxAndPattern) {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public UserPrincipalLookupService getUserPrincipalLookupService() {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A
893N/A @Override
893N/A public WatchService newWatchService() throws IOException {
893N/A throw new RuntimeException("not implemented");
893N/A }
893N/A }
893N/A}