mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-08 10:16:03 +02:00
Bug 440993 - return a file store for #getStore(IPath)
Change-Id: I1f39423a8b667c001c8dec8e4914396546536e64 Signed-off-by: Greg Watson <g.watson@computer.org>
This commit is contained in:
parent
559dd99ea8
commit
52e01f7339
3 changed files with 19 additions and 15 deletions
|
@ -33,6 +33,7 @@ public class JSchFileManager implements IRemoteFileManager {
|
|||
/**
|
||||
* @since 4.0
|
||||
*/
|
||||
@Override
|
||||
public String getDirectorySeparator() {
|
||||
return "/"; //$NON-NLS-1$
|
||||
}
|
||||
|
@ -44,12 +45,13 @@ public class JSchFileManager implements IRemoteFileManager {
|
|||
* org.eclipse.remote.core.IRemoteFileManager#getResource(java.lang.
|
||||
* String)
|
||||
*/
|
||||
@Override
|
||||
public IFileStore getResource(String pathStr) {
|
||||
IPath path = new Path(pathStr);
|
||||
if (!path.isAbsolute()) {
|
||||
path = new Path(fConnection.getWorkingDirectory()).append(path);
|
||||
}
|
||||
return new JschFileStore(JSchFileSystem.getURIFor(fConnection.getName(), path.toString()));
|
||||
return JschFileStore.getInstance(JSchFileSystem.getURIFor(fConnection.getName(), path.toString()));
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -57,6 +59,7 @@ public class JSchFileManager implements IRemoteFileManager {
|
|||
*
|
||||
* @see org.eclipse.remote.core.IRemoteFileManager#toPath(java.net.URI)
|
||||
*/
|
||||
@Override
|
||||
public String toPath(URI uri) {
|
||||
return uri.getPath();
|
||||
}
|
||||
|
@ -68,6 +71,7 @@ public class JSchFileManager implements IRemoteFileManager {
|
|||
* org.eclipse.remote.core.IRemoteFileManager#toURI(org.eclipse.core
|
||||
* .runtime.IPath)
|
||||
*/
|
||||
@Override
|
||||
public URI toURI(IPath path) {
|
||||
try {
|
||||
return JSchFileSystem.getURIFor(fConnection.getName(), path.toString());
|
||||
|
@ -82,6 +86,7 @@ public class JSchFileManager implements IRemoteFileManager {
|
|||
* @see
|
||||
* org.eclipse.remote.core.IRemoteFileManager#toURI(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
public URI toURI(String path) {
|
||||
return toURI(new Path(path));
|
||||
}
|
||||
|
|
|
@ -99,6 +99,16 @@ public class JSchFileSystem extends FileSystem {
|
|||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.core.filesystem.provider.FileSystem#getStore(org.eclipse.core.runtime.IPath)
|
||||
*/
|
||||
@Override
|
||||
public IFileStore getStore(IPath path) {
|
||||
return EFS.getNullFileSystem().getStore(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
@ -115,14 +125,4 @@ public class JSchFileSystem extends FileSystem {
|
|||
return EFS.getNullFileSystem().getStore(uri);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see org.eclipse.core.filesystem.provider.FileSystem#getStore(org.eclipse.core.runtime.IPath)
|
||||
*/
|
||||
@Override
|
||||
public IFileStore getStore(IPath path) {
|
||||
return null;
|
||||
}
|
||||
}
|
|
@ -44,8 +44,6 @@ import org.eclipse.remote.internal.jsch.core.commands.PutInfoCommand;
|
|||
import org.eclipse.remote.internal.jsch.core.messages.Messages;
|
||||
|
||||
public class JschFileStore extends FileStore {
|
||||
private static Map<String, JschFileStore> instanceMap = new HashMap<String, JschFileStore>();
|
||||
|
||||
/**
|
||||
* Public factory method for obtaining JschFileStore instances.
|
||||
*
|
||||
|
@ -64,11 +62,12 @@ public class JschFileStore extends FileStore {
|
|||
}
|
||||
}
|
||||
|
||||
// private final JSchConnection fConnection;
|
||||
private static Map<String, JschFileStore> instanceMap = new HashMap<String, JschFileStore>();
|
||||
|
||||
private final IPath fRemotePath;
|
||||
private final URI fURI;
|
||||
|
||||
public JschFileStore(URI uri) {
|
||||
private JschFileStore(URI uri) {
|
||||
fURI = uri;
|
||||
fRemotePath = new Path(uri.getPath());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue