* @param decodedFile
* @return absolute path to a workspace registered file.
*/
public String mapToWorkspaceFileIfRequired(String decodedFile) {
String mappedFile = null;
PathEntry mappedPathEntry = null;
// check to see if the file exists on the file system
java.io.File fileSystemFile = new java.io.File(decodedFile);
if (fileSystemFile.exists() && pathMapper != null) {
mappedPathEntry = pathMapper.getLocalFile(decodedFile);
} else {
// file doesn't exist so we must remap it, using the PDT path mapper
// which could end up prompting the user to create a mapping
try {
if (projectScript != null) {
mappedPathEntry = DebugSearchEngine.find(decodedFile, this);
} else {
mappedPathEntry = DebugSearchEngine.find(pathMapper,
decodedFile, null, this);
}
} catch (Exception e1) {
}
}
// do we now have a remapped file ?
if (mappedPathEntry == null) {
final PharPath pharPath = PharPath.getPharPath(new Path(
"phar:" + decodedFile)); //$NON-NLS-1$
if (pharPath != null) {
DBGpLogger
.debug("inbound File '" + decodedFile + "' remapped to phar file"); //$NON-NLS-1$ //$NON-NLS-2$
mappedFile = "phar:" + decodedFile; //$NON-NLS-1$
} else {
DBGpLogger
.debug("inbound File '" + decodedFile + "' Not remapped"); //$NON-NLS-1$ //$NON-NLS-2$
mappedFile = decodedFile;
}
} else {
mappedFile = mappedPathEntry.getResolvedPath();
IResource file = ResourcesPlugin.getWorkspace().getRoot()
.findMember(new Path(mappedFile));
if (file != null) {
// changed as RSE resources return null for RawLocation.
IPath t = file.getRawLocation();