Converts the given set of file names into a set of {@link File} instances. The file names may be relative to the
given base directory.
433081
protected File[] asFiles( File pDir, String[] pFileNames )
    {
        if ( pFileNames == null )
        {
            return new File[0];
        }

        File dir = asAbsoluteFile( pDir );
        File[] result = new File[pFileNames.length];
        for ( int i = 0; i < pFileNames.length; i++ )
        {
            result[i] = new File( dir, pFileNames[i] );
        }
        return result;
    }
790503
function relativePath(file, pattern) {
    var length = file.length,
        x;

    pattern = path.normalize(pattern);
    file = path.normalize(file);

    for (x = 0; x < length; x += 1) {
        if (file[x] !== pattern[x]) {
            return file.substr(x);
        }
    }

    return path.basename(file);
}
752196
public static void copyDir(File from, File to) throws FileNotFoundException, IOException {
        File[] files = from.listFiles();

        if (files != null) {
            for (File ff : files) {
                File tf = new File(to, ff.getName());
                if (ff.isDirectory()) {
                    if (tf.mkdir()) {
                        copyDir(ff, tf);
                    }
                } else if (ff.isFile()) {
                    copyFile(tf, ff);
                }
            }
        }
    }
200216
public static File toFile(final String filename) {
        if (filename == null) {
            return null;
        }
        String f;
        try {
            f = URLDecoder.decode(filename, UTF8);
        } catch (final UnsupportedEncodingException e) {
            throw new RuntimeException(e);
        }
        f = f.replace(WINDOWS_SEPARATOR, File.separator).replace(UNIX_SEPARATOR, File.separator);
        return new File(f);
    }
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);
    }
926431
private static ArrayList<URL> getUrls(File[] files) {
    final ArrayList<URL> urls = new ArrayList<>();
    for (File file : files) {
      try {
        final URL url = file.toURI().toURL();
        urls.add(url);
      } catch (final MalformedURLException e) {
        logger.error("File is not convertible to URL.", e);
      }
    }
    return urls;
  }
278919
public static Pair<Descriptor, String> fromFilename(Path directory, String name) {
        // tokenize the filename
        StringTokenizer st = new StringTokenizer(name, String.valueOf(separator));
        String nexttok;

        // all filenames must start with keyspace and column family
        String ksname = st.nextToken();
        String cfname = st.nextToken();

        // optional temporary marker
        nexttok = st.nextToken();
        boolean temporary = false;
        if (nexttok.equals(SSTable.TEMPFILE_MARKER)) {
            temporary = true;
            nexttok = st.nextToken();
        }

        // optional version string
        Version version = Version.LEGACY;
        if (Version.validate(nexttok)) {
            version = new Version(nexttok);
            nexttok = st.nextToken();
        }
        int generation = Integer.parseInt(nexttok);

        // component suffix
        String component = st.nextToken();
        directory = directory != null ? directory : new Path(".");
        return Pair.create(new Descriptor(version, directory, ksname, cfname, generation, temporary), component);
    }
1197718
public List<File> getFiles() {
        List<File> result = new LinkedList<File>();
        for (DataFile dataFile : dataFiles.values()) {
            result.add(dataFile.getFile());
        }
        return result;
    }
1211974
public static File [] listFiles(File file) {
		if (file==null){
			return EMPTY_FILE_LIST;
		} 
		
		File ret[]=file.listFiles(FILE_FILTER);
		
		if (ret==null){
			return EMPTY_FILE_LIST;
		} else {
			return ret;
		}		
	}
722373
def match_filenames(filenames, pattern):
    """"""
    matching = []

    for filename in filenames:
        if fnmatch(get_filebase(filename, pattern), globify(pattern)):
            matching.append(filename)

    return matching
1320957
public static String fileToString(String fileName, String charsetName) {
		return fileToString(new File(fileName), charsetName);
	}
378035
public static List<File> listFiles(File srcPath) throws IOException
   {
      List<File> result = new ArrayList<File>();

      if (!srcPath.isDirectory())
      {
         throw new IOException(srcPath.getAbsolutePath() + " is a directory");
      }

      for (File subFile : srcPath.listFiles())
      {
         result.add(subFile);
         if (subFile.isDirectory())
         {
            result.addAll(listFiles(subFile));
         }
      }

      return result;
   }
886158
public static File getBaseDir(final List<File> files) {
        String common = getCommonPrefix(files.stream().map(new Function<File, String>() {
            @Override
            public String apply(final File file) {
                return file.getAbsolutePath();
            }
        }).collect(Collectors.toList()));
        if (null != common) {
            return new File(common);
        }
        return null;
    }
418127
def get_basename_from_file(file)
      basename = Pathname.new(file).basename.to_s
      basename[0..(basename.rindex('.') - 1)]
    end
640324
public static void copyFiles(File[] files, File[] destinationFiles) throws IOException {
        int length = Integer.min(files.length, destinationFiles.length);
        for (int i = 0; i < length; i++) {
            copyFile(files[i], destinationFiles[i]);
        }
    }
1241274
function createBasenameList(files) {
    const basenames = {};
    files.forEach(function (file) {
        const basename = file.replace(/(-[0-9]+.[0-9]+.[A-Za-z0-9_-]+)?([.-]min)?(.amd|.commonjs|.mustache)?(\.[a-zA-Z]+$)/, '');
        basenames[basename] = true;
    });
    return Object.keys(basenames);
}
156396
private void copyBaseDirs(File[] baseDirs) {
        this.baseDirs = new File[baseDirs.length];
        for (int i = 0; i < baseDirs.length; i++) {
            this.baseDirs[i] = baseDirs[i].getAbsoluteFile();
        }
    }