@Test public void testExtractYear() { assertEquals("2000", WARCIndexer.extractYear(TIMESTAMP_16)); }
public static String extractYear( String timestamp ) { String waybackYear = "unknown"; String waybackDate = timestamp.replaceAll( "[^0-9]", "" ); if( waybackDate != null ) waybackYear = waybackDate.substring( 0, 4 ); if( "0000".equals( waybackYear ) ) waybackYear = "unknown"; return waybackYear; }
WARCIndexer { public static String extractYear( String timestamp ) { String waybackYear = "unknown"; String waybackDate = timestamp.replaceAll( "[^0-9]", "" ); if( waybackDate != null ) waybackYear = waybackDate.substring( 0, 4 ); if( "0000".equals( waybackYear ) ) waybackYear = "unknown"; return waybackYear; } }
WARCIndexer { public static String extractYear( String timestamp ) { String waybackYear = "unknown"; String waybackDate = timestamp.replaceAll( "[^0-9]", "" ); if( waybackDate != null ) waybackYear = waybackDate.substring( 0, 4 ); if( "0000".equals( waybackYear ) ) waybackYear = "unknown"; return waybackYear; } WARCIndexer();  WARCIndexer( Config conf ); }
WARCIndexer { public static String extractYear( String timestamp ) { String waybackYear = "unknown"; String waybackDate = timestamp.replaceAll( "[^0-9]", "" ); if( waybackDate != null ) waybackYear = waybackDate.substring( 0, 4 ); if( "0000".equals( waybackYear ) ) waybackYear = "unknown"; return waybackYear; } WARCIndexer();  WARCIndexer( Config conf ); void setAnnotations(Annotations ann, SurtPrefixSet openAccessSurts); boolean isCheckSolrForDuplicates(); void setCheckSolrForDuplicates(boolean checkSolrForDuplicates); SolrRecord extract( String archiveName, ArchiveRecord record ); SolrRecord extract( String archiveName, ArchiveRecord record, boolean isTextIncluded ); static Date getWaybackDate( String timestamp ); static String extractYear( String timestamp ); }
WARCIndexer { public static String extractYear( String timestamp ) { String waybackYear = "unknown"; String waybackDate = timestamp.replaceAll( "[^0-9]", "" ); if( waybackDate != null ) waybackYear = waybackDate.substring( 0, 4 ); if( "0000".equals( waybackYear ) ) waybackYear = "unknown"; return waybackYear; } WARCIndexer();  WARCIndexer( Config conf ); void setAnnotations(Annotations ann, SurtPrefixSet openAccessSurts); boolean isCheckSolrForDuplicates(); void setCheckSolrForDuplicates(boolean checkSolrForDuplicates); SolrRecord extract( String archiveName, ArchiveRecord record ); SolrRecord extract( String archiveName, ArchiveRecord record, boolean isTextIncluded ); static Date getWaybackDate( String timestamp ); static String extractYear( String timestamp ); static final boolean CANONICALISE_HOST; static SimpleDateFormat formatter; }