Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-16

Problem creating directories for FSDirectory

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • core/store
    • None
    • Operating System: other
      Platform: All

    • 6914

    Description

      There is a problem when you try to create a directory (FSDirectory) that doesn't exists and you
      specified a path with a depth greater than 1.

      For example: lucia/index/

      The problem
      lays on the method
      private synchronized void create() throws IOException {
      if
      (!directory.exists())
      directory.mkdir(); <======== HERE SHOULD BE mkdirs();

      String[] files = directory.list(); // clear old files
      for (int i = 0; i < files.length; i++)

      { File file = new File(directory, files[i]); if (!file.delete()) throw new IOException("couldn't delete " + files[i]); }

      }

      Regerds

      Attachments

        Activity

          People

            drag0n2@yahoo.com Eugene Gluzberg
            luispenya@aqs.es Luis Peña
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: