Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 38092e0a32590d55f766ed7f08b966da28d1ca60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
/*******************************************************************************
 * Copyright (c) 2015 Wind River Systems, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Markus Schorn - initial API and implementation
 *******************************************************************************/
package org.eclipse.tcf.te.tcf.filesystem.core.interfaces.runtime;

import java.io.File;
import java.io.OutputStream;
import java.net.URI;
import java.net.URL;
import java.util.List;

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.content.IContentType;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IConfirmCallback;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IOperation;
import org.eclipse.tcf.te.tcf.filesystem.core.interfaces.IResultOperation;
import org.eclipse.tcf.te.tcf.filesystem.core.model.CacheState;
import org.eclipse.tcf.te.tcf.locator.interfaces.nodes.IPeerNode;

public interface IFSTreeNode extends IFSTreeNodeBase, IAdaptable {
	/**
	 * Returns the runtime model this node belongs to
	 */
	IRuntimeModel getRuntimeModel();

	/**
	 * Returns the peer node this node belongs to
	 */
	IPeerNode getPeerNode();

	/**
	 * Returns the parent node, or <code>null</code>
	 */
	IFSTreeNode getParent();

	/**
	 * Returns the child with the given name, or <code>null</code>.
	 */
	IFSTreeNode findChild(String name);

	/**
	 * Returns the children of this node, may be <code>null</code> in case the children
	 * have not been queried.
	 */
	IFSTreeNode[] getChildren();

	/**
	 * Returns an URL for this node
	 */
	URL getLocationURL();

	/**
	 * Returns an URI for this node
	 */
	URI getLocationURI();

	/**
	 * Return the last refresh time
	 */
	long getLastRefresh();

	/**
	 * Returns the current known cache state of this node.
	 */
	CacheState getCacheState();

	/**
	 * Returns the location of the local cache file, does not actually create the cache.
	 */
	File getCacheFile();

	/**
	 * Returns the preferred editor ID or <code>null</code>.
	 */
	String getPreferredEditorID();

	/**
	 * Stores a preferred editor id
	 */
	void setPreferredEditorID(String editorID);

	/**
	 * Returns the content type of the file, or <code>null</code> if not applicable
	 */
	IContentType getContentType();

	/**
	 * Checks whether the file is binary.
	 */
	boolean isBinaryFile();

	/**
	 * Checks whether this node is an ancestor of the argument
	 */
	boolean isAncestorOf(IFSTreeNode target);

	/**
	 * Returns an operation for refreshing the node
	 */
	IOperation operationRefresh(boolean recursive);

	/**
	 * Returns an operation for renaming the node
	 */
	IOperation operationRename(String newName);

	/**
	 * Returns an operation for uploading the content of the given file to the remote file
	 * represented by this node.
	 */
	IOperation operationUploadContent(File srcFile);

	/**
	 * Returns an operation to delete the remote file.
	 */
	IOperation operationDelete(IConfirmCallback readonlyCallback);

	/**
	 * Returns an operation for downloading the remote file to the given output stream
	 * @param output stream receiving the content of the remote file, or <code>null</code> for
	 * downloading it to the local cache.
	 */
	IOperation operationDownload(OutputStream output);

	/**
	 * Returns an operation for downloading the remote file or directory to the local file system.
	 * @param destinationFolder folder where to store the downloaded files and folders.
	 */
	IOperation operationDownload(File destinationFolder, IConfirmCallback confirmCallback);

	/**
	 * Returns an operation for uploading the given files into this remote directory
	 */
	IOperation operationDropFiles(List<String> files, IConfirmCallback confirmCallback);

	/**
	 * Returns an operation for moving the given remote files into this remote directory
	 */
	IOperation operationDropMove(List<IFSTreeNode> nodes, IConfirmCallback confirmCallback);

	/**
	 * Returns an operation for copying the given remote files into this remote directory
	 */
	IOperation operationDropCopy(List<IFSTreeNode> nodes, boolean cpPerm, boolean cpOwn, IConfirmCallback moveCopyCallback);

	/**
	 * Returns an operation for creating a new remote file
	 */
	IResultOperation<? extends IFSTreeNode> operationNewFile(String name);

	/**
	 * Returns an operation for creating a new remote folder
	 */
	IResultOperation<? extends IFSTreeNode> operationNewFolder(String name);

}

Back to the top