/** * Return the CrawlableDataset path/location that corresponds to the * given dataset path. The given dataset path must start with the * datasetScan path for this InvDatasetScan, if not, a null is returned. * * @param dsPath a datasetScan dsPath that * @return the CrawlableDataset path that corresponds to the given dataset path or null. */ public String translatePathToLocation( String dsPath ) { if ( dsPath == null ) return null; if ( dsPath.length() > 0 ) if ( dsPath.startsWith( "/" ) ) dsPath = dsPath.substring( 1 ); if ( ! dsPath.startsWith( this.getPath())) return null; // remove the matching part, the rest is the "data directory" String dataDir = dsPath.substring( this.getPath().length() ); if ( dataDir.startsWith( "/" ) ) dataDir = dataDir.substring( 1 ); CrawlableDataset curCrDs = scanLocationCrDs.getDescendant( dataDir); if ( log.isDebugEnabled() ) log.debug( "translatePathToLocation(): url dsPath= " + dsPath + " to dataset dsPath= " + curCrDs.getPath() ); return curCrDs.getPath(); }
/** * Return the CrawlableDataset path/location that corresponds to the * given dataset path. The given dataset path must start with the * datasetScan path for this InvDatasetScan, if not, a null is returned. * * @param dsPath a datasetScan dsPath that * @return the CrawlableDataset path that corresponds to the given dataset path or null. */ public String translatePathToLocation( String dsPath ) { if ( dsPath == null ) return null; if ( dsPath.length() > 0 ) if ( dsPath.startsWith( "/" ) ) dsPath = dsPath.substring( 1 ); if ( ! dsPath.startsWith( this.getPath())) return null; // remove the matching part, the rest is the "data directory" String dataDir = dsPath.substring( this.getPath().length() ); if ( dataDir.startsWith( "/" ) ) dataDir = dataDir.substring( 1 ); CrawlableDataset curCrDs = scanLocationCrDs.getDescendant( dataDir); if ( log.isDebugEnabled() ) log.debug( "translatePathToLocation(): url dsPath= " + dsPath + " to dataset dsPath= " + curCrDs.getPath() ); return curCrDs.getPath(); }
/** * Return the CrawlableDataset path/location that corresponds to the * given dataset path. The given dataset path must start with the * datasetScan path for this InvDatasetScan, if not, a null is returned. * * @param dsPath a datasetScan dsPath that * @return the CrawlableDataset path that corresponds to the given dataset path or null. */ public String translatePathToLocation( String dsPath ) { if ( dsPath == null ) return null; if ( dsPath.length() > 0 ) if ( dsPath.startsWith( "/" ) ) dsPath = dsPath.substring( 1 ); if ( ! dsPath.startsWith( this.getPath())) return null; // remove the matching part, the rest is the "data directory" String dataDir = dsPath.substring( this.getPath().length() ); if ( dataDir.startsWith( "/" ) ) dataDir = dataDir.substring( 1 ); CrawlableDataset curCrDs = scanLocationCrDs.getDescendant( dataDir); if ( log.isDebugEnabled() ) log.debug( "translatePathToLocation(): url dsPath= " + dsPath + " to dataset dsPath= " + curCrDs.getPath() ); return curCrDs.getPath(); }
boolean check(StringBuilder out, boolean show) { boolean isValid = true; if (getPath() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have path attribute\n" ); isValid = false; } if ( getScanLocation() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have dirLocation attribute\n" ); isValid = false; } if (getServiceDefault() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have a default service\n" ); isValid = false; } if (datasets.size() > 0) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): may not have nested datasets\n" ); isValid = false; this.datasets = null; } return isValid && super.check(out, show); } }
boolean check(StringBuilder out, boolean show) { boolean isValid = true; if (getPath() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have path attribute\n" ); isValid = false; } if ( getScanLocation() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have dirLocation attribute\n" ); isValid = false; } if (getServiceDefault() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have a default service\n" ); isValid = false; } if (datasets.size() > 0) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): may not have nested datasets\n" ); isValid = false; this.datasets = null; } return isValid && super.check(out, show); } }
boolean check(StringBuilder out, boolean show) { boolean isValid = true; if (getPath() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have path attribute\n" ); isValid = false; } if ( getScanLocation() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have dirLocation attribute\n" ); isValid = false; } if (getServiceDefault() == null) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): must have a default service\n" ); isValid = false; } if (hasNestedDatasets()) { out.append( "**Error: DatasetScan (" ).append( getFullName() ).append( "): may not have nested datasets\n" ); isValid = false; this.datasets = null; } return isValid && super.check(out, show); } }
public DatasetScanCatalogBuilder( InvDatasetScan datasetScan, CrawlableDataset collectionCrDs, InvService service ) { // Setup for ID String baseID = null; if ( datasetScan.getID() != null ) baseID = datasetScan.getID(); else if ( datasetScan.getPath() != null ) baseID = datasetScan.getPath(); stdCatBuilder = new StandardCatalogBuilder( datasetScan.getPath(), datasetScan.getName(), collectionCrDs, datasetScan.getFilter(), service, baseID, datasetScan.getIdentifier(), datasetScan.getNamer(), datasetScan.getAddDatasetSize(), datasetScan.getSorter(), datasetScan.getProxyDatasetHandlers(), datasetScan.getChildEnhancerList(), datasetScan, datasetScan.getCatalogRefExpander() ); }
public DatasetScanCatalogBuilder( InvDatasetScan datasetScan, CrawlableDataset collectionCrDs, InvService service ) { // Setup for ID String baseID = null; if ( datasetScan.getID() != null ) baseID = datasetScan.getID(); else if ( datasetScan.getPath() != null ) baseID = datasetScan.getPath(); stdCatBuilder = new StandardCatalogBuilder( datasetScan.getPath(), datasetScan.getName(), collectionCrDs, datasetScan.getFilter(), service, baseID, datasetScan.getIdentifier(), datasetScan.getNamer(), datasetScan.getAddDatasetSize(), datasetScan.getSorter(), datasetScan.getProxyDatasetHandlers(), datasetScan.getChildEnhancerList(), datasetScan, datasetScan.getCatalogRefExpander() ); }
public DatasetScanCatalogBuilder( InvDatasetScan datasetScan, CrawlableDataset collectionCrDs, InvService service ) { // Setup for ID String baseID = null; if ( datasetScan.getID() != null ) baseID = datasetScan.getID(); else if ( datasetScan.getPath() != null ) baseID = datasetScan.getPath(); stdCatBuilder = new StandardCatalogBuilder( datasetScan.getPath(), datasetScan.getName(), collectionCrDs, datasetScan.getFilter(), service, baseID, datasetScan.getIdentifier(), datasetScan.getNamer(), datasetScan.getAddDatasetSize(), datasetScan.getSorter(), datasetScan.getProxyDatasetHandlers(), datasetScan.getChildEnhancerList(), datasetScan, datasetScan.getCatalogRefExpander() ); }