Adds a directory default file.<p>

@param defaultFile the directory default file to add
775341
public void addDefaultFile(String defaultFile) {

        m_defaultFiles.add(defaultFile);
        if (CmsLog.INIT.isInfoEnabled()) {
            CmsLog.INIT.info(
                Messages.get().getBundle().key(
                    Messages.INIT_VFS_DEFAULT_FILE_2,
                    new Integer(m_defaultFiles.size()),
                    defaultFile));
        }
    }
515853
public void addFile(String filename, String filePath) {
        int pathIndex = filePathList.indexOf(filePath);
        if (pathIndex == -1) {
            fileNameList.add(filename);
            filePathList.add(filePath);
        }
    }
1195845
public void addProvider(String urlScheme, FileProvider provider) throws FileSystemException
    {
        ((DefaultFileSystemManager)fileSystemManager).addProvider(urlScheme, provider);
    }
1152010
public void addFile(File file) {
        String name = "file";
        files.put(normalizeDuplicateName(name), file);
    }
992422
public void replaceModuleFromDefault(String importFile) throws Exception {

        CmsModule module = CmsModuleImportExportHandler.readModuleFromImport(importFile);
        String moduleName = module.getName();
        replaceModuleFromDefault(moduleName, importFile);
    }
494321
@Override
        public void setDirectory(File dir) {
                if (dir == null) {
                        throw new BuildException("Cannot set null directory attribute.");
                }

                // no override
                if (this.directory == null) {
                        this.directory = new File(dir.getAbsolutePath());
                }
        }
625098
@Override
    public T addAsDirectory(final ArchivePath path) throws IllegalArgumentException {
        // Precondition check
        Validate.notNull(path, "path must be specified");

        // Adjust the path to remove any trailing slash
        ArchivePath adjustedPath = new BasicPath(PathUtil.optionallyRemoveFollowingSlash(path.get()));
        return addAsset(adjustedPath, null);
    }
894989
public static RealtimeTuningConfig makeDefaultTuningConfig(final @Nullable File basePersistDirectory)
  {
    return new RealtimeTuningConfig(
        defaultMaxRowsInMemory,
        0L,
        defaultIntermediatePersistPeriod,
        defaultWindowPeriod,
        basePersistDirectory == null ? createNewBasePersistDirectory() : basePersistDirectory,
        defaultVersioningPolicy,
        defaultRejectionPolicyFactory,
        defaultMaxPendingPersists,
        defaultShardSpec,
        defaultIndexSpec,
        true,
        0,
        0,
        defaultReportParseExceptions,
        defaultHandoffConditionTimeout,
        defaultAlertTimeout,
        null,
        defaultDedupColumn
    );
  }
126842
protected void uploadFile() {

        hideOkAndUploadButtons();
        CmsUploader uploader = new CmsUploader();
        CmsFileInfo info = m_fileInput.getFiles()[0];
        info.setOverrideFileName(
            CmsStringUtil.joinPaths(m_handler.getTargetFolderPath(), m_handler.getFileName(info.getFileName())));
        uploader.uploadFiles(
            CmsCoreProvider.get().link(I_CmsUploadConstants.UPLOAD_ACTION_JSP_URI),
            CmsResource.getFolderPath(m_handler.getTargetFolderPath()),
            true,
            Collections.singletonList(info),
            Collections.<String> emptyList(),
            this);
        showProgress();
    }
1232242
private void addFileToList(final CmsFileInfo file, boolean invalid, boolean existingDeleted, boolean isTooLarge) {

        CmsListInfoBean infoBean = createInfoBean(file);
        CmsListItemWidget listItemWidget = new CmsListItemWidget(infoBean);
        listItemWidget.setIcon(CmsCoreProvider.get().getResourceTypeIcon(file));
        CmsCheckBox check = new CmsCheckBox();
        check.setChecked(false);
        if (!invalid && !isTooLarge && !existingDeleted) {
            if (file.getFileSize() == 0) {
                check.setChecked(false);
            }
            check.setChecked(m_filesToUpload.containsKey(file.getFileName()));
            check.setTitle(file.getFileName());
            if (!m_selectionDone && file.getFileName().toLowerCase().endsWith(".zip")) {
                final Widget unzip = createUnzipCheckBox(file);
                addClickHandlerToCheckBox(check, unzip, file);
                listItemWidget.addButton(unzip);
            } else {
                addClickHandlerToCheckBox(check, null, file);
            }
        } else if (existingDeleted) {
            // is invalid
            String message = Messages.get().key(Messages.GUI_UPLOAD_FILE_EXISTING_DELETED_1, file.getFileName());
            check.disable(message);
            listItemWidget.setBackground(Background.RED);
            listItemWidget.setSubtitleLabel(message);
        } else if (isTooLarge) {
            String message = getFileSizeTooLargeMessage(file);
            check.disable(message);
            listItemWidget.setBackground(Background.RED);
            listItemWidget.setSubtitleLabel(message);
        } else {
            // is invalid
            String message = Messages.get().key(
                Messages.GUI_UPLOAD_FILE_INVALID_NAME_2,
                file.getFileName(),
                CmsUploadButton.formatBytes(file.getFileSize()));
            check.disable(message);
            listItemWidget.setBackground(Background.RED);
            listItemWidget.setSubtitleLabel(message);
        }

        CmsListItem listItem = new CmsListItem(check, listItemWidget);
        m_fileList.addItem(listItem);
        m_listItems.put(file.getFileName(), listItem);
        doResize();
    }
1084930
public void addFile(String path, File file) throws IOException {
    addFile(path, file, null);
  }
1104419
private void addCurrentDirFiles(List<File> theFiles, List<File> theDirs, File currentDir) {
    File dirs[] = currentDir.listFiles(new FileFilter() {

      @Override
      public boolean accept(File file) {
        return file.isDirectory() && !file.getName().startsWith(".") && !file.getName().equals("META-INF");
      }
      
    });
    
    File htmlFiles[] = currentDir.listFiles(new FileFilter() {

      @Override
      public boolean accept(File file) {
        return !file.isDirectory() && file.isFile() && file.canRead() && !file.getName().startsWith(".") && (file.getName().endsWith(".html") || file.getName().endsWith(".htm"));
      }
      
    });
    
    if(dirs != null && dirs.length > 0) {
      theDirs.addAll(Arrays.asList(dirs));
    }
    if(htmlFiles != null && htmlFiles.length > 0) {
      theFiles.addAll(Arrays.asList(htmlFiles));
    }
  }
1005873
private boolean isDefaultFile(CmsResource resource) throws CmsException {

        CmsObject cms = getCmsObject();
        if (resource.isFolder()) {
            return false;
        }

        CmsResource parent = cms.readResource(
            CmsResource.getParentFolder(cms.getSitePath(resource)),
            CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
        CmsResource defaultFile = cms.readDefaultFile(parent, CmsResourceFilter.ONLY_VISIBLE_NO_DELETED);
        return resource.equals(defaultFile);
    }
141377
public File getFile(String property, File defaultValue) {
    return getProperty(property, defaultValue, File::new);
  }
623714
private FileFilter createConfigFilesFilter() {
        SiteConfig config = site.getConfig();
        boolean useDefaultConfigFiles = config.useDefaultConfigFiles();
        if (useDefaultConfigFiles) {
            log.debug("Using default config files.");
            return SiteConfigImpl.DEFAULT_CONFIG_FILES_FILTER;
        } else {//custom config files
            final File[] configFiles = config.getConfigFiles();
            return new FileFilter() {
                @Override
                public boolean accept(File file) {
                    for (File configFile : configFiles) {
                        if (configFile.equals(file)) {
                            return true;
                        }
                    }
                    return false;
                }
            };
        }
    }
152255
public void addDirectory(File dir) {
    File[] ndirs = new File[directories.length + 1];
    System.arraycopy(directories, 0, ndirs, 0, directories.length);
    ndirs[ndirs.length - 1] = dir;
    directories = ndirs;
  }
1275585
protected void setDefaultCategory(String defaultCategory)
    {
        // If setDefaultCategory() method is invoked before macro initialization, this will make sure the macro will
        // have correct default category after initialization.
        this.defaultCategory = defaultCategory;

        // In case if setDefaultCategory() is invoked after macro initialization. Only works if the internal
        // MacroDescriptor is of type AbstractMacroDescriptor.
        if (getDescriptor() instanceof AbstractMacroDescriptor) {
            ((AbstractMacroDescriptor) getDescriptor()).setDefaultCategory(defaultCategory);
        }
    }