idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
34,800 | public static SyncMapItemFetcher fetcher ( final String pathServiceSid , final String pathMapSid , final String pathKey ) { return new SyncMapItemFetcher ( pathServiceSid , pathMapSid , pathKey ) ; } | Create a SyncMapItemFetcher to execute fetch . |
34,801 | public static SyncMapItemDeleter deleter ( final String pathServiceSid , final String pathMapSid , final String pathKey ) { return new SyncMapItemDeleter ( pathServiceSid , pathMapSid , pathKey ) ; } | Create a SyncMapItemDeleter to execute delete . |
34,802 | public static SyncMapItemCreator creator ( final String pathServiceSid , final String pathMapSid , final String key , final Map < String , Object > data ) { return new SyncMapItemCreator ( pathServiceSid , pathMapSid , key , data ) ; } | Create a SyncMapItemCreator to execute create . |
34,803 | public static MediaDeleter deleter ( final String pathAccountSid , final String pathMessageSid , final String pathSid ) { return new MediaDeleter ( pathAccountSid , pathMessageSid , pathSid ) ; } | Create a MediaDeleter to execute delete . |
34,804 | public static MediaFetcher fetcher ( final String pathAccountSid , final String pathMessageSid , final String pathSid ) { return new MediaFetcher ( pathAccountSid , pathMessageSid , pathSid ) ; } | Create a MediaFetcher to execute fetch . |
34,805 | public static CredentialCreator creator ( final String pathAccountSid , final String pathCredentialListSid , final String username , final String password ) { return new CredentialCreator ( pathAccountSid , pathCredentialListSid , username , password ) ; } | Create a CredentialCreator to execute create . |
34,806 | public static CredentialFetcher fetcher ( final String pathAccountSid , final String pathCredentialListSid , final String pathSid ) { return new CredentialFetcher ( pathAccountSid , pathCredentialListSid , pathSid ) ; } | Create a CredentialFetcher to execute fetch . |
34,807 | public static CredentialUpdater updater ( final String pathAccountSid , final String pathCredentialListSid , final String pathSid ) { return new CredentialUpdater ( pathAccountSid , pathCredentialListSid , pathSid ) ; } | Create a CredentialUpdater to execute update . |
34,808 | public static CredentialDeleter deleter ( final String pathAccountSid , final String pathCredentialListSid , final String pathSid ) { return new CredentialDeleter ( pathAccountSid , pathCredentialListSid , pathSid ) ; } | Create a CredentialDeleter to execute delete . |
34,809 | public static ValidationToken fromHttpRequest ( String accountSid , String credentialSid , String signingKeySid , PrivateKey privateKey , HttpRequest request , List < String > signedHeaders ) throws IOException { Builder builder = new Builder ( accountSid , credentialSid , signingKeySid , privateKey ) ; String method =... | Create a ValidationToken from an HTTP Request . |
34,810 | public Response request ( final Request request ) { request . setAuth ( username , password ) ; return httpClient . reliableRequest ( request ) ; } | Make a request to Twilio . |
34,811 | public static CredentialListMappingCreator creator ( final String pathAccountSid , final String pathDomainSid , final String credentialListSid ) { return new CredentialListMappingCreator ( pathAccountSid , pathDomainSid , credentialListSid ) ; } | Create a CredentialListMappingCreator to execute create . |
34,812 | public static CredentialListMappingFetcher fetcher ( final String pathAccountSid , final String pathDomainSid , final String pathSid ) { return new CredentialListMappingFetcher ( pathAccountSid , pathDomainSid , pathSid ) ; } | Create a CredentialListMappingFetcher to execute fetch . |
34,813 | public static CredentialListMappingDeleter deleter ( final String pathAccountSid , final String pathDomainSid , final String pathSid ) { return new CredentialListMappingDeleter ( pathAccountSid , pathDomainSid , pathSid ) ; } | Create a CredentialListMappingDeleter to execute delete . |
34,814 | public static WebhookFetcher fetcher ( final String pathServiceSid , final String pathChannelSid , final String pathSid ) { return new WebhookFetcher ( pathServiceSid , pathChannelSid , pathSid ) ; } | Create a WebhookFetcher to execute fetch . |
34,815 | public static WebhookUpdater updater ( final String pathServiceSid , final String pathChannelSid , final String pathSid ) { return new WebhookUpdater ( pathServiceSid , pathChannelSid , pathSid ) ; } | Create a WebhookUpdater to execute update . |
34,816 | public static WebhookDeleter deleter ( final String pathServiceSid , final String pathChannelSid , final String pathSid ) { return new WebhookDeleter ( pathServiceSid , pathChannelSid , pathSid ) ; } | Create a WebhookDeleter to execute delete . |
34,817 | public VoiceGrant setOutgoingApplication ( String outgoingApplicationSid , Map < String , Object > outgoingApplicationParams ) { this . outgoingApplicationSid = outgoingApplicationSid ; this . outgoingApplicationParams = outgoingApplicationParams ; return this ; } | Set the outgoing application . |
34,818 | @ SuppressWarnings ( "checkstyle:linelength" ) public Message update ( final TwilioRestClient client ) { Request request = new Request ( HttpMethod . POST , Domains . IPMESSAGING . toString ( ) , "/v1/Services/" + this . pathServiceSid + "/Channels/" + this . pathChannelSid + "/Messages/" + this . pathSid + "" , client... | Make the request to the Twilio API to perform the update . |
34,819 | public static void main ( final String [ ] args ) throws TwiMLException , URISyntaxException { Say say = new Say . Builder ( "Hello World!" ) . voice ( Say . Voice . MAN ) . loop ( 5 ) . build ( ) ; VoiceResponse response = new VoiceResponse . Builder ( ) . say ( say ) . build ( ) ; System . out . println ( response . ... | TwiML example usage . |
34,820 | public static NotificationFetcher fetcher ( final String pathAccountSid , final String pathCallSid , final String pathSid ) { return new NotificationFetcher ( pathAccountSid , pathCallSid , pathSid ) ; } | Create a NotificationFetcher to execute fetch . |
34,821 | public static NotificationDeleter deleter ( final String pathAccountSid , final String pathCallSid , final String pathSid ) { return new NotificationDeleter ( pathAccountSid , pathCallSid , pathSid ) ; } | Create a NotificationDeleter to execute delete . |
34,822 | public static FieldValueFetcher fetcher ( final String pathAssistantSid , final String pathFieldTypeSid , final String pathSid ) { return new FieldValueFetcher ( pathAssistantSid , pathFieldTypeSid , pathSid ) ; } | Create a FieldValueFetcher to execute fetch . |
34,823 | public static FieldValueCreator creator ( final String pathAssistantSid , final String pathFieldTypeSid , final String language , final String value ) { return new FieldValueCreator ( pathAssistantSid , pathFieldTypeSid , language , value ) ; } | Create a FieldValueCreator to execute create . |
34,824 | public static FieldValueDeleter deleter ( final String pathAssistantSid , final String pathFieldTypeSid , final String pathSid ) { return new FieldValueDeleter ( pathAssistantSid , pathFieldTypeSid , pathSid ) ; } | Create a FieldValueDeleter to execute delete . |
34,825 | public static InstalledAddOnExtensionUpdater updater ( final String pathInstalledAddOnSid , final String pathSid , final Boolean enabled ) { return new InstalledAddOnExtensionUpdater ( pathInstalledAddOnSid , pathSid , enabled ) ; } | Create a InstalledAddOnExtensionUpdater to execute update . |
34,826 | public static AssetUpdater updater ( final String pathServiceSid , final String pathSid , final String friendlyName ) { return new AssetUpdater ( pathServiceSid , pathSid , friendlyName ) ; } | Create a AssetUpdater to execute update . |
34,827 | public static IpAddressCreator creator ( final String pathAccountSid , final String pathIpAccessControlListSid , final String friendlyName , final String ipAddress ) { return new IpAddressCreator ( pathAccountSid , pathIpAccessControlListSid , friendlyName , ipAddress ) ; } | Create a IpAddressCreator to execute create . |
34,828 | public static IpAddressFetcher fetcher ( final String pathAccountSid , final String pathIpAccessControlListSid , final String pathSid ) { return new IpAddressFetcher ( pathAccountSid , pathIpAccessControlListSid , pathSid ) ; } | Create a IpAddressFetcher to execute fetch . |
34,829 | public static IpAddressUpdater updater ( final String pathAccountSid , final String pathIpAccessControlListSid , final String pathSid ) { return new IpAddressUpdater ( pathAccountSid , pathIpAccessControlListSid , pathSid ) ; } | Create a IpAddressUpdater to execute update . |
34,830 | public static IpAddressDeleter deleter ( final String pathAccountSid , final String pathIpAccessControlListSid , final String pathSid ) { return new IpAddressDeleter ( pathAccountSid , pathIpAccessControlListSid , pathSid ) ; } | Create a IpAddressDeleter to execute delete . |
34,831 | public static TaskChannelCreator creator ( final String pathWorkspaceSid , final String friendlyName , final String uniqueName ) { return new TaskChannelCreator ( pathWorkspaceSid , friendlyName , uniqueName ) ; } | Create a TaskChannelCreator to execute create . |
34,832 | public static StepContextFetcher fetcher ( final String pathFlowSid , final String pathEngagementSid , final String pathStepSid ) { return new StepContextFetcher ( pathFlowSid , pathEngagementSid , pathStepSid ) ; } | Create a StepContextFetcher to execute fetch . |
34,833 | public static AssetVersionFetcher fetcher ( final String pathServiceSid , final String pathAssetSid , final String pathSid ) { return new AssetVersionFetcher ( pathServiceSid , pathAssetSid , pathSid ) ; } | Create a AssetVersionFetcher to execute fetch . |
34,834 | public static AssetVersionCreator creator ( final String pathServiceSid , final String pathAssetSid , final String path , final AssetVersion . Visibility visibility ) { return new AssetVersionCreator ( pathServiceSid , pathAssetSid , path , visibility ) ; } | Create a AssetVersionCreator to execute create . |
34,835 | public static DeploymentFetcher fetcher ( final String pathServiceSid , final String pathEnvironmentSid , final String pathSid ) { return new DeploymentFetcher ( pathServiceSid , pathEnvironmentSid , pathSid ) ; } | Create a DeploymentFetcher to execute fetch . |
34,836 | public static DeploymentCreator creator ( final String pathServiceSid , final String pathEnvironmentSid , final String buildSid ) { return new DeploymentCreator ( pathServiceSid , pathEnvironmentSid , buildSid ) ; } | Create a DeploymentCreator to execute create . |
34,837 | public void setConfig ( LogFileConfiguration config ) { this . config = config == null ? null : config . readOnlyCopy ( ) ; if ( config == null ) { Log . w ( DOMAIN , "Database.log.getFile().getConfig() is now null, meaning file logging is disabled. " + "Log files required for product support are not being generated."... | Sets the configuration currently to use on the file logger . Note that once it is set it can no longer be modified and doing so will throw an exception |
34,838 | public static String getSysInfo ( ) { String info = sysInfo . get ( ) ; if ( info == null ) { final String version = Build . VERSION . RELEASE ; final String model = Build . MODEL ; info = String . format ( Locale . ENGLISH , SYS_INFO , ( version . length ( ) <= 0 ) ? "0.0" : version , ( model . length ( ) <= 0 ) ? "un... | This is information about the Android on which we are running . |
34,839 | public static PrecisionContextRoundedOperator of ( MathContext mathContext ) { Objects . requireNonNull ( mathContext ) ; if ( RoundingMode . UNNECESSARY . equals ( mathContext . getRoundingMode ( ) ) ) { throw new IllegalArgumentException ( "To create the MathContextRoundedOperator you cannot use the RoundingMode.UNNE... | Creates the rounded Operator from mathContext |
34,840 | protected void checkNumber ( Number number ) { Objects . requireNonNull ( number , "Number is required." ) ; if ( number . longValue ( ) > MAX_BD . longValue ( ) ) { throw new ArithmeticException ( "Value exceeds maximal value: " + MAX_BD ) ; } BigDecimal bd = MoneyUtils . getBigDecimal ( number ) ; if ( bd . precision... | Internal method to check for correct number parameter . |
34,841 | void addRate ( CurrencyUnit term , LocalDate localDate , Number rate ) { RateType rateType = RateType . HISTORIC ; ExchangeRateBuilder builder ; if ( Objects . nonNull ( localDate ) ) { if ( localDate . equals ( LocalDate . now ( ) ) ) { rateType = RateType . DEFERRED ; } builder = new ExchangeRateBuilder ( ConversionC... | Method to add a currency exchange rate . |
34,842 | public Set < String > getProviderNames ( ) { Set < String > result = new HashSet < > ( ) ; for ( CurrencyProviderSpi spi : Bootstrap . getServices ( CurrencyProviderSpi . class ) ) { try { result . add ( spi . getProviderName ( ) ) ; } catch ( Exception e ) { Logger . getLogger ( DefaultMonetaryCurrenciesSingletonSpi .... | Get the names of the currently loaded providers . |
34,843 | public ExchangeRate getExchangeRate ( MonetaryAmount amount ) { return this . rateProvider . getExchangeRate ( ConversionQueryBuilder . of ( conversionQuery ) . setBaseCurrency ( amount . getCurrency ( ) ) . build ( ) ) ; } | Get the exchange rate type that this provider instance is providing data for . |
34,844 | public static Money parse ( CharSequence text , MonetaryAmountFormat formatter ) { return from ( formatter . parse ( text ) ) ; } | Obtains an instance of Money from a text using specific formatter . |
34,845 | public static boolean isInfinityAndNotNaN ( Number number ) { if ( Double . class == number . getClass ( ) || Float . class == number . getClass ( ) ) { double dValue = number . doubleValue ( ) ; if ( ! Double . isNaN ( dValue ) && Double . isInfinite ( dValue ) ) { return true ; } } return false ; } | Just to don t break the compatibility . Don t use it |
34,846 | public boolean load ( ) { if ( ( lastLoaded + cacheTTLMillis ) <= System . currentTimeMillis ( ) ) { clearCache ( ) ; } if ( ! readCache ( ) ) { if ( shouldReadDataFromFallback ( ) ) { return loadFallback ( ) ; } } return true ; } | Loads the resource first from the remote resources if that fails from the fallback location . |
34,847 | public boolean loadRemote ( ) { for ( URI itemToLoad : remoteResources ) { try { return load ( itemToLoad , false ) ; } catch ( Exception e ) { LOG . log ( Level . INFO , "Failed to load resource: " + itemToLoad , e ) ; } } return false ; } | Try to load the resource from the remote locations . |
34,848 | public boolean loadFallback ( ) { try { if ( fallbackLocation == null ) { Logger . getLogger ( getClass ( ) . getName ( ) ) . warning ( "No fallback resource for " + this + ", loadFallback not supported." ) ; return false ; } load ( fallbackLocation , true ) ; clearCache ( ) ; return true ; } catch ( Exception e ) { LO... | Try to load the resource from the fallback resources . This will override any remote data already loaded and also will clear the cached data . |
34,849 | public boolean isAvailable ( ConversionQuery conversionQuery ) { return conversionQuery . getBaseCurrency ( ) . getCurrencyCode ( ) . equals ( conversionQuery . getCurrency ( ) . getCurrencyCode ( ) ) ; } | Check if this provider can provide a rate which is only the case if base and term are equal . |
34,850 | public static CurrencyUnitBuilder of ( String currencyCode , String providerName ) { return new CurrencyUnitBuilder ( currencyCode , CurrencyContextBuilder . of ( providerName ) . build ( ) ) ; } | Creates a new CurrencyUnitBuilder creates a simple CurrencyContext using the given provider name . |
34,851 | public CurrencyUnitBuilder setCurrencyCode ( String currencyCode ) { Objects . requireNonNull ( currencyCode , "currencyCode required" ) ; this . currencyCode = currencyCode ; this . currencyContext = CurrencyContextBuilder . of ( getClass ( ) . getSimpleName ( ) ) . build ( ) ; return this ; } | Allows to set the currency code for creating multiple instances using one Builder . |
34,852 | public static void checkAmountParameter ( MonetaryAmount amount , CurrencyUnit currencyUnit ) { requireNonNull ( amount , "Amount must not be null." ) ; final CurrencyUnit amountCurrency = amount . getCurrency ( ) ; if ( ! currencyUnit . getCurrencyCode ( ) . equals ( amountCurrency . getCurrencyCode ( ) ) ) { throw ne... | Method to check if a currency is compatible with this amount instance . |
34,853 | public static Collector < MonetaryAmount , ? , Map < CurrencyUnit , List < MonetaryAmount > > > groupByCurrencyUnit ( ) { return Collectors . groupingBy ( MonetaryAmount :: getCurrency ) ; } | Collector to group by CurrencyUnit |
34,854 | public static Collector < MonetaryAmount , MonetarySummaryStatistics , MonetarySummaryStatistics > summarizingMonetary ( CurrencyUnit currencyUnit ) { Supplier < MonetarySummaryStatistics > supplier = ( ) -> new DefaultMonetarySummaryStatistics ( currencyUnit ) ; return Collector . of ( supplier , MonetarySummaryStatis... | Creates a the summary of MonetaryAmounts . |
34,855 | public static Collector < MonetaryAmount , MonetarySummaryStatistics , MonetarySummaryStatistics > summarizingMonetary ( CurrencyUnit currencyUnit , ExchangeRateProvider provider ) { return summarizingMonetary ( currencyUnit ) ; } | reates a the summary of MonetaryAmounts . |
34,856 | public static Collector < MonetaryAmount , GroupMonetarySummaryStatistics , GroupMonetarySummaryStatistics > groupBySummarizingMonetary ( ) { return Collector . of ( GroupMonetarySummaryStatistics :: new , GroupMonetarySummaryStatistics :: accept , GroupMonetarySummaryStatistics :: combine ) ; } | of MonetaryAmount group by MonetarySummary |
34,857 | public static Predicate < MonetaryAmount > isBetween ( MonetaryAmount min , MonetaryAmount max ) { return isLessThanOrEqualTo ( max ) . and ( isGreaterThanOrEqualTo ( min ) ) ; } | Creates a filter using the isBetween predicate . |
34,858 | public static MonetaryAmount sum ( MonetaryAmount a , MonetaryAmount b ) { MoneyUtils . checkAmountParameter ( Objects . requireNonNull ( a ) , Objects . requireNonNull ( b . getCurrency ( ) ) ) ; return a . add ( b ) ; } | Adds two monetary together |
34,859 | public static BinaryOperator < MonetaryAmount > sum ( ExchangeRateProvider provider , CurrencyUnit currency ) { CurrencyConversion currencyConversion = provider . getCurrencyConversion ( currency ) ; return ( m1 , m2 ) -> currencyConversion . apply ( m1 ) . add ( currencyConversion . apply ( m2 ) ) ; } | return the sum and convert all values to specific currency using the provider if necessary |
34,860 | public static BinaryOperator < MonetaryAmount > min ( ExchangeRateProvider provider ) { return ( m1 , m2 ) -> { CurrencyConversion conversion = provider . getCurrencyConversion ( m1 . getCurrency ( ) ) ; if ( m1 . isGreaterThan ( conversion . apply ( m2 ) ) ) { return m2 ; } return m1 ; } ; } | return the minimum value if the monetary amounts have different currencies will converter first using the given ExchangeRateProvider |
34,861 | public static Collector < MonetaryAmount , MonetarySummaryStatistics , MonetarySummaryStatistics > summarizingMonetary ( CurrencyUnit currencyUnit , ExchangeRateProvider provider ) { Supplier < MonetarySummaryStatistics > supplier = ( ) -> new ExchangeRateMonetarySummaryStatistics ( currencyUnit , provider ) ; return C... | of the summary of the MonetaryAmount |
34,862 | public byte [ ] getBlock ( String url , long offset , int length ) throws IOException { HttpMethod method = null ; try { method = new GetMethod ( url ) ; } catch ( IllegalArgumentException e ) { LOGGER . warning ( "Bad URL for block fetch:" + url ) ; throw new IOException ( "Url:" + url + " does not look like an URL?" ... | Fetch a range of bytes from a particular URL . Note that the bytes are read into memory all at once so care should be taken with the length argument . |
34,863 | public static RequestMapper readSpringConfig ( String configPath , ServletContext servletContext ) { LOGGER . info ( "Loading from config file " + configPath ) ; currentContext = new FileSystemXmlApplicationContext ( "file:" + configPath ) ; Map < String , RequestHandler > beans = currentContext . getBeansOfType ( Requ... | Read the single Spring XML configuration file located at the specified path performing PropertyPlaceHolder interpolation extracting all beans which implement the RequestHandler interface and construct a RequestMapper for those RequestHandlers on the specified ServletContext . |
34,864 | public static String renderHTML ( Graph graph , String mapName , String imgUrl , String targets [ ] , String titles [ ] ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "<map name=\"" ) . append ( mapName ) . append ( "\">" ) ; RegionGraphElement rge [ ] = graph . getRegions ( ) ; int count = rge . length ;... | Create both an HTML AREA map and an HTML IMG for a graph using provided href targets and titles within the AREA map . |
34,865 | public void render ( OutputStream target , Graph graph ) throws IOException { BufferedImage bi = new BufferedImage ( graph . width , graph . height , GraphConfiguration . imageType ) ; Graphics2D g2d = bi . createGraphics ( ) ; graph . draw ( g2d ) ; ImageIO . write ( bi , "png" , target ) ; } | Send a PNG format byte stream for the argument Graph to the provided OutputStream |
34,866 | public static DecodingResource forEncoding ( String contentEncoding , Resource source ) throws IOException { InputStream stream = decodingStream ( contentEncoding , source ) ; if ( stream == null ) { return null ; } return new DecodingResource ( source , stream ) ; } | Returns a DecodingResource that wraps an existing resource with a decompressor for the given Content - Encoding . |
34,867 | public void setCDXSources ( List < String > cdxs ) { sources = new ArrayList < SearchResultSource > ( ) ; for ( int i = 0 ; i < cdxs . size ( ) ; i ++ ) { CDXIndex index = new CDXIndex ( ) ; index . setPath ( cdxs . get ( i ) ) ; addSource ( index ) ; } } | Sets the list of files searched for queries against this SearchResultSource to the list of paths cdxs |
34,868 | public static Graph decode ( String encodedGraph , boolean noMonth ) throws GraphEncodingException { GraphConfiguration config = new GraphConfiguration ( ) ; if ( noMonth ) { config . valueHighlightColor = config . valueColor ; } return decode ( encodedGraph , config ) ; } | convert a String - encoded graph into a usable Graph object using default GraphConfiguration |
34,869 | public static Graph decode ( String encodedGraph , GraphConfiguration config ) throws GraphEncodingException { String parts [ ] = encodedGraph . split ( DELIM ) ; int numRegions = parts . length - 2 ; if ( parts . length < 1 ) { throw new GraphEncodingException ( "No regions defined!" ) ; } int width ; int height ; try... | convert a String - encoded graph into a usable Graph object using the provided GraphConfiguration . |
34,870 | public static String encode ( Graph g ) { RegionGraphElement rge [ ] = g . getRegions ( ) ; RegionData data [ ] = new RegionData [ rge . length ] ; for ( int i = 0 ; i < data . length ; i ++ ) { data [ i ] = rge [ i ] . getData ( ) ; } return encode ( g . width , g . height , data ) ; } | Convert a complete Graph into an opaque String that can later be re - assembled into a Graph object . Note that GraphConfiguration information is NOT encoded into the opaque String . |
34,871 | public static String encode ( int width , int height , RegionData data [ ] ) { StringBuilder sb = new StringBuilder ( ) ; sb . append ( width ) . append ( DELIM ) ; sb . append ( height ) ; boolean first = false ; for ( RegionData datum : data ) { if ( first ) { first = false ; } else { sb . append ( DELIM ) ; } sb . a... | Convert a Graph fields into an opaque String that can later be re - assembled into a Graph object . Note that GraphConfiguration information is NOT encoded into the opaque String . |
34,872 | public String processIfMatches ( final I input ) { String uriAsString = input . getUri ( ) ; String text = input . getTextToProcess ( ) ; Matcher m = patternImpl . matcher ( uriAsString ) ; if ( ! m . find ( ) ) { if ( LOGGER . isLoggable ( Level . FINE ) ) { LOGGER . fine ( "Rule " + getClass ( ) . getSimpleName ( ) +... | Processes the given URI if it matches the configured pattern . |
34,873 | public static ArrayList < ResultsPartition > get ( CaptureSearchResults results , WaybackRequest wbRequest ) { return get ( results , wbRequest , null ) ; } | Determine the correct ResultsPartitioner to use given the SearchResults search range and use that to break the SearchResults into partitions . |
34,874 | public ValueGraphElement getElement ( int i ) { if ( ( i < 0 ) || ( i >= values . length ) ) { throw new NoSuchElementException ( ) ; } int minHeight = config . valueMinHeight ; float value = ( ( float ) values [ i ] ) / ( ( float ) maxValue ) ; float usableHeight = height - minHeight ; int valueHeight = ( int ) ( usab... | return the i th ValueGraphElement |
34,875 | public synchronized void setMembers ( String [ ] urls ) { HashMap < String , RangeMember > newMembers = new HashMap < String , RangeMember > ( ) ; for ( int i = 0 ; i < urls . length ; i ++ ) { if ( members . containsKey ( urls [ i ] ) ) { newMembers . put ( urls [ i ] , members . get ( urls [ i ] ) ) ; } else { RangeM... | Update the list of members of this group . Members that disappear are lost but members that remain across the operation retain their state . |
34,876 | public static String getAllStats ( OutputFormat format ) { StringBuilder sb = new StringBuilder ( ) ; boolean first = true ; Collection < PerfStatEntry > stats = perfStats . get ( ) . values ( ) ; switch ( format ) { case JSON : sb . append ( '{' ) ; for ( PerfStatEntry entry : stats ) { if ( entry . count > 0 ) { if (... | Format all stats in the format specified . |
34,877 | public void resolvePageUrls ( ) { String pageUrl = result . getOriginalUrl ( ) ; String captureDate = result . getCaptureTimestamp ( ) ; String existingBaseHref = TagMagix . getBaseHref ( sb ) ; if ( existingBaseHref == null ) { insertAtStartOfHead ( "<base href=\"" + pageUrl + "\" />" ) ; } else { pageUrl = existingBa... | Update URLs inside the page so those URLs which must be correct at page load time resolve correctly to absolute URLs . |
34,878 | public void resolveAllPageUrls ( ) { String pageUrl = result . getOriginalUrl ( ) ; String captureDate = result . getCaptureTimestamp ( ) ; String existingBaseHref = TagMagix . getBaseHref ( sb ) ; if ( existingBaseHref != null ) { pageUrl = existingBaseHref ; } ResultURIConverter ruc = new SpecialResultURIConverter ( ... | Update all URLs inside the page so they resolve correctly to absolute URLs within the Wayback service . |
34,879 | public void writeToOutputStream ( OutputStream os ) throws IOException { if ( sb == null ) { throw new IllegalStateException ( "No interal StringBuffer" ) ; } byte [ ] b ; try { b = getBytes ( ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } os . write ( b ) ; } | Write the contents of the page to the client . |
34,880 | public static File ensureDir ( String path , String name ) throws IOException { if ( ( path == null ) || ( path . length ( ) == 0 ) ) { throw new IOException ( "No configuration for (" + name + ")" ) ; } File dir = new File ( path ) ; if ( dir . exists ( ) ) { if ( ! dir . isDirectory ( ) ) { throw new IOException ( "D... | Ensure that the path pointed to by path is a directory if possible |
34,881 | public void setRenderingHints ( Graphics2D g2d ) { g2d . setRenderingHint ( RenderingHints . KEY_ANTIALIASING , RenderingHints . VALUE_ANTIALIAS_OFF ) ; g2d . setRenderingHint ( RenderingHints . KEY_TEXT_ANTIALIASING , RenderingHints . VALUE_TEXT_ANTIALIAS_ON ) ; } | Set whatever redneringHints are needed to properly draw the graph ie . AntiAliasing etc . |
34,882 | public String getLocalized ( String key ) { if ( bundle != null ) { try { return bundle . getString ( key ) ; } catch ( Exception e ) { } } return key ; } | Access a localized string associated with key from the ResourceBundle likely the UI . properties file . |
34,883 | public void init ( ) throws ConfigurationException { if ( index == null ) { throw new ConfigurationException ( "No index target" ) ; } if ( ! index . isUpdatable ( ) ) { throw new ConfigurationException ( "ResourceIndex is not updatable" ) ; } if ( incoming == null ) { throw new ConfigurationException ( "No incoming" )... | start the background index merging thread |
34,884 | public void parseHeaders ( ) throws IOException { if ( ! parsedHeader ) { arcRecord . skipHttpHeader ( ) ; Header [ ] headers = arcRecord . getHttpHeaders ( ) ; if ( headers != null ) { for ( int i = 0 ; i < headers . length ; i ++ ) { String value = headers [ i ] . getValue ( ) ; String name = headers [ i ] . getName ... | parse the headers on the underlying ARC record and extract all |
34,885 | public String resultToReplayUrl ( CaptureSearchResult result ) { if ( uriConverter == null ) { return null ; } String url = result . getOriginalUrl ( ) ; String captureDate = result . getCaptureTimestamp ( ) ; return uriConverter . makeReplayURI ( captureDate , url ) ; } | Create a replay URL for the given CaptureSearchResult |
34,886 | public String urlForPage ( int pageNum ) { WaybackRequest wbRequest = getWbRequest ( ) ; return wbRequest . getAccessPoint ( ) . getQueryPrefix ( ) + "query?" + wbRequest . getQueryArguments ( pageNum ) ; } | Create a self - referencing URL that will drive to the given page simplifying rendering pagination |
34,887 | public void forward ( HttpServletRequest request , HttpServletResponse response , final String target ) throws ServletException , IOException { if ( target . startsWith ( "/WEB-INF/classes" ) || target . startsWith ( "/WEB-INF/lib" ) || target . matches ( "^/WEB-INF/.+\\.xml" ) ) { throw new IOException ( "Not allowed"... | Store this UIResults object in the given HttpServletRequest then forward the request to target in this case an image html file . jsp any file which can return a complete document . Specifically this means that if target is a . jsp it must render it s own header and footer . |
34,888 | public static UIResults extractException ( HttpServletRequest httpRequest ) throws ServletException { UIResults results = ( UIResults ) httpRequest . getAttribute ( FERRET_NAME ) ; if ( results == null ) { throw new ServletException ( "No attribute.." ) ; } if ( results . exception == null ) { throw new ServletExceptio... | Extract an Exception UIResults from the HttpServletRequest . Probably used by a . jsp responsible for actual drawing errors for the user . private |
34,889 | public static UIResults extractCaptureQuery ( HttpServletRequest httpRequest ) throws ServletException { UIResults results = ( UIResults ) httpRequest . getAttribute ( FERRET_NAME ) ; if ( results == null ) { throw new ServletException ( "No attribute.." ) ; } if ( results . wbRequest == null ) { throw new ServletExcep... | Extract a CaptureQuery UIResults from the HttpServletRequest . Probably used by a . jsp responsible for actually drawing search results for the user . |
34,890 | public static UIResults extractUrlQuery ( HttpServletRequest httpRequest ) throws ServletException { UIResults results = ( UIResults ) httpRequest . getAttribute ( FERRET_NAME ) ; if ( results == null ) { throw new ServletException ( "No attribute.." ) ; } if ( results . wbRequest == null ) { throw new ServletException... | Extract a UrlQuery UIResults from the HttpServletRequest . Probably used by a . jsp responsible for actually drawing search results for the user . |
34,891 | public static UIResults extractReplay ( HttpServletRequest httpRequest ) throws ServletException { UIResults results = ( UIResults ) httpRequest . getAttribute ( FERRET_NAME ) ; if ( results == null ) { throw new ServletException ( "No attribute.." ) ; } if ( results . wbRequest == null ) { throw new ServletException (... | Extract a Replay UIResults from the HttpServletRequest . Probably used by a . jsp insert responsible for rendering content into replayed Resources to enhance the Replay experience . |
34,892 | public String getTargetSite ( ) { try { String urlstr = wbRequest . getRequestUrl ( ) ; if ( urlstr == null ) return null ; URL url = new URL ( urlstr ) ; return url . getHost ( ) ; } catch ( MalformedURLException ex ) { return null ; } } | return hostname portion of request URL . |
34,893 | private void populateFileList ( ResourceFileList list , File root , boolean recurse ) throws IOException { if ( root . isDirectory ( ) ) { File [ ] files = root . listFiles ( ) ; if ( files != null ) { for ( File file : files ) { if ( file . isFile ( ) && filter . accept ( root , file . getName ( ) ) ) { ResourceFileLo... | add all files matching this . filter beneath root to list recursing if recurse is set . |
34,894 | public synchronized void shutdownDB ( ) throws DatabaseException { if ( db != null ) { db . close ( ) ; db = null ; } if ( env != null ) { env . close ( ) ; env = null ; } } | shut down the BDB . |
34,895 | public void copyToOutputStream ( OutputStream o ) throws IOException { long left = end - start ; int BUFF_SIZE = 4096 ; byte buf [ ] = new byte [ BUFF_SIZE ] ; RandomAccessFile raf = new RandomAccessFile ( file , "r" ) ; try { raf . seek ( start ) ; while ( left > 0 ) { int amtToRead = ( int ) Math . min ( left , BUFF_... | Copy this record to the provided OutputStream |
34,896 | public void setPrefix ( String prefix ) { this . prefix = prefix ; if ( this . prefix != null && this . prefix . isEmpty ( ) ) this . prefix = null ; } | prefix prepended to the name of headers preserved . |
34,897 | public static void registerHandler ( RequestHandler handler , RequestMapper mapper ) { String name = null ; int internalPort = 8080 ; if ( handler instanceof AbstractRequestHandler ) { name = ( ( AbstractRequestHandler ) handler ) . getAccessPointPath ( ) ; internalPort = ( ( AbstractRequestHandler ) handler ) . getInt... | Extract the RequestHandler objects beanName parse it and register the RequestHandler with the RequestMapper according to the beanNames semantics . |
34,898 | public static CaptureSearchResult parseCDXLineFlex ( String line ) { CaptureSearchResult result = new CaptureSearchResult ( ) ; return parseCDXLineFlex ( line , result ) ; } | Single place to do the flex cdx - line parsing logic |
34,899 | public static CaptureSearchResult parseCDXLineFlexFast ( String line ) { CaptureSearchResult result = new FastCaptureSearchResult ( ) ; return parseCDXLineFlex ( line , result ) ; } | Use FastCaptureSearchResult to |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.