@Override public boolean isAllowedToTransferFile(ContactId contact) throws RemoteException {
  if (contact == null) {
    throw new ServerApiIllegalArgumentException("contact must not be null!");
  }
  try {
    Capabilities remoteCapabilities=mContactManager.getContactCapabilities(contact);
    if (remoteCapabilities == null) {
      if (sLogger.isActivated()) {
        sLogger.debug("Cannot transfer file as the capabilities of contact " + contact + " are not known.");
      }
      return false;
    }
    FileTransferProtocol protocol=getFileTransferProtocolForOneToOneFileTransfer(contact);
    if (protocol == null) {
      if (sLogger.isActivated()) {
        sLogger.debug("Cannot transfer file as no valid file transfer protocol could be determined.");
      }
      return false;
    }
    MessagingMode mode=mRcsSettings.getMessagingMode();
switch (mode) {
case INTEGRATED:
case SEAMLESS:
      if ((FileTransferProtocol.MSRP == protocol && mRcsSettings.isFtAlwaysOn()) || (FileTransferProtocol.HTTP == protocol && mRcsSettings.isFtHttpCapAlwaysOn())) {
        break;
      }
    if (!mImService.isCapabilitiesValid(remoteCapabilities)) {
      if (sLogger.isActivated()) {
        sLogger.debug("Cannot transfer file as the cached capabilities of contact " + contact + " are not valid anymore for one-to-one communication.");
      }
      return false;
    }
  break;
default :
break;
}
return true;
}
 catch (ServerApiBaseException e) {
if (!e.shouldNotBeLogged()) {
sLogger.error(ExceptionUtil.getFullStackTrace(e));
}
throw e;
}
catch (Exception e) {
sLogger.error(ExceptionUtil.getFullStackTrace(e));
throw new ServerApiGenericException(e);
}
}

@ Override public boolean isAllowedToTransferFile ( ContactId contact ) throws RemoteException { if ( contact == null ) { throw new ServerApiIllegalArgumentException ( "contact must not be null!" ) ; } try { Capabilities remoteCapabilities = mContactManager . getContactCapabilities ( contact ) ; if ( remoteCapabilities == null ) { if ( sLogger . isActivated ( ) ) { sLogger . debug ( "Cannot transfer file as the capabilities of contact " + contact + " are not known." ) ; } return false ; } FileTransferProtocol protocol = getFileTransferProtocolForOneToOneFileTransfer ( contact ) ; if ( protocol == null ) { if ( sLogger . isActivated ( ) ) { sLogger . debug ( "Cannot transfer file as no valid file transfer protocol could be determined." ) ; } return false ; } MessagingMode mode = mRcsSettings . getMessagingMode ( ) ; switch ( mode ) { case INTEGRATED : case SEAMLESS : if ( ( FileTransferProtocol . MSRP == protocol && mRcsSettings . isFtAlwaysOn ( ) ) || ( FileTransferProtocol . HTTP == protocol && mRcsSettings . isFtHttpCapAlwaysOn ( ) ) ) { break ; } if ( ! mImService . isCapabilitiesValid ( remoteCapabilities ) ) { if ( sLogger . isActivated ( ) ) { sLogger . debug ( "Cannot transfer file as the cached capabilities of contact " + contact + " are not valid anymore for one-to-one communication." ) ; } return false ; } break ; default : break ; } return true ; } catch ( ServerApiBaseException e ) { if ( ! e . shouldNotBeLogged ( ) ) { sLogger . error ( ExceptionUtil . getFullStackTrace ( e ) ) ; } throw e ; } catch ( Exception e ) { sLogger . error ( ExceptionUtil . getFullStackTrace ( e ) ) ; throw new ServerApiGenericException ( e ) ; } }
returns true if it is possible to initiate file transfer to the contact specified by the contact parameter , else returns false .
