Exemplo n.º 1
0
  public void installApplication(JOSSOArtifact artifact, boolean replace) throws InstallException {

    try {

      if (!artifact.getType().equals("war")) {
        log.debug("Application type : " + artifact.getType() + " not supported.");
        return;
      }

      // If the war is already expanded, copy it with a new name.
      FileObject srcFile = getFileSystemManager().resolveFile(artifact.getLocation());

      // Is this the josso gateaway ?
      String name = artifact.getBaseName();
      boolean isFolder = srcFile.getType().equals(FileType.FOLDER);

      if (name.startsWith("josso-gateway-web")) {
        // INSTALL GWY
        // Do we have to explode the war ?
        if (getTargetPlatform().isJOSSOWarExploded() && !isFolder) {
          installJar(srcFile, this.targetDeployDir, "josso", true, replace);
        } else {
          installFile(srcFile, this.targetDeployDir, "josso.war", replace);
        }
        return;
      }

      if (artifact.getBaseName().startsWith("josso-partner-tomcat-web")) {
        installJar(srcFile, this.targetDeployDir, "partnerapp", true, replace);
        return;
      }

    } catch (IOException e) {
      throw new InstallException(e.getMessage(), e);
    }
  }