Categorize file.

@param file file system path with optional format
965771
private void categorizeReferenceFile(final Reference file) {
        // avoid files referred by coderef being added into wait list
        if (listFilter.getCoderefTargets().contains(file.filename)) {
            return;
        }
        if (isFormatDita(file.format) && listFilter.isDitaTopic() &&
                !job.crawlTopics() &&
                !listFilter.getConrefTargets().contains(file.filename)) {
            return;  // Do not process topics linked from within topics
        } else if ((isFormatDita(file.format) || ATTR_FORMAT_VALUE_DITAMAP.equals(file.format))) {
            addToWaitList(file);
        } else if (ATTR_FORMAT_VALUE_IMAGE.equals(file.format)) {
            formatSet.add(file);
            if (!exists(file.filename)) {
                logger.warn(MessageUtils.getMessage("DOTX008E", file.filename.toString()).toString());
            }
        } else if (ATTR_FORMAT_VALUE_DITAVAL.equals(file.format)) {
            formatSet.add(file);
        } else {
            htmlSet.put(file.format, file.filename);
        }
    }
851261
private static void checkFile(File file) {
		if (false == file.exists()) {
			throw new UtilException("File [{}] not exist !", file.getAbsolutePath());
		}
		if (false == file.isFile()) {
			throw new UtilException("Path [{}] is not a file !", file.getAbsolutePath());
		}
	}
856528
private boolean fileContains(File file, IGroupMember member) throws GroupsException {
        Collection ids = null;
        try {
            ids = member.isGroup() ? getGroupIdsFromFile(file) : getEntityIdsFromFile(file);
        } catch (Exception ex) {
            throw new GroupsException("Error retrieving ids from file", ex);
        }
        return ids.contains(member.getKey());
    }
1166670
public void addFile(ISO9660File file) {
        file.setParentDirectory(this);
        files.add(file);
        sorted = false;
    }
564806
public void loadTagMappingFile(String file) {
        if (file != null) {
            File f = new File(file);
            if (!f.exists()) {
                throw new IllegalArgumentException("tag mapping file parameter points to a file that does not exist");
            }
            if (f.isDirectory()) {
                throw new IllegalArgumentException("tag mapping file parameter points to a directory, must be a file");
            } else if (!f.canRead()) {
                throw new IllegalArgumentException(
                        "tag mapping file parameter points to a file we have no read permissions");
            }

            try {
                this.tagMapping = OSMTagMapping.getInstance(f.toURI().toURL());
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }
        } else {
            this.tagMapping = OSMTagMapping.getInstance();
        }
        this.tagMapping.setTagValues(this.tagValues);
    }
1257368
public T addPropertiesFile(final String file) {
        if (file != null) {
            addPropertiesFile(Paths.get(file));
        }
        return getThis();
    }
1206379
public static void addToClasspath(final File file, final ClassLoader classLoader) {
        checkNotNull("file", file);
        try {
            addToClasspath(file.toURI().toURL(), classLoader);
        } catch (final MalformedURLException e) {
            throw new RuntimeException(e);
        }
    }
845459
public void doOpenFile(File[] files)
	{
	    if (files!=null)
	    {
	    	if (files.length==1)
	    	{
	    		File f = files[0];
		    	if (f.isFile())
		    	{
			    	String modFileName = f.getAbsolutePath();
			    	int i = modFileName.lastIndexOf(File.separatorChar);
			    	searchPath = modFileName.substring(0, i);
		    		loadMultimediaOrPlayListFile(Helpers.createURLfromFile(f)); 
		    	}
		    	else
		    	if (f.isDirectory())
		    	{
			    	searchPath = f.getAbsolutePath();
		    	}
	    	}
	    	else
	    	{
	    		playlistRecieved(null, PlayList.createNewListWithFiles(files, false, false), null);
	    	}
	    }
	}
108124
public static void mkParentDirs(final File file) throws IOException {
        // Create parent directory structure if necessary
        File parentFile = file.getParentFile();
        if (parentFile == null) {
            // File was created with a relative path
            parentFile = file.getAbsoluteFile().getParentFile();
        }
        if (parentFile != null && !parentFile.exists()) {
            if (!parentFile.mkdirs()) {
                throw new IOException("Unable to create parent directory " +
                        "structure for file " + file.getAbsolutePath());
            }
        }
    }
560753
public void addOutputFile(String file) {
        if (file != null) {
            File f = new File(file);
            if (f.isDirectory()) {
                throw new IllegalArgumentException("output file parameter points to a directory, must be a file");
            } else if (f.exists() && !f.canWrite()) {
                throw new IllegalArgumentException(
                        "output file parameter points to a file we have no write permissions");
            }

            setOutputFile(f);
        }
    }
689219
public static Layout forFile(File file) {
        if (file == null) {
            throw new IllegalArgumentException("File must not be null");
        }
        if (file.getName().toLowerCase().endsWith(".jar")) {
            return new Jar();
        }
        if (file.getName().toLowerCase().endsWith(".war")) {
            return new War();
        }
        if (file.isDirectory() || file.getName().toLowerCase().endsWith(".zip")) {
            return new Expanded();
        }
        throw new IllegalStateException("Unable to deduce layout for '" + file + "'");
    }
1139433
void setFileTag(File file) throws IOException {
        if (initialized && fileEncodingCcsid != 0) {
            int returnCode = setFileTag(file.getAbsolutePath(), fileEncodingCcsid);
            if (returnCode != 0) {
                issueTaggingFailedMessage(returnCode);
            }
        }
    }
636183
private void deleteRecursive(final File file) {
        if (file.isDirectory()) {
            final String[] files = file.list();
            if (files != null) {
                for (String name : files) {
                    deleteRecursive(new File(file, name));
                }
            }
        }

        if (!file.delete()) {
            ControllerLogger.ROOT_LOGGER.cannotDeleteFileOrDirectory(file);
        }
    }
174884
private void delete(File file) {

		// Assertions.
		if (file == null) {
			String msg = "Argument 'file' cannot be null.";
			throw new IllegalArgumentException(msg);
		}

		if (file.isDirectory()) {
			for (File f : file.listFiles()) {
				delete(f);
			}
		}

		file.delete();

	}
777241
public void moveThisFile(File file)
    {
        String strDestName = file.getName();
        boolean bMoveFile = true;
        String extension = this.getProperty(EXTENSION);
        String filter = this.getProperty(FILTER);
    	if (extension != null)
    	{
    		bMoveFile = false;
            int iJava = strDestName.lastIndexOf(extension);
            if (iJava != -1) if (iJava == strDestName.length() - extension.length())
            	bMoveFile = true;
    	}
    	if (filter != null)
    	{
            bMoveFile = strDestName.matches(filter);
    	}
    	if ((bMoveFile) && (this.getScanListener() != null))
    		bMoveFile = this.getScanListener().filterFile(file);
        if (bMoveFile)
        {
            String strParentSource = file.getParent();
            this.moveThisFile(file, strDestName, strParentSource);
        }
    }
1370655
@Override
    public T fromFile(final String file) throws IllegalArgumentException, DescriptorImportException {
        return this.from(new File(file));
    }
779666
public void setFile(File file) throws FileNotFoundException{
		this.setInputStream(new BufferedInputStream(new FileInputStream(file)), file.length());
		this.isUploadFile = true;
	}