/** * * @param t - Topology to use for config * @return - path of shiro.ini config file. */ protected String getConfig(Topology t){ File tmpDir = new File(System.getProperty("java.io.tmpdir")); DeploymentFactory.setGatewayServices(services); EnterpriseArchive archive = DeploymentFactory.createDeployment(getGatewayConfig(), t); File war = archive.as(ExplodedExporter.class).exportExploded(tmpDir, t.getName() + "_deploy.tmp"); war.deleteOnExit(); String config = war.getAbsolutePath() + "/%2F/WEB-INF/shiro.ini"; try{ FileUtils.forceDeleteOnExit(war); } catch (IOException e) { out.println(e.toString()); war.deleteOnExit(); } return config; }
/** * * @param t - Topology to use for config * @return - path of shiro.ini config file. */ protected String getConfig(Topology t){ File tmpDir = new File(System.getProperty("java.io.tmpdir")); DeploymentFactory.setGatewayServices(services); EnterpriseArchive archive = DeploymentFactory.createDeployment(getGatewayConfig(), t); File war = archive.as(ExplodedExporter.class).exportExploded(tmpDir, t.getName() + "_deploy.tmp"); war.deleteOnExit(); String config = war.getAbsolutePath() + "/%2F/WEB-INF/shiro.ini"; try{ FileUtils.forceDeleteOnExit(war); } catch (IOException e) { out.println(e.toString()); war.deleteOnExit(); } return config; }
File tmp = ear.as(ExplodedExporter.class).exportExploded(deployDir, topoDir.getName() + ".tmp"); if (!tmp.renameTo(topoDir)) { FileUtils.deleteQuietly(tmp);
throw new DeploymentException( "Failed to create topology deployment temporary directory: " + deployDir.getAbsolutePath() ); File tmp = ear.as( ExplodedExporter.class ).exportExploded( deployDir, topoDir.getName() + ".tmp" ); if( !tmp.renameTo( topoDir ) ) { FileUtils.deleteQuietly( tmp );
throw new DeploymentException( "Failed to create topology deployment temporary directory: " + deployDir.getAbsolutePath() ); File tmp = ear.as( ExplodedExporter.class ).exportExploded( deployDir, topoDir.getName() + ".tmp" ); if( !tmp.renameTo( topoDir ) ) { FileUtils.deleteQuietly( tmp );