code: public void upload(IProgressMonitor monitor, File file) {
  
      final int taskSize = 1024;
  
      monitor.setTaskName("Upload file " + this.path);
  
      BufferedInputStream istream = null;
      DataOutputStream ostream = null;
  
      try {
        istream = new BufferedInputStream(new FileInputStream(file));
        ostream = getDFS().create(this.path);
  
        int bytes;
        byte[] buffer = new byte[taskSize];
  
        while ((bytes = istream.read(buffer)) >= 0) {
          if (monitor.isCanceled())
            return;
          ostream.write(buffer, 0, bytes);
          monitor.worked(1);
        }
  
      } catch (Exception e) {
        ErrorMessageDialog.display(String.format(
            "Unable to uploade file %s to %s", file, this.path), e
            .getLocalizedMessage());
  
      } finally {
        try {
          if (istream != null)
            istream.close();
        } catch (IOException e) {
          e.printStackTrace();
          // nothing we can do here
        }
        try {
          if (ostream != null)
            ostream.close();
        } catch (IOException e) {
          e.printStackTrace();
          // nothing we can do here
        }
      }
    }
docs: Upload a local file to this file on the distributed file system
  
  @param monitor
  @param file