private void register() { wsRootDirToWs.put( this.dir, this ); nameToWs.put( name, this ); this.workspace = new DefaultWorkspace( dir ); }
private GDALSettings getGdalConfigOptions( final Workspace ws ) { File configFile = new File( ( (DefaultWorkspace) ws ).getLocation(), configFileName ); if ( configFile.exists() ) { LOG.info( "Using '" + configFileName + "' from workspace for GDAL settings." ); try { return readGdalConfigOptions( configFile, ws ); } catch ( Exception e ) { LOG.error( "Error reading GDALSettings file: " + e.getMessage() ); } } return null; }
/** * Unloads all resources associated with this context, as well as ALL STATIC ones. */ public synchronized void destroyAll() { for ( ResourceManager m : managers ) { m.shutdown(); } managers.clear(); managerMap.clear(); workspace.destroy(); }
@Override public <T extends Resource> void destroy( ResourceIdentifier<T> id ) { ResourceNode<T> node = graph.getNode( id ); if ( node == null ) { return; } for ( ResourceNode<? extends Resource> n : node.getDependents() ) { destroy( n.getMetadata().getIdentifier() ); } T res = (T) resources.get( id ); if ( res != null ) { LOG.info( "Shutting down {}.", id ); res.destroy(); } states.setState( id, null ); removeMetadataFromResourceManager( id ); resources.remove( id ); errors.clear( id ); }
public ClassLoader getModuleClassLoader() { return workspace.getModuleClassLoader(); }
return getResource( id.getProvider(), id.getId() );
/** * Returns the {@link ModuleInfo} for all deegree modules in the workspace. * * @return * @throws IOException */ public Collection<ModuleInfo> getModulesInfo() throws IOException { if ( !( workspace.getModuleClassLoader() instanceof URLClassLoader ) ) { return null; } Set<URL> urls = new HashSet<URL>(); for ( URL url : ( (URLClassLoader) workspace.getModuleClassLoader() ).getURLs() ) { urls.add( url ); } return ModuleInfo.extractModulesInfo( urls ); }
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(); }
@Override public void init( Workspace workspace ) { this.workspace = workspace; initDefault(); init( new File( ( (DefaultWorkspace) workspace ).getLocation(), "crs" ) ); }
/** * Creates the commandline parser and adds the options. * * @param args */ public static void main( String[] args ) { CommandLineParser parser = new PosixParser(); Options options = initOptions(); boolean verbose = false; // for the moment, using the CLI API there is no way to respond to a help argument; see // https://issues.apache.org/jira/browse/CLI-179 if ( args.length == 0 || ( args.length > 0 && ( args[0].contains( "help" ) || args[0].contains( "?" ) ) ) ) { printHelp( options ); } workspace = new DefaultWorkspace( new File( "nix" ) ); try { CommandLine line = parser.parse( options, args ); verbose = line.hasOption( OPT_VERBOSE ); startManager( line ); } catch ( ParseException exp ) { System.err.println( "ERROR: Invalid command line: " + exp.getMessage() ); } catch ( Exception e ) { System.err.println( "ERROR: " + e.getMessage() ); if ( verbose ) { e.printStackTrace(); } System.exit( 1 ); } // System.exit( 0 ); }
public WSDL( String wsPath ) { DefaultWorkspace ws = (DefaultWorkspace) OGCFrontController.getServiceWorkspace().getNewWorkspace(); wsdlFile = new File( ws.getLocation(), wsPath ); }
workspace = new DefaultWorkspace( new File( "nix" ) );
@Override public void startup( Workspace workspace ) { try { if ( workspace instanceof DefaultWorkspace ) { File dir = new File( ( (DefaultWorkspace) workspace ).getLocation(), getMetadata().getWorkspacePath() ); bboxCache = new BBoxPropertiesCache( new File( dir, BBOX_CACHE_FILE ) ); } // else? } catch ( IOException e ) { LOG.error( "Unable to initialize global envelope cache: " + e.getMessage(), e ); } super.startup( workspace ); }
/** * Creates the commandline parser and adds the options. * * @param args */ public static void main( String[] args ) { CommandLineParser parser = new PosixParser(); Options options = initOptions(); boolean verbose = false; // for the moment, using the CLI API there is no way to respond to a help argument; see // https://issues.apache.org/jira/browse/CLI-179 if ( args.length == 0 || ( args.length > 0 && ( args[0].contains( "help" ) || args[0].contains( "?" ) ) ) ) { printHelp( options ); } workspace = new DefaultWorkspace( new File( "test" ) ); try { CommandLine line = parser.parse( options, args ); verbose = line.hasOption( OPT_VERBOSE ); startModelGeneralizor( line ); } catch ( ParseException exp ) { System.err.println( "ERROR: Invalid command line: " + exp.getMessage() ); } catch ( Exception e ) { System.err.println( "ERROR: " + e.getMessage() ); if ( verbose ) { e.printStackTrace(); } System.exit( 1 ); } // System.exit( 0 ); }
File proxyConfigFile = new File( ( (DefaultWorkspace) workspace ).getLocation(), "proxy.xml" ); if ( proxyConfigFile.exists() ) { LOG.info( "Using 'proxy.xml' from workspace." );
workspace = new DefaultWorkspace( fallbackDir ); } catch ( MalformedURLException e ) { String msg = "Secure Proxy was NOT started, since the configuration could not be loaded.";
INSTANCE = this; File securityFile = new File( ( (DefaultWorkspace) workspace ).getLocation(), "services" + separator + "security" + separator + "security.xml" ); File authorities = new File( ( (DefaultWorkspace) workspace ).getLocation(), "services" + separator + "security" + separator + "authorities" );
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(); } } }
@Override public void init( Workspace workspace ) { File wsDir = ( (DefaultWorkspace) workspace ).getLocation(); File metadata = new File( wsDir, "services" + File.separator + "metadata.xml" ); File main = new File( wsDir, "services" + File.separator + "main.xml" );
Workspace workspace = new DefaultWorkspace( dir ); String user = null; if ( properties != null ) {