Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 85257 | Differences between
and this patch

Collapse All | Expand All

(-)org/eclipse/target/internal/ftp/FtpSite.java (-1 / +11 lines)
Lines 35-42 Link Here
35
	private boolean passive = false;
35
	private boolean passive = false;
36
	
36
	
37
	private Map openClients = new HashMap();
37
	private Map openClients = new HashMap();
38
	
38
39
	private int numSkipSubdirs = 0;
40
39
	public FtpSite() {
41
	public FtpSite() {
42
	}
43
	
44
	public int getNumSkipSubdirs() {
45
		return this.numSkipSubdirs;
46
	}
47
	
48
	public void setNumSkipSubdirs(int num) {
49
		this.numSkipSubdirs = num;
40
	}
50
	}
41
51
42
	/* (non-Javadoc)
52
	/* (non-Javadoc)
(-)org/eclipse/target/internal/ftp/FtpTargetResource.java (+19 lines)
Lines 11-16 Link Here
11
package org.eclipse.target.internal.ftp;
11
package org.eclipse.target.internal.ftp;
12
12
13
import java.io.InputStream;
13
import java.io.InputStream;
14
import java.util.Date;
14
15
15
import org.eclipse.core.runtime.*;
16
import org.eclipse.core.runtime.*;
16
import org.eclipse.ftp.*;
17
import org.eclipse.ftp.*;
Lines 79-90 Link Here
79
	 */
80
	 */
80
	public ITargetResource[] members(IProgressMonitor monitor) throws CoreException {
81
	public ITargetResource[] members(IProgressMonitor monitor) throws CoreException {
81
		if (isDirectory()) {
82
		if (isDirectory()) {
83
			FtpSite ftpSite = (FtpSite)this.getSite();
84
			int numSkipSubdirs = ftpSite.getNumSkipSubdirs();
85
			if (this.siteRelativePath.equals("")) {
86
				numSkipSubdirs = 0;
87
			}
88
			// Skip FTP subdirs listing
89
			if (numSkipSubdirs > 0) {
90
				// Add a dummy entry as a child to make the TreeView show the "+"
91
				final IDirectoryEntry entry = new FTPDirectoryEntry("",true,false,0,new Date());
92
				ITargetResource[] members = new ITargetResource[1];
93
				members[0] = new FtpTargetResource(getSite(), Utils.appendPath(getRelativePath(), entry.getName()), entry);
94
				ftpSite.setNumSkipSubdirs(numSkipSubdirs-1);
95
				return members;
96
			}
82
			final IDirectoryEntry[] entries = listFiles(getRelativePath(), false, monitor);
97
			final IDirectoryEntry[] entries = listFiles(getRelativePath(), false, monitor);
83
			ITargetResource[] members = new ITargetResource[entries.length];
98
			ITargetResource[] members = new ITargetResource[entries.length];
84
			for (int i = 0; i < entries.length; i++) {
99
			for (int i = 0; i < entries.length; i++) {
85
				IDirectoryEntry entry = entries[i];
100
				IDirectoryEntry entry = entries[i];
86
				members[i] = new FtpTargetResource(getSite(), Utils.appendPath(getRelativePath(), entry.getName()), entry);
101
				members[i] = new FtpTargetResource(getSite(), Utils.appendPath(getRelativePath(), entry.getName()), entry);
102
				if (members[i].isDirectory()) {
103
					numSkipSubdirs++;
104
				}
87
			}
105
			}
106
			ftpSite.setNumSkipSubdirs(numSkipSubdirs);
88
			return members;
107
			return members;
89
		} else {
108
		} else {
90
			return new ITargetResource[0];
109
			return new ITargetResource[0];

Return to bug 85257