Lines 64-70
Link Here
|
64 |
public class SftpFileService extends AbstractFileService implements IFileService, ISshService |
64 |
public class SftpFileService extends AbstractFileService implements IFileService, ISshService |
65 |
{ |
65 |
{ |
66 |
|
66 |
|
67 |
private class SftpBufferedInputStream extends BufferedInputStream { |
67 |
private static class SftpBufferedInputStream extends BufferedInputStream { |
68 |
|
68 |
|
69 |
private ChannelSftp channel; |
69 |
private ChannelSftp channel; |
70 |
|
70 |
|
Lines 99-105
Link Here
|
99 |
} |
99 |
} |
100 |
} |
100 |
} |
101 |
|
101 |
|
102 |
private class SftpBufferedOutputStream extends BufferedOutputStream { |
102 |
private static class SftpBufferedOutputStream extends BufferedOutputStream { |
103 |
|
103 |
|
104 |
private ChannelSftp channel; |
104 |
private ChannelSftp channel; |
105 |
|
105 |
|
Lines 574-580
Link Here
|
574 |
} |
574 |
} |
575 |
|
575 |
|
576 |
public IHostFile getUserHome() { |
576 |
public IHostFile getUserHome() { |
577 |
//TODO Assert: this is only called after we are connected |
577 |
//As per bug 204710, this may be called before we are connected |
578 |
if (fUserHome!=null) { |
578 |
if (fUserHome!=null) { |
579 |
int lastSlash = fUserHome.lastIndexOf('/'); |
579 |
int lastSlash = fUserHome.lastIndexOf('/'); |
580 |
String name = fUserHome.substring(lastSlash + 1); |
580 |
String name = fUserHome.substring(lastSlash + 1); |
Lines 582-593
Link Here
|
582 |
try { |
582 |
try { |
583 |
return getFile(parent, name, null); |
583 |
return getFile(parent, name, null); |
584 |
} catch(SystemMessageException e) { |
584 |
} catch(SystemMessageException e) { |
585 |
//Error getting user home -> return a default below |
585 |
//Error getting user home -> return a handle |
|
|
586 |
//Returning the home path as a Root is the safest we can do, since it will |
587 |
//let users know what the home path is, and the "My Home" filter will be |
588 |
//set to correct target. See also bug 204710. |
589 |
return new SftpHostFile("", fUserHome, true, true, false, 0, 0); //$NON-NLS-1$ |
586 |
} |
590 |
} |
587 |
} |
591 |
} |
588 |
//Could not determine user home |
592 |
//Bug 203490, bug 204710: Could not determine user home |
589 |
//return new SftpHostFile(".",".",true,false,false,0,0); //$NON-NLS-1$ //$NON-NLS-2$ |
593 |
return null; |
590 |
return new SftpHostFile("/", "/", true, true, false, 0, 0); //$NON-NLS-1$ //$NON-NLS-2$ |
|
|
591 |
} |
594 |
} |
592 |
|
595 |
|
593 |
public IHostFile[] getRoots(IProgressMonitor monitor) { |
596 |
public IHostFile[] getRoots(IProgressMonitor monitor) { |