Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be available on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 1202926 - Uploaded file name with spaces breaks upload, download, rename and copy operations
Summary: Uploaded file name with spaces breaks upload, download, rename and copy opera...
Keywords:
Status: CLOSED EOL
Alias: None
Product: JBoss BRMS Platform 6
Classification: Retired
Component: Business Central
Version: 6.1.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ER5
: 6.2.0
Assignee: Walter Medvedeo
QA Contact: Jozef Marko
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-03-17 17:39 UTC by Jiri Locker
Modified: 2020-03-27 19:09 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-27 19:09:47 UTC
Type: Bug


Attachments (Terms of Use)
Upload exception (4.17 KB, text/plain)
2015-03-17 17:40 UTC, Jiri Locker
no flags Details
Download exception (4.17 KB, text/plain)
2015-03-17 17:40 UTC, Jiri Locker
no flags Details

Description Jiri Locker 2015-03-17 17:39:59 UTC
Description of problem:
1. When creating an Uploaded file in Project Authoring perspective, it is possible to input name containing spaces (which is a valid one). However BaseUploadServlet probably doesn't escape URI-illegal characters in the file name when creating git path URI and so fails with java.net.URISyntaxException.

2. The same problem occurs when downloading contents of Uploaded file asset with spaces in name. In this case java.net.URISyntaxException originates from FileDownloadServlet.

The errors above have no visible UI response, exception stack trace is printed into server log.

3. When renaming/copying Uploaded file and typing a new name with spaces, error dialog pops up with the following message:

Unable to complete your request. The following exception occurred: java.lang.StringIndexOutOfBoundsException:String index out of range: -1.

There are no further details in server.log.

Version-Release number of selected component (if applicable):
6.1.0.ER6

How reproducible:
-

Steps to Reproduce:
1. Create new Uploaded file in Project Authoring perspective.
2. Use name containing a space, e.g. "My File".
3. Select ~any~ existing file on local file system (not a .txt file).
4. Hit Ok to submit upload dialog, check server log, check Other section in Project Explorer.

5. Create Uploaded file without spaces in name, upload any file.
6. Clone the repository, rename the file to "My File", commit and push changes.
7. Open "My File" in Business Central.
8. Hit Download, check server.log.

9. Create Uploaded file without spaces in name, upload any file.
10. Try to rename or copy the file using new name with a space.

Actual results:
- Steps 4. & 8. java.net.URISyntaxException in server log.
- Step 10. Error dialog with java.lang.StringIndexOutOfBoundsException:String index out of range: -1.

Expected results:
Business Central should be able to handle Uploaded file assets with spaces in name when uploading, downloading renaming or copying.

Additional info:

Comment 1 Jiri Locker 2015-03-17 17:40:32 UTC
Created attachment 1002888 [details]
Upload exception

Comment 2 Jiri Locker 2015-03-17 17:40:58 UTC
Created attachment 1002889 [details]
Download exception

Comment 4 Jozef Marko 2015-11-09 15:06:32 UTC
Walter, thanks for fix. Plus point for written tests. Great job.

There was only small problem. File "a b c.xyz" was downloaded as "a.xyz". This PR should fix it:
https://github.com/uberfire/uberfire/pull/211

Verified on 6.2.0.ER5.


Note You need to log in before you can comment on or make changes to this bug.