public void generator(ProxyObject proxyObject) throws IOException, JAXBException {

    String apiDir = "/" + proxyObject.getApiBundleName() + "/" + "apiproxy";
    String apiProxyZip = proxyObject.getApiBundleLocation() + "/" + "apiproxy.zip";
    String proxyDir = apiDir + "/" + "proxies";
    String targetDir = apiDir + "/" + "targets";
    String policiesDir = apiDir + "/" + "policies";

    boolean success =
        (new File(proxyObject.getApiBundleLocation() + "/" + proxyObject.getApiBundleName()))
            .mkdir();
    (new File(proxyObject.getApiBundleLocation() + apiDir)).mkdir();
    (new File(proxyObject.getApiBundleLocation() + proxyDir)).mkdir();
    (new File(proxyObject.getApiBundleLocation() + targetDir)).mkdir();

    try {

      if (proxyObject.getSwaggerType().equalsIgnoreCase("n")) {
        GeneralProxyGenerator genProxy = new GeneralProxyGenerator(proxyObject);
        genProxy.createProxy();

      } else if (proxyObject.getSwaggerType().equalsIgnoreCase("y")) {
        ProxyGenerator proxy = new ProxyGenerator(proxyObject);
        proxy.createProxy();
      }

    } catch (IOException e) {
      e.printStackTrace();
    } catch (JAXBException e) {
      e.printStackTrace();
    }

    TargetGenerator target = new TargetGenerator(proxyObject);
    try {
      target.createTarget();
    } catch (IOException e) {
      e.printStackTrace();
    } catch (JAXBException e) {
      e.printStackTrace();
    }

    ApplicationGenerator application = new ApplicationGenerator(proxyObject);
    try {
      application.createProxy();
    } catch (IOException e) {
      e.printStackTrace();
    } catch (JAXBException e) {
      e.printStackTrace();
    }

    if (proxyObject.isApplyProlicies()) {
      (new File(proxyObject.getApiBundleLocation() + policiesDir)).mkdir();

      PolicyGenerator policies = new PolicyGenerator(proxyObject);
      try {
        policies.createPolicies();
      } catch (IOException e) {
        e.printStackTrace();
      } catch (JAXBException e) {
        e.printStackTrace();
      }
    }

    String proxyDefault = proxyObject.getApiBundleLocation() + proxyDir + "/default.xml";
    String targetDefault = proxyObject.getApiBundleLocation() + targetDir + "/default.xml";

    String appfile =
        proxyObject.getApiBundleLocation()
            + "/"
            + apiDir
            + "/"
            + proxyObject.getApiBundleName()
            + ".xml";

    // Create a apiproxy.zip
    ZipUtil.pack(
        new File(proxyObject.getApiBundleLocation() + "/" + proxyObject.getApiBundleName() + "/"),
        new File(
            proxyObject.getApiBundleLocation()
                + "/"
                + proxyObject.getApiBundleName()
                + "/"
                + "apiproxy.zip"));
  }