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

Problem creating directories for FSDirectory

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/store
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: All

    • Bugzilla Id:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: