code: public SftpFileAttributes getAttributes(SftpFile file)
  			throws SftpStatusException, SshException {
  
  		try {
  			if (file.getHandle() == null) {
  				return getAttributes(file.getAbsolutePath());
  			}
  			UnsignedInteger32 requestId = nextRequestId();
  			Packet msg = createPacket();
  			msg.write(SSH_FXP_FSTAT);
  			msg.writeInt(requestId.longValue());
  			msg.writeBinaryString(file.getHandle());
  			if (version > 3) {
  				msg.writeInt(SftpFileAttributes.SSH_FILEXFER_ATTR_SIZE
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_PERMISSIONS
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_ACCESSTIME
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_CREATETIME
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_MODIFYTIME
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_ACL
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_OWNERGROUP
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_SUBSECOND_TIMES
  						| SftpFileAttributes.SSH_FILEXFER_ATTR_EXTENDED);
  			}
  			sendMessage(msg);
  
  			return extractAttributes(getResponse(requestId));
  		} catch (SshIOException ex) {
  			throw ex.getRealException();
  		} catch (IOException ex) {
  			throw new SshException(ex);
  		}
  
  	}
docs: Get the attributes of a file.
  
  @param file
  @return SftpFileAttributes
  @throws SftpStatusException
  , SshException