KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > core > internal > filesystem > NullFileSystem


1 /*******************************************************************************
2  * Copyright (c) 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.core.internal.filesystem;
12
13 import java.net.URI JavaDoc;
14 import org.eclipse.core.filesystem.*;
15 import org.eclipse.core.filesystem.provider.FileSystem;
16 import org.eclipse.core.runtime.IPath;
17 import org.eclipse.core.runtime.Path;
18
19 /**
20  * The null file system.
21  * @see EFS#getNullFileSystem()
22  */

23 public class NullFileSystem extends FileSystem {
24
25     /**
26      * The singleton instance of this file system.
27      */

28     private static IFileSystem instance;
29
30     /**
31      * Returns the instance of this file system
32      *
33      * @return The instance of this file system.
34      */

35     public static IFileSystem getInstance() {
36         return instance;
37     }
38
39     /**
40      * Creates the null file system.
41      */

42     public NullFileSystem() {
43         super();
44         instance = this;
45     }
46
47     public IFileStore getStore(IPath path) {
48         return new NullFileStore(path);
49     }
50
51     public IFileStore getStore(URI JavaDoc uri) {
52         return new NullFileStore(new Path(uri.getPath()));
53     }
54
55 }
56
Popular Tags