[jboss-jira] [JBoss JIRA] (DROOLS-2338) MemoryFileSystem losts contents of files all DRL scripts become "empty" if directory contains a space character
Mario Fusco (JIRA)
issues at jboss.org
Tue Feb 20 03:52:00 EST 2018
[ https://issues.jboss.org/browse/DROOLS-2338?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13535523#comment-13535523 ]
Mario Fusco commented on DROOLS-2338:
-------------------------------------
I cannot reproduce the problem. The following test case works for me. Can you please send a similar test case that demonstrates this issue?
{code}
@Test
public void testHelloWorldWithSpace() throws Exception {
KieServices ks = KieServices.Factory.get();
KieFileSystem kfs = ks.newKieFileSystem().write( "src/main/resources/my test/r1.drl", createDrl( "R1" ) );
ks.newKieBuilder( kfs ).buildAll();
KieSession ksession = ks.newKieContainer(ks.getRepository().getDefaultReleaseId()).newKieSession();
ksession.insert(new Message("Hello World"));
int count = ksession.fireAllRules();
assertEquals( 1, count );
}
{code}
> MemoryFileSystem losts contents of files all DRL scripts become "empty" if directory contains a space character
> ---------------------------------------------------------------------------------------------------------------
>
> Key: DROOLS-2338
> URL: https://issues.jboss.org/browse/DROOLS-2338
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.4.1.Final, 7.5.0.Final, 7.6.0.Final
> Environment: any
> Reporter: Alexander Kotikhov
> Assignee: Mario Fusco
> Attachments: Снимок экрана от 2018-02-19 18-08-49.png
>
>
> If a directory where any files are placed contains spaces
> MemoryFileSystem.getFile(String path) returns object with truncated name.
> To fix this error (in version 7.4.0) it is nessassary line 107
> *String name = decode( path ).substring( lastSlashPos + 1 );*
> replace with
> *String name = decode( path.substring( lastSlashPos + 1 ) );*
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the jboss-jira
mailing list