Package org.richfaces.resource.optimizer.vfs

Examples of org.richfaces.resource.optimizer.vfs.VirtualFile


                            new VersionKey(matcher.group(1), matcher.group(2)));
                }
            }
        }

        VirtualFile result;

        if (latestVersionKey != null) {
            result = file.getChild(latestVersionKey.toString());
        } else {
            result = file;
        }

        if (result != null && (library ^ result.isFile())) {
            return result;
        }

        return null;
    }
View Full Code Here


    private static Collection<VirtualFile> getExistingChildren(Iterable<VFSRoot> files, String path) throws URISyntaxException,
            IOException {
        Collection<VirtualFile> result = Lists.newArrayList();

        for (VirtualFile file : files) {
            VirtualFile child = file.getChild(path, true);
            if (child != null) {
                result.add(child);
            }
        }
View Full Code Here

    }

    private Collection<VirtualFile> findLibraries(String libraryName) {
        List<VirtualFile> libraryDirs = Lists.newLinkedList();
        for (VirtualFile file : roots) {
            VirtualFile child = file.getChild(libraryName);
            if (child == null) {
                continue;
            }

            VirtualFile libraryDir = ResourceUtil.getLatestVersion(child, true);
            if (libraryDir != null) {
                libraryDirs.add(libraryDir);
            }
        }
View Full Code Here

        return libraryDirs;
    }

    private VirtualFile findResource(Collection<VirtualFile> libraryDirs, String resourceName) {
        for (VirtualFile libraryDir : libraryDirs) {
            VirtualFile child = libraryDir.getChild(resourceName);
            if (child != null) {
                VirtualFile resource = ResourceUtil.getLatestVersion(child, false);
                if (resource != null) {
                    return resource;
                }
            }
        }
View Full Code Here

            libraryDirs = findLibraries(libraryName);
        } else {
            libraryDirs = roots;
        }

        VirtualFile resource = findResource(libraryDirs, resourceName);
        if (resource != null) {
            Resource result = new VFSResource(resource, resource.getRelativePath());

            result.setResourceName(resourceName);
            result.setLibraryName(libraryName);

            if (Strings.isNullOrEmpty(contentType)) {
View Full Code Here

        for (VirtualFile child : children) {
            if (child.isFile()) {
                resources.add(ResourceKey.create(child.getName()));
            } else {
                String libraryName = child.getName();
                VirtualFile libraryDir = ResourceUtil.getLatestVersion(child, true);
                if (libraryDir != null) {
                    scanLibrary(libraryName, "", libraryDir);
                }
            }
        }
View Full Code Here

        for (VirtualFile child : children) {
          String resourceName = resourceNamePrefix + child.getName();
            if (child.isFile()) {
                resources.add(new ResourceKey(resourceName, libraryName));
            } else if (child.isDirectory()) {
                VirtualFile resource = ResourceUtil.getLatestVersion(child, false);
                if (resource != null) {
                    resources.add(new ResourceKey(resourceName, libraryName));
                } else {
                  scanLibrary(libraryName, resourceName + "/", child);
                }
View Full Code Here

TOP

Related Classes of org.richfaces.resource.optimizer.vfs.VirtualFile

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.