Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-986

FileSystemConnector should perform validation on filenamefilter

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Critical
    • 2.5.0.Final
    • 2.4.0.Final, 2.2.1.GA
    • Storage
    • None

    Description

      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.

      Attachments

        Activity

          People

            bcarothers_jira Brian Carothers (Inactive)
            jpechane Jiri Pechanec
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: