1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-02 22:55:26 +02:00

[332275] "#" in local file name is changed to "#035" after copy

This commit is contained in:
David McKnight 2011-01-04 16:02:41 +00:00
parent 84c1a81398
commit d80ff5274a

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2009 IBM Corporation and others. All rights reserved.
* Copyright (c) 2002, 2011 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -14,12 +14,17 @@
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* David Dykstal (IBM) - [226561] Add API markup to RSE javadocs for extend / implement
* David McKnight (IBM) - [276194] cannot open file with '...' in pathname
* David McKnight (IBM) - [332275] "#" in local file name is changed to "#035" after copy
********************************************************************************/
package org.eclipse.rse.core.model;
import java.io.File;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
/**
* This is a utility class used in the construction of file names.
* @noextend This class is not intended to be subclassed by clients.
@ -53,6 +58,12 @@ public class SystemEscapeCharHelper {
public String getStringForFileName(String name)
{
// first do a validation before escaping
IStatus status = ResourcesPlugin.getWorkspace().validatePath(name,IResource.FILE);
if (status.getCode() == IStatus.OK){ // if it's valid, don't bother escaping
return name;
}
String fileName = name;
int i = 0;