Uploaded image for project: 'Debezium'
  1. Debezium
  2. DBZ-1621

IoUtil Bugfix

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.0.0.CR1
    • None
    • core-library
    • None

    Description

      Bug:
      IoUtil method

      public static File createDirectory(Path path, boolean removeExistingContent) throws IOException {
              File dir = path.toAbsolutePath().toFile();
              if (dir.exists() && dir.canRead() && dir.canWrite()) {
                  if (dir.isDirectory()) {
                      delete(path);
                      return dir;
                  }
                  throw new IllegalStateException("Expecting '" + path + "' to be a directory but found a file");
              }
              dir.mkdirs();
              return dir;
          }
      

      parameter removeExistingContent is not take effect.

      Code Improve:
      IoUtil method

      InputStream getResourceAsStream(String resourcePath, ClassLoader classLoader, Class<?> clazz, String resourceDesc, Consumer<String> logger) {
      ....
      InputStream result = null;
      if (result == null) {
      ...
      }
      

      This can be simplified

      Attachments

        Activity

          People

            Unassigned Unassigned
            pan3793 Cheng Pan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: