diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalFileService.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalFileService.java index cc420745959..0d2bfc6580a 100644 --- a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalFileService.java +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalFileService.java @@ -18,9 +18,9 @@ import org.eclipse.core.filesystem.URIUtil; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; -import org.eclipse.remote.core.IRemoteConnection.Service; public class LocalFileService implements IRemoteFileService { @@ -53,7 +53,7 @@ public class LocalFileService implements IRemoteFileService { @Override public IFileStore getResource(String path) { - return EFS.getLocalFileSystem().getStore(new Path(path)); + return EFS.getLocalFileSystem().getStore(Path.fromOSString(path)); } @Override diff --git a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java index 5f713ea5b85..e5474a6eee8 100644 --- a/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java +++ b/bundles/org.eclipse.remote.core/src/org/eclipse/remote/internal/core/services/local/LocalProcessBuilder.java @@ -70,7 +70,7 @@ public class LocalProcessBuilder extends AbstractRemoteProcessBuilder { if (dir == null) { String userDir = System.getProperty("user.dir"); //$NON-NLS-1$ if (userDir != null) { - dir = EFS.getLocalFileSystem().getStore(new Path(userDir)); + dir = EFS.getLocalFileSystem().getStore(Path.fromOSString(userDir)); directory(dir); } } diff --git a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchConnection.java b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchConnection.java index bf0b883e6d1..170dd748d2c 100644 --- a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchConnection.java +++ b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchConnection.java @@ -980,7 +980,7 @@ public class JSchConnection implements IRemoteConnectionControlService, IRemoteC */ @Override public void setWorkingDirectory(String path) { - if (new Path(path).isAbsolute()) { + if (Path.forPosix(path).isAbsolute()) { fWorkingDir = path; } } diff --git a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchFileManager.java b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchFileManager.java index 565eb480dab..7d9b0312d5f 100644 --- a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchFileManager.java +++ b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JSchFileManager.java @@ -16,9 +16,9 @@ import org.eclipse.core.filesystem.IFileStore; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.remote.core.IRemoteConnection; +import org.eclipse.remote.core.IRemoteConnection.Service; import org.eclipse.remote.core.IRemoteFileService; import org.eclipse.remote.core.IRemoteProcessService; -import org.eclipse.remote.core.IRemoteConnection.Service; public class JSchFileManager implements IRemoteFileService { @@ -51,9 +51,9 @@ public class JSchFileManager implements IRemoteFileService { @Override public IFileStore getResource(String pathStr) { - IPath path = new Path(pathStr); + IPath path = Path.forPosix(pathStr); if (!path.isAbsolute()) { - path = new Path(getBaseDirectory()).append(path); + path = Path.forPosix(getBaseDirectory()).append(path); } return JschFileStore.getInstance(JSchFileSystem.getURIFor(fConnection.getName(), path.toString())); } @@ -84,7 +84,7 @@ public class JSchFileManager implements IRemoteFileService { @Override public URI toURI(String path) { - return toURI(new Path(path)); + return toURI(Path.forPosix(path)); } } diff --git a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JschFileStore.java b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JschFileStore.java index 1082c4d75bc..ce9552aefe3 100644 --- a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JschFileStore.java +++ b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/JschFileStore.java @@ -68,7 +68,7 @@ public class JschFileStore extends FileStore { private JschFileStore(URI uri) { fURI = uri; - fRemotePath = new Path(uri.getPath()); + fRemotePath = Path.forPosix(uri.getPath()); } private JSchConnection checkConnection(IProgressMonitor monitor) throws RemoteConnectionException { @@ -224,8 +224,8 @@ public class JschFileStore extends FileStore { if ((options & EFS.SHALLOW) == EFS.SHALLOW) { IFileStore parent = getParent(); if (parent != null && !parent.fetchInfo(EFS.NONE, subMon.newChild(9)).exists()) { - throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRITE, NLS.bind( - Messages.JschFileStore_The_parent_of_directory_does_not_exist, fRemotePath.toString()), null)); + throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRITE, + NLS.bind(Messages.JschFileStore_The_parent_of_directory_does_not_exist, fRemotePath.toString()), null)); } if (subMon.isCanceled()) { return this; @@ -245,8 +245,8 @@ public class JschFileStore extends FileStore { IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(10)); if (!subMon.isCanceled()) { if (!info.exists()) { - throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRITE, NLS.bind( - Messages.JschFileStore_The_directory_could_not_be_created, fRemotePath.toString()), null)); + throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRITE, + NLS.bind(Messages.JschFileStore_The_directory_could_not_be_created, fRemotePath.toString()), null)); } if (!info.isDirectory()) { throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, @@ -271,12 +271,12 @@ public class JschFileStore extends FileStore { IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(9)); if (!subMon.isCanceled()) { if (!info.exists()) { - throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_READ, NLS.bind( - Messages.JschFileStore_File_doesnt_exist, fRemotePath.toString()), null)); + throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_READ, + NLS.bind(Messages.JschFileStore_File_doesnt_exist, fRemotePath.toString()), null)); } if (info.isDirectory()) { - throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, NLS.bind( - Messages.JschFileStore_Is_a_directory, fRemotePath.toString()), null)); + throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, + NLS.bind(Messages.JschFileStore_Is_a_directory, fRemotePath.toString()), null)); } GetInputStreamCommand command = new GetInputStreamCommand(connection, fRemotePath); return command.getResult(subMon.newChild(10)); @@ -297,8 +297,8 @@ public class JschFileStore extends FileStore { IFileInfo info = fetchInfo(EFS.NONE, subMon.newChild(9)); if (!subMon.isCanceled()) { if (info.isDirectory()) { - throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, NLS.bind( - Messages.JschFileStore_Is_a_directory, fRemotePath.toString()), null)); + throw new CoreException(new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), EFS.ERROR_WRONG_TYPE, + NLS.bind(Messages.JschFileStore_Is_a_directory, fRemotePath.toString()), null)); } GetOutputStreamCommand command = new GetOutputStreamCommand(connection, options, fRemotePath); return command.getResult(subMon.newChild(10)); diff --git a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commands/AbstractRemoteCommand.java b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commands/AbstractRemoteCommand.java index 60ea373d49b..84a249f86f2 100755 --- a/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commands/AbstractRemoteCommand.java +++ b/bundles/org.eclipse.remote.jsch.core/src/org/eclipse/remote/internal/jsch/core/commands/AbstractRemoteCommand.java @@ -83,8 +83,8 @@ public abstract class AbstractRemoteCommand { taskName.append(MessageFormat.format(Messages.AbstractRemoteCommand_format1, new Object[] { workToDate, size })); } else { Double workPercent = new Double(fWorkPercentFactor * fWorkToDate); - taskName.append(MessageFormat.format(Messages.AbstractRemoteCommand_format2, new Object[] { workToDate, size, - fMaxWork, fMaxWorkSize, workPercent })); + taskName.append(MessageFormat.format(Messages.AbstractRemoteCommand_format2, + new Object[] { workToDate, size, fMaxWork, fMaxWorkSize, workPercent })); } fMonitor.subTask(taskName.toString()); fMonitor.worked((int) count); @@ -107,7 +107,7 @@ public abstract class AbstractRemoteCommand { fMaxWork = max / 1024L; } fWorkToDate = 0; - fMonitor.beginTask(new Path(src).lastSegment(), (int) max); + fMonitor.beginTask(Path.forPosix(src).lastSegment(), (int) max); } } diff --git a/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/RemoteResourceBrowserWidget.java b/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/RemoteResourceBrowserWidget.java index ba07ac4cbab..f66328f74f0 100644 --- a/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/RemoteResourceBrowserWidget.java +++ b/bundles/org.eclipse.remote.ui/src/org/eclipse/remote/ui/widgets/RemoteResourceBrowserWidget.java @@ -528,19 +528,19 @@ public class RemoteResourceBrowserWidget extends Composite { public void run() { DelayedInputDialog dialog = new DelayedInputDialog(getShell(), Messages.RemoteResourceBrowserWidget_1, Messages.RemoteResourceBrowserWidget_2, basePath.getName(), new IInputValidator() { - @Override - public String isValid(String newText) { - if (!newText.equals("")) { //$NON-NLS-1$ - IFileStore newPath = path.getChild(newText); - if (newPath.fetchInfo().exists()) { - return Messages.RemoteResourceBrowserWidget_3; - } - } else { - return Messages.RemoteResourceBrowserWidget_4; - } - return null; + @Override + public String isValid(String newText) { + if (!newText.equals("")) { //$NON-NLS-1$ + IFileStore newPath = path.getChild(newText); + if (newPath.fetchInfo().exists()) { + return Messages.RemoteResourceBrowserWidget_3; } - }); + } else { + return Messages.RemoteResourceBrowserWidget_4; + } + return null; + } + }); fValidateJob.setDialog(dialog); if (dialog.open() == Dialog.OK) { userPath[0] = dialog.getValue(); @@ -586,15 +586,15 @@ public class RemoteResourceBrowserWidget extends Composite { */ private IPath findInitialPath(String cwd, String initialPath) { if (initialPath != null) { - IPath path = new Path(initialPath); + IPath path = Path.forPosix(initialPath); if (!path.isAbsolute()) { - path = new Path(cwd).append(path); + path = Path.forPosix(cwd).append(path); } if (fFileMgr.getResource(path.toString()).fetchInfo().exists()) { return path; } } - return new Path(cwd); + return Path.forPosix(cwd); } /** @@ -702,7 +702,7 @@ public class RemoteResourceBrowserWidget extends Composite { fRemotePathText.setText(path); fRemotePathText.setSelection(fRemotePathText.getText().length()); fResources.add(root); - fRootPath = new Path(path); + fRootPath = Path.forPosix(path); } }