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 ( ' ' ) ; } if ( aFile . canWrite ( ) ) { permissions . append ( ' ' ) ; } aElement . setAttribute ( "permissions" , permissions . toString ( ) ) ; }
Copy file metadata into the supplied file element .