LOGGER.info( "Loaded feature type '" + ds.getName() +"'");
f = new File( ftd, "layer.xml" );
if ( f.exists() ) {
try {
LayerInfo l = depersist(xp, f, LayerInfo.class );
catalog.add( l );
LOGGER.info( "Loaded layer '" + l.getName() + "'" );
}
catch( Exception e ) {
LOGGER.log( Level.WARNING, "Failed to load layer for feature type '" + ft.getName() +"'", e);
}
}
}
else {
LOGGER.warning( "Ignoring feature type directory " + ftd.getAbsolutePath() );
}
}
}
else {
//look for a coverage store
f = new File( sd, "coveragestore.xml" );
if ( f.exists() ) {
CoverageStoreInfo cs = null;
try {
cs = depersist( xp, f, CoverageStoreInfo.class );
catalog.add( cs );
LOGGER.info( "Loaded coverage store '" + cs.getName() +"'");
}
catch( Exception e ) {
LOGGER.log( Level.WARNING, "Failed to load coverage store '" + sd.getName() +"'", e);
continue;
}
//load coverages
for ( File cd : list(sd,DirectoryFileFilter.INSTANCE) ) {
f = new File( cd, "coverage.xml" );
if( f.exists() ) {
CoverageInfo c = null;
try {
c = depersist(xp,f,CoverageInfo.class);
catalog.add( c );
LOGGER.info( "Loaded coverage '" + cs.getName() +"'");
}
catch( Exception e ) {
LOGGER.log( Level.WARNING, "Failed to load coverage '" + cd.getName() +"'", e);
continue;
}
f = new File( cd, "layer.xml" );
if ( f.exists() ) {
try {
LayerInfo l = depersist(xp, f, LayerInfo.class );
catalog.add( l );
LOGGER.info( "Loaded layer '" + l.getName() + "'" );
}
catch( Exception e ) {
LOGGER.log( Level.WARNING, "Failed to load layer coverage '" + c.getName() +"'", e);
}
}