Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-13928 Improve File I/O by using Java NIO.2
  3. KAFKA-13929

Replace File.createNewFile() with Files.createFile()

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 3.3.0
    • None
    • None

    Description

      File.createNewFile() returns a boolean signifying whether the file creation was successful or not.

      There are multiple places in the Kafka code base where we are not checking the value of the returned boolean. 

      Replacing it with the Files.createFile() API will decrease the chances of inadvertent bugs in the code base since Files.createFile() API thrown exceptions when the creation is not successful.

      Attachments

        Issue Links

          Activity

            People

              divijvaidya Divij Vaidya
              divijvaidya Divij Vaidya
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: