Exemplo n.º 1
0
 /**
  * Create the federated share provider
  *
  * @return FederatedShareProvider
  */
 protected function federatedShareProvider()
 {
     if ($this->federatedProvider === null) {
         /*
          * Check if the app is enabled
          */
         $appManager = $this->serverContainer->getAppManager();
         if (!$appManager->isEnabledForUser('federatedfilesharing')) {
             return null;
         }
         /*
          * TODO: add factory to federated sharing app
          */
         $l = $this->serverContainer->getL10N('federatedfilessharing');
         $addressHandler = new AddressHandler($this->serverContainer->getURLGenerator(), $l);
         $notifications = new Notifications($addressHandler, $this->serverContainer->getHTTPClientService());
         $tokenHandler = new TokenHandler($this->serverContainer->getSecureRandom());
         $this->federatedProvider = new FederatedShareProvider($this->serverContainer->getDatabaseConnection(), $addressHandler, $notifications, $tokenHandler, $l, $this->serverContainer->getLogger(), $this->serverContainer->getRootFolder());
     }
     return $this->federatedProvider;
 }