예제 #1
0
 private void registerComponents() throws RepositoryConfigurationException, RepositoryException {
   SecurityHelper.doPrivilegedAction(
       new PrivilegedAction<Void>() {
         public Void run() {
           registerComponentInstance(config);
           registerComponentImplementation(FileCleanerHolder.class);
           registerComponentImplementation(LockRemoverHolder.class);
           return null;
         }
       });
   registerWorkspacesComponents();
   registerRepositoryComponents();
 }
예제 #2
0
  /** {@inheritDoc} */
  @Override
  protected Log getLogger(final String name) {
    Logger slf4jlogger =
        SecurityHelper.doPrivilegedAction(
            new PrivilegedAction<Logger>() {
              public Logger run() {
                return LoggerFactory.getLogger(name);
              }
            });

    if (slf4jlogger instanceof LocationAwareLogger) {
      return new LocationAwareSLF4JExoLog((LocationAwareLogger) slf4jlogger);
    } else {
      return new SLF4JExoLog(slf4jlogger);
    }
  }
예제 #3
0
  public FtpServerImpl(
      FtpConfig configuration, CommandService commandService, RepositoryService repositoryService)
      throws Exception {
    this.configuration = configuration;
    this.repositoryService = repositoryService;

    InputStream commandStream =
        SecurityHelper.doPrivilegedAction(
            new PrivilegedAction<InputStream>() {
              public InputStream run() {
                return getClass().getResourceAsStream(COMMAND_PATH);
              }
            });

    commandService.putCatalog(commandStream);
    commandCatalog = commandService.getCatalog(FtpConst.FTP_COMMAND_CATALOG);
  }