public String getRemotePath(String localPath) { return pathMap.getRemotePath(localPath,true); }
public String getLocalPath(String remotePath) { return pathMap.getLocalPath(remotePath,true); }
protected static String convertToRemoteIfNeeded(ExecutionEnvironment execEnv, String localDir, Project project) { if (!checkConnection(execEnv)) { return null; } if (execEnv.isRemote()) { final PathMap pathMap = RemoteSyncSupport.getPathMap(execEnv, project); String remotePath = pathMap.getRemotePath(localDir, false); if (remotePath == null) { if (!pathMap.checkRemotePaths(new File[]{new File(localDir)}, true)) { return null; } remotePath = pathMap.getRemotePath(localDir, false); } return remotePath; } return localDir; }
@Override public void propertyChange(PropertyChangeEvent evt) { File selectedFile = chooser.getSelectedFile(); if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName()) && evt.getNewValue() == PropertyEnv.STATE_VALID && selectedFile != null) { String path = selectedFile.getPath(); if (pathMap != null) { String newPath = pathMap.getTrueLocalPath(path); path = (newPath == null) ? ("//" + path) : newPath; } path = CndPathUtilities.toRelativePath(makeConfiguration.getBaseDir(), path); // FIXUP: not always relative path path = CndPathUtilities.normalizeSlashes(path); editor.setValue(path); } } });
@Deprecated public final boolean checkRemotePath(String path, boolean fixMissingPath) { Logger.getLogger("cnd.remote.logger").warning("Use of deprecated PathMap.checkRemotePath"); return checkRemotePaths(new File[] { new File(path) }, fixMissingPath); }
String localFileName = pathMap.getTrueLocalPath(fileName); if (localFileName != null) { return FileSystemProvider.getFileObject(ExecutionEnvironmentFactory.getLocal(),
public abstract String getRemotePath(String lpath, boolean useDefault); }
public abstract String getLocalPath(String rpath, boolean useDefault);
@Override public void process(File file, Writer err) throws PathMapperException, InterruptedException, ExecutionException, IOException { String remotePath = pathMap.getRemotePath(file.getAbsolutePath(), false); if (remotePath == null) { throw new RemoteSyncSupport.PathMapperException(file); } Future<Integer> task = CommonTasksSupport.downloadFile(remotePath, execEnv, file.getAbsolutePath(), err); int rc = task.get(); if (rc != 0) { throw new IOException(NbBundle.getMessage(RemoteSyncActions.class, "ERR_RC", rc)); } } @Override
public String getExecutable() { String path = executableTextField.getText(); if (mapper != null) { path = mapper.getLocalPath(path); } return path; }
public final String localToRemote(String who, String path) { String mapped; if (path == null) { mapped = path; } else if (NativeDebuggerManager.isStandalone()) { mapped = path; } else { PathMap pm = getPathMap(); if (pm == null) { mapped = path; } else { mapped = pm.getRemotePath(path); if (mapped == null) { // no mapping was found mapped = path; } } } if (Log.PathMap.debug) { System.out.printf("localToRemote - %s\n", who); // NOI18N System.out.printf(" from: %s\n", path); // NOI18N System.out.printf(" to: %s\n", mapped); // NOI18N } return mapped; }
public final String remoteToLocal(String who, String path) { String mapped; if (path == null) { mapped = path; } else if (NativeDebuggerManager.isStandalone()) { mapped = path; } else { PathMap pm = getPathMap(); if (pm == null) { mapped = path; } else { mapped = pm.getLocalPath(path); if (mapped == null) { // no mapping was found mapped = path; } } } if (Log.PathMap.debug) { System.out.printf("remoteToLocal - %s\n", who); // NOI18N System.out.printf(" from: %s\n", path); // NOI18N System.out.printf(" to: %s\n", mapped); // NOI18N } return mapped; }
public static String getRunCommandAsString(String command, MakeConfiguration configuration, PathMap mapper) { String outputValue = ""; // NOI18N if (!configuration.isLibraryConfiguration()) { if (configuration.getOutputValue().length() > 0) { outputValue = configuration.getAbsoluteOutputValue(); } } if (configuration.getPlatformInfo().isLocalhost()) { command = CndPathUtilities.expandAllMacroses(command, MakeConfiguration.CND_OUTPUT_PATH_MACRO, outputValue); // NOI18N } else { // if (!configuration.getDevelopmentHost().isLocalhost()) { if (!outputValue.isEmpty()) { if (mapper != null) { String aValue = mapper.getRemotePath(outputValue, true); if (aValue != null) { outputValue = aValue; } } else { LOGGER.log(Level.SEVERE, "Path Mapper not found for the project - using local path {0}", new Object[]{outputValue}); //NOI18N } } command = CndPathUtilities.expandAllMacroses(command, "${OUTPUT_PATH}", outputValue); // NOI18N } return configuration.expandMacros(command); }
String filePath = map.getLocalPath(path); if (filePath == null) { return null;
realSeed = pathMap.getRemotePath(seed, true);
String wd = conf.getMakefileConfiguration().getAbsBuildCommandWorkingDir(); if (mapper != null) { String aWd = mapper.getRemotePath(conf.getMakefileConfiguration().getAbsBuildCommandWorkingDir(), true); if (aWd != null) { wd = aWd;
public static String convertWorkingDirToRemoteIfNeeded(ProjectActionEvent pae, String localDir) { ExecutionEnvironment execEnv = pae.getConfiguration().getDevelopmentHost().getExecutionEnvironment(); if (!checkConnection(execEnv)) { return null; } if (execEnv.isRemote()) { PathMap mapper = RemoteSyncSupport.getPathMap(pae.getProject()); if (mapper != null) { String aLocalDir = mapper.getRemotePath(localDir, false); if (aLocalDir != null) { localDir = aLocalDir; } } else { LOGGER.log(Level.SEVERE, "Path Mapper not found for project {0} - using local path {1}", new Object[]{pae.getProject(), localDir}); //NOI18N } return localDir; } return localDir; }
private static String getOutput(MakeConfigurationDescriptor projectDescriptor, MakeConfiguration conf, CompilerSet compilerSet) { String output = conf.getOutputValue(); if (!conf.getDevelopmentHost().isLocalhost() && ! output.startsWith("$") && ! CndPathUtilities.isPathAbsolute(output)) { //NOI18N PathMap mapper = RemoteSyncSupport.getPathMap(projectDescriptor.getProject()); if (mapper != null) { output = mapper.getRemotePath(output, true); if (output == null) { output = conf.getOutputValue(); } } else { LOGGER.log(Level.SEVERE, "Path Mapper not found for project {0} - using local path {1}", new Object[]{projectDescriptor.getProject(), output}); // NOI18N } } switch (conf.getDevelopmentHost().getBuildPlatform()) { case PlatformTypes.PLATFORM_WINDOWS: switch (conf.getConfigurationType().getValue()) { case MakeConfiguration.TYPE_APPLICATION: case MakeConfiguration.TYPE_DB_APPLICATION: case MakeConfiguration.TYPE_QT_APPLICATION: output = mangleAppnameWin(output); break; } break; } if (compilerSet != null) { output = CppUtils.normalizeDriveLetter(compilerSet, output); } return output; }
public String getExecutable() { String result; if (type == PredefinedType.RUN || type == PredefinedType.DEBUG || type == PredefinedType.DEBUG_STEPINTO) { result = getExecutableFromRunCommand(); if (result != null && result.length() > 0) { ExecutionEnvironment execEnv = configuration.getDevelopmentHost().getExecutionEnvironment(); if (!CndPathUtilities.isPathAbsolute(result)) { CndUtils.assertTrueInConsole(false, "getExecutableFromRunCommand() returned non-absolute path", result); //NOI18N String baseDir = configuration.getProfile().getRunDirectory(); if (execEnv.isRemote()) { PathMap mapper = RemoteSyncSupport.getPathMap(getProject()); if (mapper != null) { baseDir = mapper.getRemotePath(baseDir, true); if (baseDir == null) { baseDir = configuration.getProfile().getRunDirectory(); } } else { LOGGER.log(Level.SEVERE, "Path Mapper not found for project {0} - using local path {1}", new Object[]{getProject(), baseDir}); //NOI18N } } result = baseDir + FileSystemProvider.getFileSeparatorChar(execEnv) + result; } result = FileSystemProvider.normalizeAbsolutePath(result, execEnv); } } else { result = executable; } return result; }
PathMap mapper = RemoteSyncSupport.getPathMap(pae.getProject()); if (mapper != null) { String anExecutable = mapper.getRemotePath(executable, true); if (anExecutable != null) { executable = anExecutable;