Package org.apache.openejb.loader

Examples of org.apache.openejb.loader.FileUtils


            deployment.setClasspath(Thread.currentThread().getContextClassLoader());
            deployments.add(deployment);
        }
        // resolve jar locations //////////////////////////////////////  BEGIN  ///////

        FileUtils base = SystemInstance.get().getBase();

        List<String> jarList = new ArrayList<String>(deployments.size());
        try {
            for (Deployments deployment : deployments) {
                if (deployment.getClasspath() != null) {
View Full Code Here


            configureEmbedded();
        }
    }

    private void preprocessProperties(Properties properties) {
        FileUtils base = SystemInstance.get().getBase();
        File confDir = new File(base.getDirectory(), "conf");
        File baseDir = base.getDirectory();
        File userDir = new File("foo").getParentFile();

        File[] paths = {confDir, baseDir, userDir};

        List<File> missing = new ArrayList<File>();
View Full Code Here

    public static File install(URL resource, String name, boolean overwrite) throws IOException {
        if (resource == null) return null;

        SystemInstance system = SystemInstance.get();
        FileUtils base = system.getBase();
        File conf = base.getDirectory("conf");

        if (!conf.exists()) return null;

        File file = new File(conf, name);
View Full Code Here

        return null;
    }

    private static File createCacheDir() {
        try {
            final FileUtils openejbBase = SystemInstance.get().getBase();

            File dir = null;
            // if we are not embedded, cache (temp) dir is under base dir
            if (SystemInstance.get().getConf(null).exists()) {
                try {
                    dir = openejbBase.getDirectory("temp");
                } catch (final IOException e) {
                    //Ignore
                }
            }
View Full Code Here

        final String key = "tomee.unpack.dir";

        File unpackDir = file.getParentFile();

        if (properties.containsKey(key)) {
            final FileUtils base = SystemInstance.get().getBase();
            unpackDir = base.getDirectory(properties.getProperty(key), true);
        }

        File docBase = new File(unpackDir, pathname);

        docBase = extract(file, docBase);
View Full Code Here

            logger.info("No additional deployments found: " + e);
        }

        // resolve jar locations //////////////////////////////////////  BEGIN  ///////

        final FileUtils base = SystemInstance.get().getBase();

        final List<Deployments> autoDeploy = new ArrayList<Deployments>();

        final List<File> declaredAppsUrls = new ArrayList<File>();

        for (final Deployments deployment : deployments) {
            try {
                DeploymentsResolver.loadFrom(deployment, base, declaredAppsUrls);
                if (deployment.isAutoDeploy()) {
                    autoDeploy.add(deployment);
                }
            } catch (final SecurityException se) {
                logger.warning("Security check failed on deployment: " + deployment.getFile(), se);
            }
        }
        for (final Deployments additionalDep : additionalDeploymentsList) {
            if (additionalDep.getFile() != null) {
                declaredAppsUrls.add(Files.path(base.getDirectory().getAbsoluteFile(), additionalDep.getFile()));
            } else if (additionalDep.getDir() != null) {
                declaredAppsUrls.add(Files.path(base.getDirectory().getAbsoluteFile(), additionalDep.getDir()));
            }
            if (additionalDep.isAutoDeploy()) {
                autoDeploy.add(additionalDep);
            }
        }
View Full Code Here

        return declaredAppsUrls;
    }

    public ArrayList<File> getModulesFromClassPath(final List<File> declaredApps, final ClassLoader classLoader) {
        final FileUtils base = SystemInstance.get().getBase();

        final List<URL> classpathAppsUrls = new ArrayList<URL>();
        DeploymentsResolver.loadFromClasspath(base, classpathAppsUrls, classLoader);

        final ArrayList<File> jarFiles = new ArrayList<File>();
View Full Code Here

     * @return URI array
     * @throws IOException if path cannot be resolved or file referenced does not exist
     */
    public static URI[] resolveClasspath(final String rawstring) throws IOException {

        final FileUtils base = SystemInstance.get().getBase();
        final String[] strings = rawstring.split(File.pathSeparator);
        final URI[] classpath = new URI[strings.length];

        for (int i = 0; i < strings.length; i++) {
            final String string = strings[i];
            final String pathname = PropertyPlaceHolderHelper.simpleValue(ProvisioningUtil.realLocation(string));
            final File file = base.getFile(pathname, false);
            classpath[i] = file.toURI();
        }

        return classpath;
    }
View Full Code Here

            addBeansXmls(appModule);

            // Persistence Units
            final Properties p = new Properties();
            p.put(appModule.getModuleId(), appModule.getJarLocation());
            final FileUtils base = new FileUtils(appModule.getModuleId(), appModule.getModuleId(), p);
            final List<URL> filteredUrls = new ArrayList<URL>();
            DeploymentsResolver.loadFromClasspath(base, filteredUrls, appModule.getClassLoader());
            addPersistenceUnits(appModule, filteredUrls.toArray(new URL[filteredUrls.size()]));

            final Object pXmls = appModule.getAltDDs().get("persistence.xml");
View Full Code Here

            }
        }
    }

    private void preprocessProperties(final Properties properties) {
        final FileUtils base = SystemInstance.get().getBase();
        final File confDir = SystemInstance.get().getConf(null);
        final File baseDir = base.getDirectory();
        final File userDir = new File("foo").getParentFile();

        final File[] paths = {confDir, baseDir, userDir};

        final List<File> missing = new ArrayList<File>();
View Full Code Here

TOP

Related Classes of org.apache.openejb.loader.FileUtils

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.