Search in sources :

Example 1 with FileResource

use of org.bndtools.templating.FileResource in project bndtools by bndtools.

the class GitCloneTemplate method recurse.

private static void recurse(String prefix, File file, FileFilter filter, ResourceMap resourceMap) {
    if (file.isDirectory()) {
        String path = prefix + file.getName() + "/";
        resourceMap.put(path, new FolderResource());
        File[] children = file.listFiles(filter);
        for (File child : children) {
            recurse(path, child, filter, resourceMap);
        }
    } else {
        String path = prefix + file.getName();
        // TODO: WTF is the encoding?
        resourceMap.put(path, new FileResource(file, "UTF-8"));
    }
}
Also used : FileResource(org.bndtools.templating.FileResource) FolderResource(org.bndtools.templating.FolderResource) File(java.io.File)

Aggregations

File (java.io.File)1 FileResource (org.bndtools.templating.FileResource)1 FolderResource (org.bndtools.templating.FolderResource)1