@Override public void destroy() { workspace.destroy(); }
public static void main( String[] args ) { Workspace ws = new DefaultWorkspace(new File("/home/stranger/.deegree/deegree-workspace-utah-3.2-pre9-20120717.234406-9")); ws.initAll(); ws.destroy(); }
public static void main( String[] args ) { if ( args.length == 0 ) { System.out.println( "You must specify the workspace location." ); return; } File wsloc = new File( args[0] ); if ( !wsloc.isDirectory() ) { System.out.println( "Workspace location does not exist or is not a directory." ); return; } Workspace ws = null; try { ws = new DefaultWorkspace( wsloc ); ws.initAll(); new FeatureLayerExtractor( ws ).extract(); new ThemeExtractor( ws ).transform(); } catch ( Throwable e ) { System.out.println( "There was a problem transforming the configuration." ); e.printStackTrace(); } finally { if ( ws != null ) { ws.destroy(); } } }
workspace.destroy(); } catch ( ParseException exp ) { System.err.println( Messages.getMessage( "TOOL_COMMANDLINE_ERROR", exp.getMessage() ) );
/** * Simple importer for SE files, with hardcoded 'configtool' on localhost. * * @param args * @throws XMLStreamException * @throws FactoryConfigurationError * @throws IOException */ public static void main( String[] args ) throws XMLStreamException, FactoryConfigurationError, IOException { Style style = new SymbologyParser( true ).parse( XMLInputFactory.newInstance().createXMLStreamReader( new FileInputStream( args[0] ) ) ); Workspace workspace = new DefaultWorkspace( new File( "nonexistant" ) ); ResourceLocation<ConnectionProvider> loc = ConnectionProviderUtils.getSyntheticProvider( "configtool", "jdbc:postgresql://localhost/configtool", "postgres", "postgres" ); workspace.getLocationHandler().addExtraResource( loc ); workspace.initAll(); if ( style.isSimple() ) { new PostgreSQLWriter( "configtool", "schematest", workspace ).write( style, null ); } else { new PostgreSQLWriter( "configtool", "schematest", workspace ).write( new FileInputStream( args[0] ), style.getName() ); } workspace.destroy(); }
style.getName() ); workspace.destroy(); } catch ( ParseException exp ) { System.err.println( Messages.getMessage( "TOOL_COMMANDLINE_ERROR", exp.getMessage() ) );
/** * Destroys and initializes all resources connected to the resource with the given id. * * @param workspace * may not be <code>null</code> * @param id * may not be <code>null</code> */ public static void reinitializeChain( Workspace workspace, ResourceIdentifier<? extends Resource> id ) { ResourceNode<? extends Resource> node = workspace.getDependencyGraph().getNode( id ); List<ResourceMetadata<? extends Resource>> list = new ArrayList<ResourceMetadata<? extends Resource>>(); ResourceMetadata<? extends Resource> meta = workspace.getResourceMetadata( id.getProvider(), id.getId() ); if ( meta == null ) { return; } list.add( meta ); collectDependencies( list, node ); collectDependents( list, node ); ResourceGraph g = new ResourceGraph( list ); list = g.toSortedList(); workspace.destroy( list.get( 0 ).getIdentifier() ); for ( ResourceMetadata<? extends Resource> md : list ) { workspace.add( md.getLocation() ); workspace.init( md.getIdentifier(), null ); } }