Initializes file list from the list of files in the repository.
This method should be called while holding a lock on fileList.

@param force indicator that the list should be initialized from the file
system even if it was initialized before.
435177
private void initFileList(boolean force) {
		if (totalSize < 0 || force) {
			fileList.clear();
			parentFilesMap.clear();
			totalSize = 0L;
			File[] files = listRepositoryFiles();
			if (files.length > 0) {
				Arrays.sort(files, fileComparator);
				for (File file: files) {
					long size = AccessHelper.getFileLength(file);
					// Intentional here to NOT add these files to activeFilesMap since they are legacy
					fileList.add(new FileDetails(file, getLogFileTimestamp(file), size, null));
					totalSize += size;
					if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()) {
						debugLogger.logp(Level.FINE, thisClass, "initFileList", "add: "+file.getPath()+" sz: "+size+
							" listSz: "+fileList.size()+" new totalSz: "+totalSize);
					}
					incrementFileCount(file);
				}
				debugListLL("fileListPrePop") ;
			}
				
			deleteEmptyRepositoryDirs();

			if (debugLogger.isLoggable(Level.FINE) && LogRepositoryBaseImpl.isDebugEnabled()){
				Iterator<File> parentKeys = parentFilesMap.keySet().iterator() ;
				while (parentKeys.hasNext()) {
					File parentNameKey = parentKeys.next() ;
					Integer fileCount = parentFilesMap.get(parentNameKey) ;
					debugLogger.logp(Level.FINE, thisClass, "initFileList", "  Directory: "+parentNameKey+" file count: "+ fileCount) ;									
				}
			}
		}		
	}
1330427
private void init( List<T> list ) {
		this.list = list;
		indexes = new int[ list.size() ];
		counters = new int[ list.size() ];

		for( int i = 0; i < indexes.length ; i++ ) {
			counters[i] = indexes[i] = i;
		}

		total = 1;
		for( int i = 2; i <= indexes.length ; i++ ) {
			total *= i;
		}

		permutation = 0;
	}
1373135
public void setCreatedArtifactList(java.util.Collection<CreatedArtifact> createdArtifactList) {
        if (createdArtifactList == null) {
            this.createdArtifactList = null;
            return;
        }

        this.createdArtifactList = new java.util.ArrayList<CreatedArtifact>(createdArtifactList);
    }
398763
private void checkList(List<FileLockReference> list, long position, long size)
        throws OverlappingFileLockException
    {
        assert Thread.holdsLock(list);
        for (FileLockReference ref: list) {
            FileLock fl = ref.get();
            if (fl != null && fl.overlaps(position, size))
                throw new OverlappingFileLockException();
        }
    }
418625
public void init(Consumer<ServerBuilder> init)
  {
    Objects.requireNonNull(init);
    
    _initList.add(init);
  }
695608
public void init(CmsObject cms, List<CmsResource> resources) {

        m_cms = cms;
        m_resources = resources;
    }
1300788
@Override
	public void initAllBundles() {

		stopProcessIfNeeded();

		if (config.getUseBundleMapping()) {
			bundleMapping = resourceBundleHandler.getJawrBundleMapping();
		}

		boolean mappingFileExists = resourceBundleHandler.isExistingMappingFile();
		boolean processBundleFlag = !config.getUseBundleMapping() || !mappingFileExists;

		StopWatch stopWatch = ThreadLocalJawrContext.getStopWatch();

		List<JoinableResourceBundle> bundleToProcess = this.bundles;
		boolean forceStoreJawrBundleMapping = false;
		if (!processBundleFlag) {
			String storeJawrConfigHashcode = resourceBundleHandler.getJawrBundleMapping()
					.getProperty(JawrConstant.JAWR_CONFIG_HASHCODE);
			String jawrConfigHashcode = getJawrConfigHashcode();
			boolean rebuildAllBundles = !config.getUseSmartBundling()
					|| (!jawrConfigHashcode.equals(storeJawrConfigHashcode));
			if (!rebuildAllBundles) {
				bundleToProcess = getBundlesToRebuild();
				if (!bundleToProcess.isEmpty() && LOGGER.isDebugEnabled()) {

					StringBuilder msg = new StringBuilder(
							"Jawr has detect changes on the following bundles, which will be updated :\n");
					for (JoinableResourceBundle b : bundleToProcess) {
						msg.append(b.getName()).append("\n");
					}
					LOGGER.debug(msg.toString());
				}
			} else {
				bundleMapping.clear();
				if (LOGGER.isDebugEnabled() && !jawrConfigHashcode.equals(storeJawrConfigHashcode)) {
					LOGGER.debug("Jawr config has changed since last bundling process. All bundles will be processed.");
				}
			}

			forceStoreJawrBundleMapping = !bundleToProcess.isEmpty();
		}

		// Execute processing
		build(bundleToProcess, forceStoreJawrBundleMapping, stopWatch);
	}
804156
public static void setInitFilePath(String filePath) {
		filePath=getPropertiesFilePath(filePath);
		
		if (staticFileProperties == null) {
			staticFileProperties=new FileProperties(filePath);
		} else {
			staticFileProperties.setInitFilePath(filePath);
		}
	}
819957
public void init(Sort sort) {
        Log.debug("Initializing index");
        try {
            this.sort = sort;

            // Get directory file
            file = new File(path);

            // Open or create directory
            FSDirectory fsDirectory = FSDirectory.open(file);
            directory = new NRTCachingDirectory(fsDirectory, maxMergeMB, maxCachedMB);

            // Setup index writer
            IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_48, analyzer);
            config.setRAMBufferSizeMB(ramBufferMB);
            config.setOpenMode(IndexWriterConfig.OpenMode.CREATE_OR_APPEND);
            config.setUseCompoundFile(true);
            config.setMergePolicy(new SortingMergePolicy(config.getMergePolicy(), sort));
            indexWriter = new IndexWriter(directory, config);

            // Setup NRT search
            SearcherFactory searcherFactory = new SearcherFactory() {
                public IndexSearcher newSearcher(IndexReader reader) throws IOException {
                    IndexSearcher searcher = new IndexSearcher(reader);
                    searcher.setSimilarity(new NoIDFSimilarity());
                    return searcher;
                }
            };
            TrackingIndexWriter trackingIndexWriter = new TrackingIndexWriter(indexWriter);
            searcherManager = new SearcherManager(indexWriter, true, searcherFactory);
            searcherReopener = new ControlledRealTimeReopenThread<>(trackingIndexWriter,
                                                                    searcherManager,
                                                                    refreshSeconds,
                                                                    refreshSeconds);
            searcherReopener.start(); // Start the refresher thread
        } catch (IOException e) {
            Log.error(e, "Error while initializing index");
            throw new RuntimeException(e);
        }
    }
1080377
public synchronized final void initialize() throws RepositoryException {
        if (!initialized) {
            try {
                doInitialize();
                initialized = true;
            } catch (RuntimeException e) {
                throw new RepositoryException(e);
            }
        }
    }
1112597
public void initialize(CmsListInfoBean listInfo) {

        m_dialogContent = new CmsFieldsetFormFieldPanel(listInfo, null);
        m_dialogContent.addStyleName(I_CmsInputLayoutBundle.INSTANCE.inputCss().highTextBoxes());
        m_dialogContent.getFieldSet().setOpenerVisible(false);
        m_dialogContent.getFieldSet().getElement().getStyle().setMarginTop(4, Style.Unit.PX);
        setMainContent(m_dialogContent);
        m_titleInput = new CmsTextBox();
        m_titleInput.setTriggerChangeOnKeyPress(true);
        m_titleInput.addValueChangeHandler(new ValueChangeHandler<String>() {

            public void onValueChange(ValueChangeEvent<String> event) {

                setOkEnabled(CmsStringUtil.isNotEmptyOrWhitespaceOnly(event.getValue()));
            }
        });
        addInputRow(
            org.opencms.ade.sitemap.client.Messages.get().key(
                org.opencms.ade.sitemap.client.Messages.GUI_MODEL_PAGE_TITLE_LABEL_0),

            m_titleInput);

        m_descriptionInput = new CmsTextBox();

        addDialogClose(null);
        addInputRow(
            org.opencms.ade.sitemap.client.Messages.get().key(
                org.opencms.ade.sitemap.client.Messages.GUI_MODEL_PAGE_DESCRIPTION_LABEL_0),

            m_descriptionInput);

        CmsPushButton closeButton = new CmsPushButton();
        closeButton.setText(Messages.get().key(Messages.GUI_CANCEL_0));
        closeButton.setUseMinWidth(true);
        closeButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.BLUE);
        closeButton.addClickHandler(new ClickHandler() {

            /**
             * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
             */
            public void onClick(ClickEvent event) {

                hide();
            }
        });
        addButton(closeButton);

        m_okButton = new CmsPushButton();
        m_okButton.setText(Messages.get().key(Messages.GUI_OK_0));
        m_okButton.setUseMinWidth(true);
        m_okButton.setButtonStyle(ButtonStyle.TEXT, ButtonColor.RED);
        m_okButton.addClickHandler(new ClickHandler() {

            /**
             * @see com.google.gwt.event.dom.client.ClickHandler#onClick(com.google.gwt.event.dom.client.ClickEvent)
             */
            public void onClick(ClickEvent event) {

                onOk();
            }
        });
        addButton(m_okButton);
        setOkEnabled(false);
        m_dialogContent.truncate(METRICS_KEY, CmsPopup.DEFAULT_WIDTH - 20);
    }
1056800
@Override
  public void initialize(String path, List<String> columns) throws IOException,
      UnsupportedOperationException {
    super.initialize(path, columns);
    initializeInternal();
  }
790659
@Override
    public void init(PolicyFinder finder) {
        try {
            logger.info("Loading repository policies...");
            setupActivePolicyDirectories();
            m_repositoryPolicies.clear();
            Map<String,AbstractPolicy> repositoryPolicies =
                    m_policyLoader.loadPolicies(m_policyParser,
                    m_validateRepositoryPolicies,
                    new File(m_repositoryBackendPolicyDirectoryPath));
            repositoryPolicies.putAll(
                    m_policyLoader.loadPolicies(m_policyParser,
                                 m_validateRepositoryPolicies,
                                 new File(m_repositoryPolicyDirectoryPath)));
            m_repositoryPolicies.addAll(repositoryPolicies.values());
            m_repositoryPolicySet = toPolicySet(m_repositoryPolicies, m_combiningAlgorithm);
        } catch (Throwable t) {
            logger.error("Error loading repository policies: " + t.toString(), t);
        }
    }
916306
@Override
    public void init() throws InitializationException {
        List<String> options = getOptionsByCommand(getCommand());
        options.contains(ASYNC_OPTION);
        async = true;
    }
419695
@Override
    protected void initializeImpl()
    {
        this.submitFileContentParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_FILE_CONTENT_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitFileContentParameter==null)
        {
            this.submitFileContentParameter="file";
        }
        this.submitFileNameParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_FILE_NAME_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitFileNameParameter==null)
        {
            this.submitFileNameParameter="filename";
        }
        this.submitTargetAddressParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_TARGET_ADDRESS_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitTargetAddressParameter==null)
        {
            this.submitTargetAddressParameter="targetaddress";
        }
        this.submitTargetNameParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_TARGET_NAME_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitTargetNameParameter==null)
        {
            this.submitTargetNameParameter="targetname";
        }
        this.submitSenderNameParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_SENDER_NAME_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitSenderNameParameter==null)
        {
            this.submitSenderNameParameter="sendername";
        }
        this.submitSenderFaxNumberParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_SENDER_FAX_NUMBER_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitSenderFaxNumberParameter==null)
        {
            this.submitSenderFaxNumberParameter="senderfaxnumber";
        }
        this.submitSenderEMailParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_SENDER_EMAIL_PARAMETER_NAME_PROPERTY_KEY);
        if(this.submitSenderEMailParameter==null)
        {
            this.submitSenderEMailParameter="senderemail";
        }
        this.suspendFaxJobIDParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.SUSPEND_ACTION_FAX_JOB_ID_PARAMETER_NAME_PROPERTY_KEY);
        if(this.suspendFaxJobIDParameter==null)
        {
            this.suspendFaxJobIDParameter="faxjobid";
        }
        this.resumeFaxJobIDParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.RESUME_ACTION_FAX_JOB_ID_PARAMETER_NAME_PROPERTY_KEY);
        if(this.resumeFaxJobIDParameter==null)
        {
            this.resumeFaxJobIDParameter="faxjobid";
        }
        this.cancelFaxJobIDParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.CANCEL_ACTION_FAX_JOB_ID_PARAMETER_NAME_PROPERTY_KEY);
        if(this.cancelFaxJobIDParameter==null)
        {
            this.cancelFaxJobIDParameter="faxjobid";
        }
        this.getStatusFaxJobIDParameter=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.GET_FAX_JOB_STATUS_ACTION_FAX_JOB_ID_PARAMETER_NAME_PROPERTY_KEY);
        if(this.getStatusFaxJobIDParameter==null)
        {
            this.getStatusFaxJobIDParameter="faxjobid";
        }
        this.addFileNamePart=true;
        String value=this.getConfigurationValue(FaxJob2HTTPRequestConverterConfigurationConstants.ADD_FILE_NAME_AS_PART_PROPERTY_KEY);
        if(value!=null)
        {
            this.addFileNamePart=Boolean.parseBoolean(value);
        }
        
        //initialize additional parameters
        this.additionalParameters=this.initializeAdditionalParameters();
        if(this.additionalParameters!=null)
        {
            //normalize for best performance
            this.additionalParameters=new HashMap<String,String>(this.additionalParameters);
            
            //protect from modification
            this.additionalParameters=Collections.unmodifiableMap(this.additionalParameters);
        }
    }
321401
private void importInitialLdif() throws IOException {

        if (this.initialLdif != null) {
            try (InputStream ldifStream = this.initialLdif.openStream()) {
                this.importLdif(ldifStream);
            }
        }
    }
1170541
public void init()
    throws IOException
  {
    long now = CurrentTime.getExactTime();

    // server/0263
    // _nextRolloverCheckTime = now + _rolloverCheckPeriod;

    Path path = getPath();

    if (path != null) {
      Files.createDirectories(path.getParent());

      _rolloverPrefix = path.getName(path.getNameCount() - 1).toString();

      long lastModified = Files.getLastModifiedTime(path).toMillis();
      
      if (lastModified <= 0 || now < lastModified) {
        lastModified = now;
      }

      // _calendar.setGMTTime(lastModified);

      _nextPeriodEnd = nextRolloverTime(lastModified);
    }
    else {
      _nextPeriodEnd = nextRolloverTime(now);
    }
    
    if (_archiveFormat != null || getRolloverPeriod() <= 0) {
    }
    else if (_rolloverCron != null)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
    else if (getRolloverPeriod() % DAY == 0)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d";
    else if (getRolloverPeriod() % HOUR == 0)
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H";
    else
      _archiveFormat = _rolloverPrefix + ".%Y%m%d.%H%M";
    
    _isInit = true;

    _rolloverListener.requeue(_rolloverAlarm);
    rollover();
  }