Demo file copy using Guava

/* Demo file copy using Guava
 * src:file to be copied
 * dst:copied/new file created from copy.
 */
   public void dtmCopyFile(final String src, final String dst)
   {
      checkNotNull(src, "Source file cannot be null.");

      checkNotNull(dst, "Destination file cannot be null.");

      final File srcFile = new File(src);
      final File dstFile = new File(dst);

      try
      {
         Files.copy(srcFile, dstFile);
      }
      catch (IOException fileIoEx)
      {
         err.println("ERROR");
         err.println("Error copying file.");
err.println("Error Message: " + fileIoEx.toString() );
      }
   }

Comments

Popular posts from this blog

Basic Send Message to MQ with Java and IBM MQ JMS

Basic Receive Message to MQ with Java and IBM MQ JMS

Creating a simple Alert / Success Message with ASP.NET/VB using Bootstrap