This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227750

Summary: Illegal character (probably underscore) in hostname
Product: platform Reporter: krauth
Component: FilesystemsAssignee: Jaroslav Havlin <jhavlin>
Status: RESOLVED WONTFIX    
Severity: normal CC: exceptions_reporter, jtulach, mkleint
Priority: P3    
Version: 7.3   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Exception Reporter:
Attachments: Messages log

Description krauth 2013-03-20 23:25:47 UTC
Created attachment 132880 [details]
Messages log

Opening a project created with a previous version of NetBeans. The project sits in the list of projects, but a right click does not pup up the context menu. So it can't be deleted from the interface.
Comment 1 Milos Kleint 2013-03-21 07:30:26 UTC
reassigning to filesystems. we have a valid FileObject and calling toUrl throws exception that is not mentioned in toUrl javadoc. please evaluate
Comment 2 Jaroslav Tulach 2013-07-09 09:47:05 UTC
The following test seems to pass OK (on Linux with UTF-8 encoding, the reporter uses Cp1252 encoding):

diff -r da0c3769e51d masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/FileBasedURLMapperTest.java
--- a/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/FileBasedURLMapperTest.java      Tue Jul 09 06:29:38 2013 +0000
+++ b/masterfs/test/unit/src/org/netbeans/modules/masterfs/filebasedfs/FileBasedURLMapperTest.java      Tue Jul 09 11:46:14 2013 +0200
@@ -91,5 +91,9 @@
         assertEquals("192.168.0.201", uri.getHost());
         assertEquals("/data/services/web/com_resource/", uri.getPath());
     }
-    
+
+    public void testUnderscore() throws Exception {
+        URI uri = FileBasedURLMapper.toURI("/db_server/db-scripts/", true, '/');
+        assertNotNull(uri);
+    }
 }
Comment 3 Jaroslav Tulach 2013-07-09 09:51:48 UTC
*** Bug 229026 has been marked as a duplicate of this bug. ***
Comment 4 Jaroslav Havlin 2013-07-10 13:53:16 UTC
(In reply to comment #2)
> The following test seems to pass OK (on Linux with UTF-8 encoding, 
> the reporter uses Cp1252 encoding):
The test passes also on Windows with encoding Cp1252.
Comment 5 Jaroslav Havlin 2013-07-11 12:32:24 UTC
The following test (added to FileBasedURLMapperTest) fails:

public void testUnderscore2() throws Exception {
    URI uri = FileBasedURLMapper.toURI("//db_server/a/", true, '/');
    assertNotNull(uri);
}

In URI "//db_server/a/", host name is "db_server", which contains an underscore, which is not allowed. (Although some services support it.)

This probably cannot be fixed in NetBeans, because we need to work with URLs of files.
Workaround would be renaming of the host, or creating an alias for it.

Jarda, please, any ideas?
Comment 6 Jaroslav Havlin 2013-07-26 08:09:20 UTC
I've tried replacing "_" with "%5F", just in case it works, but it didn't help.
Comment 7 Jaroslav Havlin 2013-08-19 13:40:36 UTC
I'm sorry, I don't know how to fix this in NetBeans.
Underscore characters are not allowed in host names,
although it's possible to have such hosts in OS Windows.

Please, use IP addresses or create some underscore-free aliases
for the hosts that contain underscores.

Thank you.
Comment 8 sagos1 2016-01-18 14:11:02 UTC
Нужно убрать нижнее подчёркивание( _ ) в пути имени файла -"It is necessary to remove the underscore in the file name path"...