| Summary: | FileSystemConnect does not create files | ||
|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise SOA Platform 5 | Reporter: | Jiri Pechanec <jpechane> |
| Component: | EDS | Assignee: | Van Halbert <vhalbert> |
| Status: | CLOSED NOTABUG | QA Contact: | |
| Severity: | urgent | Docs Contact: | |
| Priority: | urgent | ||
| Version: | 5.1.0.ER3 | ||
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| URL: | http://jira.jboss.org/jira/browse/SOA-2441 | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2010-11-02 02:33:33 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
Link: Added: This issue depends MODE-967 The problem with the above code is that the nt:file node being added is called "createfile.mode", which would be represented on the file system with a "createfile.mode" file. However, you've configured the connector's filename filter to exclude files ending in ".mode", so your file will not be exposed by the connector. The filename filter is used to **hide** files from JCR. Therefore, marking this issue as 'rejected'. From the documentation filenameFilter - Specifies the FilenameFilter that is used to determine which files and folders in the underlying file system should be exposed through this connector. So the property defines which files are visible or not. I tried to remove the property and the result is same is with the property set. Moreover I see two further problems 1) Usability - exclusion is defined by using regular expression for for inclusion I have to provide classname 2) Configuration handling - this source was clearly mis-configured. By mistake I put there a regular expression instead of classname and ModeShape happily allowed me to work with it. Link: Added: This issue is incorporated by SOA-2447 Regarding the filenameFilter, we need to determine what's the expected behavior is, whether its for inclusion or exclusion. Once that's determined, the connector can be fixed accordingly. As for the misconfiguration, i'll create another jira to track that a validation check should be performed on the filenamFilter value, and throw an exception if its invalid. The filenameFilter is suppose to be a class that filters what the user sees, not a pattern. There's a jira regarding the validation that should be done. |
project_key: SOA This code does not work Session session = RepositoryReferenceFactory.getRepository("test-file").login(); ValueFactory vf = session.getValueFactory(); Node root = session.getRootNode(); Node file = root.addNode("createfile.mode", "nt:file"); Node content = file.addNode("jcr:content", "nt:resource"); content.setProperty("jcr:data", vf.createBinary(new ByteArrayInputStream("Write 1".getBytes()))); session.save(); session.getNode("/createfile.mode"); It throws an exception javax.jcr.PathNotFoundException: Unable to find "{}createfile.mode"; lowest existing path is "/" at org.modeshape.jcr.JcrSession.getNode(JcrSession.java:779) at org.modeshape.jcr.JcrSession.getNode(JcrSession.java:649) at org.modeshape.jcr.JcrSession.getNode(JcrSession.java:106) at org.jboss.soa.modeshape.qa.tests.BrokenFileConnectorTest.fileCreate(BrokenFileConnectorTest.java:31) Connector configuration <mode:source jcr:name="test-file" mode:classname="org.modeshape.connector.filesystem.FileSystemSource" mode:creatingWorkspaceAllowed="true" mode:retryLimit="3" mode:defaultWorkspaceName="default" mode:filenameFilter="*.mode" mode:updatesAllowed="true" > <xsl:attribute name="mode:workspaceRootPath"> <xsl:value-of select="$repositorypath"/> </xsl:attribute> <mode:predefinedWorkspaceNames>file1</mode:predefinedWorkspaceNames> <mode:predefinedWorkspaceNames>file2</mode:predefinedWorkspaceNames> <mode:predefinedWorkspaceNames>custom-federated</mode:predefinedWorkspaceNames> </mode:source> The file is not physically created after the session.save(). Creating folders works reliably. This code was worked in ER2.