Package org.apache.openejb.loader

Examples of org.apache.openejb.loader.FileUtils


        return service;
    }

    private void overrideProperties(final String serviceName, final Properties serviceProperties) throws IOException {
        final SystemInstance systemInstance = SystemInstance.get();
        final FileUtils base = systemInstance.getBase();

        // Override with file from conf dir
        final File conf = base.getDirectory("conf");
        if (conf.exists()) {

            final String legacy = System.getProperty("openejb.conf.schema.legacy");
            boolean legacySchema = Boolean.parseBoolean((null != legacy ? legacy : "false"));
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 = system.getConf(null);

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

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

    private List<File> list() {
        final List<File> files = new ArrayList<File>();

        { // list all the files associated with hot deploy locations

            final FileUtils base = SystemInstance.get().getBase();
            for (final Deployments deployment : deployments) {
                DeploymentsResolver.loadFrom(deployment, base, files);
            }
        }
        return files;
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

        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 Collection<URI> classpath = new LinkedList<>();

        for (final String string : strings) {
            final Set<String> locations = ProvisioningUtil.realLocation(PropertyPlaceHolderHelper.simpleValue(string));
            for (final String location : locations) {
                final File file = base.getFile(location, false);
                classpath.add(file.toURI());
            }
        }

        return classpath.toArray(new URI[classpath.size()]);
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

        return service;
    }

    private void overrideProperties(final String serviceName, final Properties serviceProperties) throws IOException {
        final SystemInstance systemInstance = SystemInstance.get();
        final FileUtils base = systemInstance.getBase();

        // Override with file from conf dir
        final File conf = base.getDirectory("conf");
        if (conf.exists()) {

            final String legacy = System.getProperty("openejb.conf.schema.legacy");
            boolean legacySchema = Boolean.parseBoolean((null != legacy ? legacy : "false"));
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.