test_class.file: sdk/dslink/src/test/java/org/dsa/iot/dslink/util/FileUtilsTest.java
test_class.identifier: FileUtilsTest
test_case.body: @Test
      @SuppressWarnings("unused")
      public void write() throws IOException {
          File file = File.createTempFile("test", "tmp");
          Assert.assertTrue(file.isFile());
          try {
              FileUtils.write(file, "Hello world".getBytes("UTF-8"));
  
              byte[] data = FileUtils.readAllBytes(file);
              Assert.assertNotNull(data);
  
              String s = new String(data, "UTF-8");
              Assert.assertEquals("Hello world", s);
          } finally {
              boolean ignored = file.delete();
          }
      }
test_case.class_method_signature: FileUtilsTest.write()
test_case.full_signature: @Test @SuppressWarnings("unused") public void write()
test_case.identifier: write
test_case.invocations: createTempFile assertTrue isFile write getBytes readAllBytes assertNotNull assertEquals delete
test_case.modifiers: @Test @SuppressWarnings("unused") public
test_case.parameters: ()
test_case.return: void
test_case.signature: void write()
focal_class.declarator: LOGGER = LoggerFactory.getLogger(FileUtils.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger LOGGER = LoggerFactory.getLogger(FileUtils.class);
focal_class.type: Logger
focal_class.var_name: LOGGER
focal_class.file: sdk/dslink/src/main/java/org/dsa/iot/dslink/util/FileUtils.java
focal_class.identifier: FileUtils
focal_class.class_method_signature: FileUtils.readAllBytes(File src)
focal_class.full_signature: public static byte[] readAllBytes(File src)
focal_class.identifier: readAllBytes
focal_class.modifiers: public static
focal_class.parameters: (File src)
focal_class.return: byte[]
focal_class.signature: byte[] readAllBytes(File src)
focal_class.class_method_signature: FileUtils.write(File path, byte[] bytes)
focal_class.full_signature: public static void write(File path, byte[] bytes)
focal_class.identifier: write
focal_class.modifiers: public static
focal_class.parameters: (File path, byte[] bytes)
focal_class.return: void
focal_class.signature: void write(File path, byte[] bytes)
focal_class.class_method_signature: FileUtils.copy(File src, File dest)
focal_class.full_signature: @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE") public static void copy(File src, File dest)
focal_class.identifier: copy
focal_class.modifiers: @SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE") public static
focal_class.parameters: (File src, File dest)
focal_class.return: void
focal_class.signature: void copy(File src, File dest)
focal_method.body: public static void write(File path, byte[] bytes) throws IOException {
          if (path.delete() && LOGGER.isDebugEnabled()) {
              LOGGER.debug("Removed " + path.getPath() + " during writing");
          }
          try (FileOutputStream stream = new FileOutputStream(path)) {
              stream.write(bytes);
              stream.flush();
              try {
                  stream.getFD().sync();
              } catch (SyncFailedException ignored) {
              }
          }
      }
focal_method.class_method_signature: FileUtils.write(File path, byte[] bytes)
focal_method.full_signature: public static void write(File path, byte[] bytes)
focal_method.identifier: write
focal_method.invocations: delete isDebugEnabled debug getPath write flush sync getFD
focal_method.modifiers: public static
focal_method.parameters: (File path, byte[] bytes)
focal_method.return: void
focal_method.signature: void write(File path, byte[] bytes)