Java File List Load getFileList(Map>> map, File dir, T key)

Here you can find the source of getFileList(Map>> map, File dir, T key)

Description

get File List

License

Open Source License

Declaration

private static <T> List<String> getFileList(Map<File, Map<T, List<String>>> map, File dir, T key) 

Method Source Code

//package com.java2s;
/**//from  www.j ava  2s.  c  om
 * Copyright (c) 2013 Puppet Labs, Inc. and other contributors, as listed below.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 * 
 * Contributors:
 *   Puppet Labs
 */

import java.io.File;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Main {
    private static <T> List<String> getFileList(Map<File, Map<T, List<String>>> map, File dir, T key) {
        Map<T, List<String>> dirMap = map.get(dir);
        if (dirMap == null)
            map.put(dir, dirMap = new HashMap<T, List<String>>());
        List<String> files = dirMap.get(key);
        if (files == null)
            dirMap.put(key, files = new ArrayList<String>());

        return files;
    }
}

Related

  1. getFileList(File sourceDirectory, final String extension)
  2. getFileList(File[] fileArray)
  3. getFileList(final File dir, final String extension, final List list, final int maxDepth)
  4. getFileList(final List fileList, final File root, final File[] ignoreList)
  5. getFileList(final String location)
  6. getFileList(String dir)
  7. getFileList(String dir)
  8. getFileList(String dir, final String extension)
  9. getFileList(String dir, final String suffix)