Package com.granule

Examples of com.granule.ExternalFragment


        for (int i = 0; i < list.size(); i++) {
            FragmentDescriptor fd = list.get(i);
            if (fd instanceof AbsolutePathFragment) {
                String filename = ((AbsolutePathFragment) fd).getFilePath();
                filename = PathUtils.getRelpath(filename, root);
                ExternalFragment newFragment = new ExternalFragment(filename);
                list.remove(i);
                list.add(i, newFragment);
            }
        }
    }
View Full Code Here


                        boolean cyclicLink = false;
                        String cssPath = PathUtils.clean(((newPath.length() > 0 && newPath.charAt(0) != '/') ? "/" :
                                "") + newPath + replaceInfo.text);
                        for (FragmentDescriptor dep : deps)
                            if (dep instanceof ExternalFragment) {
                                ExternalFragment ef = (ExternalFragment) dep;
                                if (ef.getFilePath() != null && ef.getFilePath().equals(cssPath)) {
                                    cyclicLink = true;
                                    break;
                                }
                            }
                        if (cyclicLink) {
                            logger.error("Found cyclic link!!!!");
                            start = replaceInfo.end;
                            continue;
                        }
                        boolean addFile = true;
                        if (settings.isIgnoreMissedFiles() && !(new File(request.getRealPath(cssPath))).exists()) {
                            logger.warn(MessageFormat.format("File {0} not found, ignored", cssPath));
                            addFile = false;
                        }
                        if (addFile) {
                            String filename;
                            if (replaceInfo.text.startsWith("/"))
                                filename = replaceInfo.text;
                            else filename = cssPath;
                            FragmentDescriptor imp = new ExternalFragment(filename);
                            deps.add(imp);
                            sb.append(handle(imp, request, settings, deps));
                        }
                    }
                    start = replaceInfo.end;
View Full Code Here

                + "                    goog.dom.setTextContent(document.getElementById('label_dp'), event.date ?\n"
                + "                            event.date.toIsoString(true) : 'none');\n" + "                });\n"
                + "\n" + "        goog.dom.setTextContent(document.getElementById('label_dp'),\n"
                + "                dp.getDate().toIsoString(true));";
        List<FragmentDescriptor> fragments = new ArrayList<FragmentDescriptor>();
        FragmentDescriptor fd = new ExternalFragment("js/closure/goog/base.js");
        fragments.add(fd);
        fd = new InternalFragment(testCode);
        fragments.add(fd);

        CalcDeps cd = new CalcDeps();
View Full Code Here

TOP

Related Classes of com.granule.ExternalFragment

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.