code: private static void copyMetadata(final File aFile, final Element aElement) {
          final SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT, Locale.US);
          final StringBuilder permissions = new StringBuilder();
          final Date date = new Date(aFile.lastModified());
  
          aElement.setAttribute(FILE_PATH, aFile.getAbsolutePath());
          aElement.setAttribute(MODIFIED, formatter.format(date));
  
          if (aFile.canRead()) {
              permissions.append('r');
          }
  
          if (aFile.canWrite()) {
              permissions.append('w');
          }
  
          aElement.setAttribute("permissions", permissions.toString());
      }
docs: Copy file metadata into the supplied file element.
  
  @param aFile A file to extract metadata from
  @param aElement A destination element for the file metadata