Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 312772

Summary: [Workbench] Wrong folder used if workspace path contains special symbols
Product: [Eclipse Project] Platform Reporter: Alexey Markevich <a_markevich>
Component: IDEAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: minor    
Priority: P3 CC: bartoki, esimpson, marek.chodorowski, remy.suen, sptaszkiewicz, stew
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Windows 2000   
Whiteboard: stalebug
Attachments:
Description Flags
patch v0.1 none

Description Alexey Markevich CLA 2010-05-13 06:54:08 EDT
In Workspace Launcher I select folder "D:\WORKSPACE\! @ # $ % ^ & ( ) - _ = + ` ' { } [ ]"
But actually workspace created at "d:\WORKSPACE\! @"
Comment 1 Alexey Markevich CLA 2010-05-13 06:58:33 EDT
... and no problem with this path: "d:\WORKSPACE\ ! @ $ % ^ & ( ) - _ = + ` ' { } [ ]"
Comment 2 Susan McCourt CLA 2010-05-13 14:52:33 EDT
AFACT, the dialog does no particular validation of the name. 
If there are special characters that should be validated, this would need to be specified in the resource API.  Moving to platform resources for comment.
Comment 3 Alexey Markevich CLA 2010-05-14 05:13:13 EDT
No validation required - I selected existing folder using Browse button and expected that exactly this folder will used for workspace.
Comment 4 Szymon Ptaszkiewicz CLA 2011-08-12 07:46:19 EDT
Moving to Platform/IDE to reconsider adding validation or to close as duplicate of bug 3109 (see also duplicates of this bug).
Comment 5 Remy Suen CLA 2011-08-16 08:52:58 EDT
(In reply to comment #4)
> Moving to Platform/IDE to reconsider adding validation or to close as duplicate
> of bug 3109 (see also duplicates of this bug).

Szymon, do we have a list of characters that we know for sure are "banned"?
Comment 6 Szymon Ptaszkiewicz CLA 2011-08-16 09:04:37 EDT
(In reply to comment #5)
> Szymon, do we have a list of characters that we know for sure are "banned"?

I think we do not have a such a list for workspace directory. Readme mentions invalid characters for installation directory only (readme_eclipse.html#KnownIssues):

"Eclipse will fail to launch if installed in a directory whose path contains certain invalid characters, including :%#<>"!. The workaround is to install Eclipse in a directory whose path does not contain invalid characters. (bugs 3109 and 17281)"

The characters are probably the same. The difference is that when using invalid character in workspace path, Eclipse will start but the workspace will be created in a different location.
Comment 7 Szymon Ptaszkiewicz CLA 2011-08-22 12:05:45 EDT
See also bug 217890 and bug 316204. There is also bug 162759 that refers to similar issue with special characters.
Comment 8 Marek Chodorowski CLA 2012-01-17 07:53:06 EST
Created attachment 209618 [details]
patch v0.1

The ChooseWorkspaceDialog validates path of the workspace. User is not able to type '#' character.

This path does not fix case when user specified '-data' parameter.
Comment 9 Marek Chodorowski CLA 2012-01-19 09:52:04 EST
'#' characters are not allowed because Eclipse uses java.net.URL type to store "osgi.instance.area". Plug-ins use this location to store their data. For example, the Resources plug-in uses this as the default location for projects (aka the workspace).

It is possible to append a "fragment" (also known as: "ref" or "reference")to the URL. This fragment is indicated by the "#" character, for example:

http://example.com/index.html#chapter1

"chapter1" from the example above is not part of the URL, but it specifies part of the html document (actually, the meaning is resource specific).

When function getFile() is invoked on this URL, then "/index.html" is returned.
This function is used several times during workspace creation. That is why everything what is after the "#" character is trimmed.

Sollution which allows for usage of the "#" characters would require changes in Eclipse API.
Comment 10 Eclipse Genie CLA 2021-01-21 02:34:07 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.