Resolves the copy generator.
@param file  the file
@param lineIndex  the line index
492672
public void resolveCopyGen(File file, int lineIndex) {
        if (getBean().isMutable() && getBean().isBuilderScopeVisible() == false) {
            return;  // no copying
        }
        if (config.getInvalidImmutableTypes().contains(getFieldTypeRaw())) {
            throw new BeanCodeGenException("Invalid collection type for immutable bean: " + getFieldTypeRaw() +
                    " in " + getBean().getTypeRaw() + "." + getPropertyName(), file, lineIndex);
        }
        if (isDerived()) {
            copyGen = CopyGen.NoCopyGen.INSTANCE;
        } else {
            CopyGen copier = config.getCopyGenerators().get(getFieldTypeRaw());
            if (copier != null) {
                copyGen = copier;
            } else {
                String clone = config.getImmutableGetClones().get(getFieldTypeRaw());
                if (clone != null) {
                    if (clone.equals("clone")) {
                        copyGen = CopyGen.CLONE;
                    } else {
                        copyGen = CopyGen.CLONE_CAST;
                    }
                } else {
                    copyGen = CopyGen.ASSIGN;
                }
            }
        }
    }
1187279
@Override
	public void saveTo(final File file) {
		if(file.exists())
			throw new IllegalArgumentException("File '" + file.toString() + "' already exists.");

		try {
			saveTo(new FileOutputStream(file));
		} catch (FileNotFoundException e) {
			throw MechanizeExceptionFactory.newException(e);
		}
	}
393336
public Observable<File> copyLogs(@NonNull File file) {
        return state.get() > GlobalState.INITIALISING ? logMgr.copyLogs(file) : Observable.fromCallable(() -> null);
    }
1311956
public static void copyFile(@NotNull File from, @NotNull File to) throws IOException {
		Validate.notNull(from);
		Validate.notNull(to);
		copyFile(from.toPath(), to.toPath());
	}
81636
public void initializeFromFile(TreeIndexHeader header, PageFile<N> file) {
    this.dirCapacity = header.getDirCapacity();
    this.leafCapacity = header.getLeafCapacity();
    this.dirMinimum = header.getDirMinimum();
    this.leafMinimum = header.getLeafMinimum();

    if(getLogger().isDebugging()) {
      StringBuilder msg = new StringBuilder();
      msg.append(getClass());
      msg.append("\n file = ").append(file.getClass());
      getLogger().debugFine(msg.toString());
    }

    this.initialized = true;
  }
76454
public static void copy(InputStream is, File file) throws IOException {

		Asserts.notNullParameter("is", is);
		Asserts.notNullParameter("file", file);
		
		FileOutputStream os = null;
		os = new FileOutputStream(file);
		copy(is, os);
	}
555988
public static void deleteIfExists(final File file)
    {
        if (file.exists())
        {
            try
            {
                Files.delete(file.toPath());
            }
            catch (final IOException ex)
            {
                LangUtil.rethrowUnchecked(ex);
            }
        }
    }
1207627
private void removeFile(int index) {
        String file = files.remove(index);
        FileLogUtils.deleteFile(directory, file);
    }
7073
public void load(File file) {
    try {
      PropertiesConfiguration config = new PropertiesConfiguration();
      // disabled to prevent accumulo classpath value from being shortened
      config.setDelimiterParsingDisabled(true);
      config.load(file);
      ((CompositeConfiguration) internalConfig).addConfiguration(config);
    } catch (ConfigurationException e) {
      throw new IllegalArgumentException(e);
    }
  }
565894
public Map<String, Object> processFile(File file) {
        ParserEngine engine = Engines.get(FileUtil.fileExt(file));
        if (engine==null) {
            LOGGER.error("Unable to find suitable markup engine for {}",file);
            return null;
        }

        return engine.parse(config, file);
    }
175593
public static void readLines(File file, Charset charset, LineHandler lineHandler) throws IORuntimeException {
		FileReader.create(file, charset).readLines(lineHandler);
	}
829206
public static void deleteFile(File file)
    {
        Check.notNull(file);

        try
        {
            Files.delete(file.toPath());
        }
        catch (final IOException exception)
        {
            throw new LionEngineException(exception, ERROR_DELETE_FILE + file.getAbsolutePath());
        }
    }
1280295
public static void copyFile(File from, File to) throws IOException {
        InputStream in = new BufferedInputStream(new FileInputStream(from));
        try {
            OutputStream out = new BufferedOutputStream(new FileOutputStream(to));
            try {
                IoUtils.copyAllBytes(in, out);
            } finally {
                IoUtils.safeClose(out);
            }
        } finally {
            IoUtils.safeClose(in);
        }
    }
43265
public void setLocation(String filename, int line) throws IOException
  {
    if (_lineMap != null && filename != null && line >= 0) {
      _lineMap.add(filename, line, _destLine, _isPreferLast);
    }
  }
664690
public void setFile(File file) throws IOException {
        if(!file.isFile())
            throw new IllegalArgumentException(file+" must be a file.");
        else {
            if(file.getName().endsWith("gz"))
                initGzReader(file);
            else
                initReader(file);
        }
    }
656188
public static void copy(File from, File to) throws IOException {
        if (from.isDirectory())
            copyDir(from, to);
        else
            copyFile(from, to);
    }
569611
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 = f.toURI().toURL();
            } catch (MalformedURLException e) {
                throw new RuntimeException(e);
            }
        } else {
            this.tagMapping = PoiWriterTask.class.getClassLoader().getResource("poi-mapping.xml");
        }
    }