Construct a new read-only PropertyFile which merges the contents of a number of other PropertyFile objects<br />
Null PropertyFiles are ignored.

@param files

@return
325714
public static PropertyFile readOnlyUnion(final PropertyFile... files)
	{
		final PropertyFile props = new PropertyFile();

		for (PropertyFile file : files)
		{
			if (file != null)
				props.merge(file);
		}

		props.makeReadOnly();

		return props;
	}
333883
@GwtIncompatible("Unnecessary")
  private List<SourceFile> createExternInputs(List<String> files) throws IOException {
    List<FlagEntry<JsSourceType>> externFiles = new ArrayList<>();
    for (String file : files) {
      externFiles.add(new FlagEntry<JsSourceType>(JsSourceType.EXTERN, file));
    }
    try {
      return createInputs(externFiles, false, new ArrayList<JsModuleSpec>());
    } catch (FlagUsageException e) {
      throw new FlagUsageException("Bad --externs flag. " + e.getMessage());
    }
  }
45260
private void mergeFiles(@NonNull File mergedFile) throws IOException {

        Context context = appContextRef.get();

        if (context != null) {

            FileWriter fw;
            BufferedWriter bw;
            fw = new FileWriter(mergedFile, true);
            bw = new BufferedWriter(fw);

            File dir = context.getFilesDir();
            for (int i = 1; i <= maxFiles; i++) {

                File file = new File(dir, name(i));
                if (file.exists()) {

                    FileInputStream fis;
                    try {

                        fis = new FileInputStream(file);
                        BufferedReader br = new BufferedReader(new InputStreamReader(fis));
                        //noinspection TryFinallyCanBeTryWithResources
                        try {
                            String aLine;
                            while ((aLine = br.readLine()) != null) {
                                bw.write(aLine);
                                bw.newLine();
                            }
                        } finally {
                            br.close();
                        }
                    } catch (IOException e) {
                        e.printStackTrace();
                    }
                }
            }

            bw.close();
        }
    }
153850
public void setPropertyFile(String... thePropertyFile) {
		Validate.notNull(thePropertyFile, "Property file can not be null");
		myPropertyFile = Arrays.asList(thePropertyFile);
	}
1069356
public void addAll(ClassLoaderFiles files) {
		Assert.notNull(files, "Files must not be null");
		for (SourceFolder folder : files.getSourceFolders()) {
			for (Map.Entry<String, ClassLoaderFile> entry : folder.getFilesEntrySet()) {
				addFile(folder.getName(), entry.getKey(), entry.getValue());
			}
		}
	}
973772
private void openUploadWithFiles(JavaScriptObject files) {

        JsArray<CmsFileInfo> cmsFiles = files.cast();
        List<CmsFileInfo> fileObjects = new ArrayList<CmsFileInfo>();
        for (int i = 0; i < cmsFiles.length(); ++i) {
            fileObjects.add(cmsFiles.get(i));
        }
        CmsDialogUploadButtonHandler buttonHandler = new CmsDialogUploadButtonHandler(
            new Supplier<I_CmsUploadContext>() {

                /**
                 * @see com.google.common.base.Supplier#get()
                 */
                public I_CmsUploadContext get() {

                    return new I_CmsUploadContext() {

                        public void onUploadFinished(List<String> uploadedFiles) {

                            uploadFinished(uploadedFiles);
                        }

                    };
                }
            });
        buttonHandler.setIsTargetRootPath(true);
        buttonHandler.setTargetFolder(getState().getTargetFolderRootPath());
        buttonHandler.openDialogWithFiles(fileObjects);
    }
711333
public Properties loadPropertyFile(File file, String encoding) {
		prop = new Prop(file, encoding);
		return prop.getProperties();
	}
1175217
@Pure
	public static File join(File fileBase, String... elements) {
		if (fileBase == null) {
			return null;
		}
		final StringBuilder buf = new StringBuilder(fileBase.getPath());
		boolean empty;
		for (final String elt : elements) {
			empty = elt == null || elt.length() == 0;
			if (!empty) {
				assert elt != null;
				if (!elt.startsWith(File.separator)
						&& buf.length() >= 0
						&& buf.charAt(buf.length() - 1) != File.separatorChar) {
					buf.append(File.separatorChar);
				}
				buf.append(elt);
			}
		}
		return new File(buf.toString());
	}
363342
public static long merge(final Collection<File> sourceFiles, final File destFile) throws UncheckedIOException {
        final byte[] buf = Objectory.createByteArrayBuffer();

        long totalCount = 0;
        OutputStream output = null;

        try {
            output = new FileOutputStream(destFile);

            InputStream input = null;
            for (File file : sourceFiles) {
                try {
                    input = new FileInputStream(file);

                    int count = 0;
                    while (EOF != (count = read(input, buf, 0, buf.length))) {
                        output.write(buf, 0, count);

                        totalCount += count;
                    }
                } finally {
                    close(input);
                }
            }

            output.flush();
        } catch (IOException e) {
            throw new UncheckedIOException(e);
        } finally {
            Objectory.recycle(buf);

            close(output);
        }

        return totalCount;
    }
151389
public T addPyFile(String file) {
    checkNotNull(file, "file");
    builder.pyFiles.add(file);
    return self();
  }
22954
private File[] getFilesFromProperty(final String name, final Properties props) {
        String sep = WildFlySecurityManager.getPropertyPrivileged("path.separator", null);
        String value = props.getProperty(name, null);
        if (value != null) {
            final String[] paths = value.split(Pattern.quote(sep));
            final int len = paths.length;
            final File[] files = new File[len];
            for (int i = 0; i < len; i++) {
                files[i] = new File(paths[i]);
            }
            return files;
        }
        return NO_FILES;
    }
666156
public static File file(String... names) {
		if (ArrayUtil.isEmpty(names)) {
			return null;
		}

		File file = null;
		for (String name : names) {
			if (file == null) {
				file = file(name);
			} else {
				file = file(file, name);
			}
		}
		return file;
	}
934056
public FileRepositoryCollection createFileRepositoryCollection(File file) {
    Class<? extends FileRepositoryCollection> clazz;

    String extension =
        FileExtensionUtils.findExtensionFromPossibilities(
            file.getName(), fileRepositoryCollections.keySet());

    clazz = fileRepositoryCollections.get(extension);

    if (clazz == null) {
      throw new MolgenisDataException("Unknown extension for file '" + file.getName() + "'");
    }

    Constructor<? extends FileRepositoryCollection> ctor;
    try {
      ctor = clazz.getConstructor(File.class);
    } catch (Exception e) {
      throw new MolgenisDataException(
          "Exception creating ["
              + clazz
              + "]  missing constructor FileRepositorySource(File file)");
    }

    FileRepositoryCollection fileRepositoryCollection = BeanUtils.instantiateClass(ctor, file);
    autowireCapableBeanFactory.autowireBeanProperties(
        fileRepositoryCollection, AutowireCapableBeanFactory.AUTOWIRE_BY_TYPE, false);
    try {
      fileRepositoryCollection.init();
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
    return fileRepositoryCollection;
  }
441570
public static PropertyFile readOnly(final File filename) throws IOException
	{
		final PropertyFile props = new PropertyFile(filename);

		props.readOnly = true;

		return props;
	}
624976
public static PropertyFile readOnlyUnion(final File... filenames) throws IOException
	{
		final PropertyFile props = new PropertyFile();

		for (final File f : filenames)
		{
			if (f != null && f.exists())
			{
				props.merge(new PropertyFile(f));
			}
		}

		props.readOnly = true;

		return props;
	}
1180378
public static FileBatch forFiles(List<File> files) throws IOException {
        List<String> origPaths = new ArrayList<>(files.size());
        List<byte[]> bytes = new ArrayList<>(files.size());
        for (File f : files) {
            bytes.add(FileUtils.readFileToByteArray(f));
            origPaths.add(f.toURI().toString());
        }
        return new FileBatch(bytes, origPaths);
    }
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);
	    	}
	    }
	}