public AppInfo deploy()

in src/main/java/catalina/deployer/WebappDeployer.java [92:137]


    public AppInfo deploy(String location, Properties properties) throws OpenEJBException {
		try {
			if (location == null && properties == null) {
				throw new NullPointerException("location and properties are null");
			}
			if (location == null) {
				location = properties.getProperty(FILENAME);
			}

			final File source = new File(location);
			final File destination = new File(
                System.getProperty(OPENEJB_HOME) + File.separator + WEBAPPS + File.separator + source.getName());
            IO.copy(source, destination);

            String destinationWithoutExtension = destination.getAbsolutePath();
			String destinationFilenameWithoutExtension = destination.getName();

			if (destination.getName().contains(".")) {
				destinationWithoutExtension = destinationWithoutExtension.substring(0, destinationWithoutExtension.lastIndexOf('.'));
				destinationFilenameWithoutExtension = destinationFilenameWithoutExtension.substring(0, destinationFilenameWithoutExtension.lastIndexOf('.'));
			}

			if (destination.getName().toLowerCase().endsWith(".war")) {
				checkWebapp(destinationFilenameWithoutExtension);
			} else {
				check();
			}

			final AppInfo info = findAppInfo(destination.getAbsolutePath(), destinationWithoutExtension);
            if (info == null) {
                throw new NullPointerException("appinfo not found");
            }

            final DeploymentExceptionManager dem = SystemInstance.get().getComponent(DeploymentExceptionManager.class);
            if (dem.hasDeploymentFailed()) {
                final Exception tre = dem.getLastException();
                // we don't need this exception anymore
                dem.clearLastException(info);
                throw tre;
            }

            return info;
		} catch (Exception e) {
			throw new OpenEJBException(e);
		}
	}