11 Replies Latest reply: May 15, 2012 1:17 PM by Dmitry Zhuravlev RSS

Deletion of node still leave *.modeshape meta files.

Dmitry Zhuravlev Newbie

Hi, all!

 

I encounter with a problem, while try to remove nodes from modeshape 2.7 repository.

 

I have a repository with FileSystemSource connector:

 

 

<mode:source jcr:name="Files" mode:classname="org.modeshape.connector.filesystem.FileSystemSource"
                 mode:extraPropertiesBehavior="store"
                 mode:exclusionPattern="^.*\.modeshape$|^.*\.svn$"
                 mode:workspaceRootPath="./filesWorkspace"
                 mode:defaultWorkspaceName="files"
                 mode:creatingWorkspacesAllowed="false"
                 mode:updatesAllowed="true"/>

 

 

 

 

In additional to standard JCR properties for files I have some mixins. I wrote a delete file method:

 

public boolean deleteFile( String nameInRepo) throws IOException, RepositoryException {
    Session session = repository.login();
    JcrTools jcrTools = new JcrTools();
    String absPath = nameInRepo.startsWith("/") ? nameInRepo : "/" + nameInRepo;
    if (!session.nodeExists(absPath)) {
      return false;
    }
    Node node = session.getNode(absPath);
    //delete children nodes if exists
    jcrTools.removeAllChildren(node);
    //delete all properties include mixins
    PropertyIterator pIt = node.getProperties();
    while (pIt.hasNext()) {
      javax.jcr.Property property = pIt.nextProperty();
      property.remove();
    }
    node.remove();
    session.save();
    session.logout();
    return true;
  }

 

 

 

 

This method successfully remove node except one file "file_name.modeshape" with content

modeint:nodeDefinition (string) "{httpwww.modeshape.org1.0}root//{httpwww.jcp.orgjcrnt1.0}base"

 

I have no idea how to force modeshape to erase this file too.

 

Any idea?