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.filesystem; 12 13 /** 14 * This interface is used to query a tree of file stores. 15 * A file tree accurately represents the state of a portion of a file system 16 * at the time it is created, but it is never updated. Clients using a file 17 * tree must tolerate the fact that the actual file system contents may have 18 * changed since the tree was generated. 19 * <p> 20 * This interface is not intended to be implemented by clients. File tree 21 * implementations should use the concrete class {@link org.eclipse.core.filesystem.provider.FileTree} 22 * </p> 23 * 24 * @see IFileSystem#fetchFileTree(IFileStore, org.eclipse.core.runtime.IProgressMonitor) 25 * @since org.eclipse.core.filesystem 1.0 26 */ 27 public interface IFileTree { 28 /*** 29 * Returns an {@link IFileInfo} instance for each file and directory contained 30 * within the given store at the time this file tree was created. 31 * <p> 32 * An empty array is returned if the given store has no children, or is not 33 * in this file tree. 34 * </p> 35 * 36 * @param store a file store in this tree 37 * @return An array of information about the children of the store, or an empty 38 * array if the store has no children. 39 * @see IFileStore#childInfos(int, org.eclipse.core.runtime.IProgressMonitor) 40 */ 41 public IFileInfo[] getChildInfos(IFileStore store); 42 43 /** 44 * Returns an {@link IFileStore} instance for each file and directory contained 45 * within the given store at the time this file tree was created. 46 * <p> 47 * An empty array is returned if the given store has no children, or is not 48 * in this file tree. 49 * </p> 50 * @param store a file store in this tree 51 * @return The children of the store, or an empty array if the store has no children. 52 * @see IFileStore#childStores(int, org.eclipse.core.runtime.IProgressMonitor) 53 */ 54 public IFileStore[] getChildStores(IFileStore store); 55 56 /** 57 * Returns information about this file at the time this file tree was created. 58 * <p> 59 * This method succeeds regardless of whether a corresponding 60 * file exists in the file tree. In the case of a non-existent 61 * file, the returned info will include the file's name and will return <code>false</code> 62 * when {@link IFileInfo#exists()} is called, but all other information will assume default 63 * values. 64 * 65 * @param store the store to return the file info for 66 * @return IFileInfo the IFileInfo for the given store 67 * @see IFileStore#fetchInfo(int, org.eclipse.core.runtime.IProgressMonitor) 68 */ 69 public IFileInfo getFileInfo(IFileStore store); 70 71 /*** 72 * Returns the root of this tree 73 * @return An IFileStore representing the root of the tree 74 */ 75 public IFileStore getTreeRoot(); 76 }