public ArtifactInfo identify( Query query ) throws IOException { return identify( query, indexingContexts.values() ); }
public void scan( IndexingContext context, final ArtifactScanningListener listener ) throws IOException { scan( context, listener, false ); }
/** * @deprecated use {@link #searchFlat(FlatSearchRequest)} instead */ @Deprecated public Collection<ArtifactInfo> searchFlat( Query query, IndexingContext context ) throws IOException { return searchFlat( ArtifactInfo.VERSION_COMPARATOR, query, context ); }
public ArtifactInfo identify( File artifact ) throws IOException { FileInputStream is = null; try { MessageDigest sha1 = MessageDigest.getInstance( "SHA-1" ); is = new FileInputStream( artifact ); byte[] buff = new byte[4096]; int n; while ( ( n = is.read( buff ) ) > -1 ) { sha1.update( buff, 0, n ); } byte[] digest = sha1.digest(); // String sha1 = new Sha1Digester().calc( artifact ); return identify( MAVEN.SHA1, encode( digest ) ); } catch ( NoSuchAlgorithmException ex ) { throw new IOException( "Unable to calculate digest" ); } finally { IOUtil.close( is ); } }
context.replace( tmpContext.getIndexDirectory() ); removeIndexingContext( tmpContext, true ); getLogger().warn( "Error scanning context: " + context.getId(), ex ); throw new IOException( "Error scanning context " + context.getId() + ": " + ex.getMessage() );
/** * @deprecated use {@link #searchGrouped(GroupedSearchRequest) */ @Deprecated public Map<String, ArtifactInfoGroup> searchGrouped( Grouping grouping, Query query, IndexingContext context ) throws IOException { return searchGrouped( grouping, String.CASE_INSENSITIVE_ORDER, query, context ); }
/** * @deprecated use {@link #searchGrouped(GroupedSearchRequest) */ @Deprecated public Map<String, ArtifactInfoGroup> searchGrouped( Grouping grouping, Query query ) throws IOException { return searchGrouped( grouping, String.CASE_INSENSITIVE_ORDER, query ); }
public void scan( IndexingContext context ) throws IOException { scan( context, null ); }
@Deprecated public ArtifactInfo identify( String field, String query ) throws IOException { return identify( new TermQuery( new Term( field, query ) ) ); }
/** * @deprecated use {@link #searchFlat(FlatSearchRequest)} instead */ @Deprecated public Collection<ArtifactInfo> searchFlat( Query query ) throws IOException { return searchFlat( ArtifactInfo.VERSION_COMPARATOR, query ); }
public void scan( IndexingContext context, boolean update ) throws IOException { scan( context, null, update ); }
public ArtifactInfo identify( Field field, String query ) throws IOException { return identify( queryCreator.constructQuery( field, query, SearchType.EXACT ) ); }