idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
39,900 | public com . google . api . ads . admanager . axis . v201808 . ComputedStatus getComputedStatus ( ) { return computedStatus ; } | Gets the computedStatus value for this ProposalLineItem . | 33 | 13 |
39,901 | public com . google . api . ads . admanager . axis . v201808 . ReservationStatus getReservationStatus ( ) { return reservationStatus ; } | Gets the reservationStatus value for this ProposalLineItem . | 33 | 13 |
39,902 | public com . google . api . ads . admanager . axis . v201808 . PricingModel getRateCardPricingModel ( ) { return rateCardPricingModel ; } | Gets the rateCardPricingModel value for this ProposalLineItem . | 39 | 17 |
39,903 | public void setSteps ( com . google . api . ads . admanager . axis . v201805 . ProgressStep [ ] steps ) { this . steps = steps ; } | Sets the steps value for this WorkflowProgress . | 37 | 11 |
39,904 | public void setPremiumRateValues ( com . google . api . ads . admanager . axis . v201811 . PremiumRateValue [ ] premiumRateValues ) { this . premiumRateValues = premiumRateValues ; } | Sets the premiumRateValues value for this PremiumRate . | 45 | 12 |
39,905 | public com . google . api . ads . admanager . axis . v201902 . SwiffyFallbackAsset getSwiffyAsset ( ) { return swiffyAsset ; } | Gets the swiffyAsset value for this FlashCreative . | 39 | 14 |
39,906 | public void setSwiffyAsset ( com . google . api . ads . admanager . axis . v201902 . SwiffyFallbackAsset swiffyAsset ) { this . swiffyAsset = swiffyAsset ; } | Sets the swiffyAsset value for this FlashCreative . | 50 | 14 |
39,907 | public void setOperator ( com . google . api . ads . admanager . axis . v201811 . AudienceSegmentCriteriaComparisonOperator operator ) { this . operator = operator ; } | Sets the operator value for this AudienceSegmentCriteria . | 43 | 14 |
39,908 | public void setOperatingSystems ( com . google . api . ads . admanager . axis . v201805 . Technology [ ] operatingSystems ) { this . operatingSystems = operatingSystems ; } | Sets the operatingSystems value for this OperatingSystemTargeting . | 44 | 14 |
39,909 | public com . google . api . ads . admanager . axis . v201902 . DateRange getTargetDateRange ( ) { return targetDateRange ; } | Gets the targetDateRange value for this HistoricalAdjustment . | 33 | 13 |
39,910 | public void setTargetDateRange ( com . google . api . ads . admanager . axis . v201902 . DateRange targetDateRange ) { this . targetDateRange = targetDateRange ; } | Sets the targetDateRange value for this HistoricalAdjustment . | 42 | 13 |
39,911 | public com . google . api . ads . admanager . axis . v201902 . DateRange getReferenceDateRange ( ) { return referenceDateRange ; } | Gets the referenceDateRange value for this HistoricalAdjustment . | 33 | 13 |
39,912 | public void setReferenceDateRange ( com . google . api . ads . admanager . axis . v201902 . DateRange referenceDateRange ) { this . referenceDateRange = referenceDateRange ; } | Sets the referenceDateRange value for this HistoricalAdjustment . | 42 | 13 |
39,913 | public com . google . api . ads . adwords . axis . v201809 . o . AdGroupEstimateRequest [ ] getAdGroupEstimateRequests ( ) { return adGroupEstimateRequests ; } | Gets the adGroupEstimateRequests value for this CampaignEstimateRequest . | 46 | 17 |
39,914 | public com . google . api . ads . adwords . axis . v201809 . cm . Money getDailyBudget ( ) { return dailyBudget ; } | Gets the dailyBudget value for this CampaignEstimateRequest . | 34 | 14 |
39,915 | public String serialize ( T object , boolean includeXmlDeclaration ) { try { Marshaller marshaller = jaxbContext . createMarshaller ( ) ; marshaller . setProperty ( Marshaller . JAXB_FRAGMENT , Boolean . valueOf ( ! includeXmlDeclaration ) ) ; JAXBElement < T > element = new JAXBElement < T > ( qname , clazz , object )... | Serializes the object with the option to include or exclude the XML declaration . | 167 | 15 |
39,916 | public void setGeoSegment ( com . google . api . ads . admanager . axis . v201805 . GeoTargeting geoSegment ) { this . geoSegment = geoSegment ; } | Sets the geoSegment value for this ProductSegmentation . | 47 | 14 |
39,917 | public void setAdUnitSegments ( com . google . api . ads . admanager . axis . v201805 . AdUnitTargeting [ ] adUnitSegments ) { this . adUnitSegments = adUnitSegments ; } | Sets the adUnitSegments value for this ProductSegmentation . | 50 | 14 |
39,918 | public com . google . api . ads . admanager . axis . v201808 . Money getDfpRevenue ( ) { return dfpRevenue ; } | Gets the dfpRevenue value for this ReconciliationReportRow . | 34 | 16 |
39,919 | protected < H extends AdsServiceClientFactoryHelper < C , S , D > , F extends BaseAdsServiceClientFactory < C , S , D > > void configureFactories ( TypeLiteral < AdsServiceClientFactoryInterface < C , S , D > > adsServiceClientFactoryTypeLiteral , TypeLiteral < AdsServiceDescriptorFactoryInterface < D > > adsServiceDes... | Configures the factories . | 221 | 5 |
39,920 | private static byte [ ] getByteArrayFromStream ( final InputStream inputStream ) throws IOException { return new ByteSource ( ) { @ Override public InputStream openStream ( ) { return inputStream ; } } . read ( ) ; } | Gets the byte array from the input stream containing the full data from that stream . | 51 | 17 |
39,921 | @ Override public Object invoke ( Object proxy , final Method method , final Object [ ] args ) throws Throwable { try { return getClass ( ) . getMethod ( method . getName ( ) , method . getParameterTypes ( ) ) . invoke ( this , args ) ; } catch ( NoSuchMethodException e ) { // Ignore and let the SOAP client handler tak... | Wraps the underlying SOAP RPC such that first the method by its name is applied to the runtime class . If no such method exists it is assumed that the call is meant for the SOAP client . In this case the SOAP client handler will invoke the SOAP client method with provided arguments . | 147 | 60 |
39,922 | protected Object unwrapRemoteCallReturn ( RemoteCallReturn remoteCallReturn ) throws Throwable { if ( remoteCallReturn . getException ( ) != null ) { throw handleException ( remoteCallReturn . getException ( ) ) ; } else { return remoteCallReturn . getReturnValue ( ) ; } } | Unwraps a SOAP remote call return such that if there was an exception it is thrown and if it was a successful call the return value of the SOAP call is returned . | 63 | 37 |
39,923 | public void setTargetedRequestPlatforms ( com . google . api . ads . admanager . axis . v201808 . RequestPlatform [ ] targetedRequestPlatforms ) { this . targetedRequestPlatforms = targetedRequestPlatforms ; } | Sets the targetedRequestPlatforms value for this RequestPlatformTargeting . | 49 | 15 |
39,924 | public void setOptions ( com . google . api . ads . admanager . axis . v201808 . CustomFieldOption [ ] options ) { this . options = options ; } | Sets the options value for this DropDownCustomField . | 37 | 12 |
39,925 | public com . google . api . ads . adwords . axis . v201809 . cm . AssetLink [ ] getMarketingImages ( ) { return marketingImages ; } | Gets the marketingImages value for this MultiAssetResponsiveDisplayAd . | 36 | 16 |
39,926 | public com . google . api . ads . adwords . axis . v201809 . cm . AssetLink [ ] getSquareMarketingImages ( ) { return squareMarketingImages ; } | Gets the squareMarketingImages value for this MultiAssetResponsiveDisplayAd . | 39 | 18 |
39,927 | public com . google . api . ads . adwords . axis . v201809 . cm . AssetLink [ ] getLogoImages ( ) { return logoImages ; } | Gets the logoImages value for this MultiAssetResponsiveDisplayAd . | 36 | 16 |
39,928 | public com . google . api . ads . adwords . axis . v201809 . cm . AssetLink [ ] getLandscapeLogoImages ( ) { return landscapeLogoImages ; } | Gets the landscapeLogoImages value for this MultiAssetResponsiveDisplayAd . | 40 | 18 |
39,929 | public com . google . api . ads . adwords . axis . v201809 . cm . AssetLink getLongHeadline ( ) { return longHeadline ; } | Gets the longHeadline value for this MultiAssetResponsiveDisplayAd . | 35 | 17 |
39,930 | public void setYouTubeVideos ( com . google . api . ads . adwords . axis . v201809 . cm . AssetLink [ ] youTubeVideos ) { this . youTubeVideos = youTubeVideos ; } | Sets the youTubeVideos value for this MultiAssetResponsiveDisplayAd . | 49 | 18 |
39,931 | public com . google . api . ads . adwords . axis . v201809 . cm . Image getLandscapeLogoImage ( ) { return landscapeLogoImage ; } | Gets the landscapeLogoImage value for this DynamicSettings . | 37 | 13 |
39,932 | public com . google . api . ads . admanager . axis . v201805 . CustomFieldVisibility getVisibility ( ) { return visibility ; } | Gets the visibility value for this CustomField . | 32 | 10 |
39,933 | public void setProductTemplateMarketplaceInfo ( com . google . api . ads . admanager . axis . v201808 . ProductTemplateMarketplaceInfo productTemplateMarketplaceInfo ) { this . productTemplateMarketplaceInfo = productTemplateMarketplaceInfo ; } | Sets the productTemplateMarketplaceInfo value for this ProductTemplate . | 53 | 14 |
39,934 | @ SuppressWarnings ( "unchecked" ) /* See constructor comments. */ public void setAuthorization ( Object soapClient , AdsSession adsSession ) throws AuthenticationException { final String authorizationHeader = authorizationHeaderProvider . getAuthorizationHeader ( adsSession , soapClientHandler . getEndpointAddress ( s... | Sets the authorization header created from the session on the soap client . | 109 | 14 |
39,935 | public com . google . api . ads . adwords . axis . v201809 . cm . TrialAsyncError [ ] getEntries ( ) { return entries ; } | Gets the entries value for this TrialAsyncErrorPage . | 35 | 12 |
39,936 | public com . google . api . ads . adwords . axis . v201809 . cm . AppUrlOsType getOsType ( ) { return osType ; } | Gets the osType value for this AppUrl . | 35 | 11 |
39,937 | public com . google . api . ads . admanager . axis . v201808 . CreativeAsset getFallbackImageAsset ( ) { return fallbackImageAsset ; } | Gets the fallbackImageAsset value for this BaseFlashCreative . | 35 | 15 |
39,938 | public void setFallbackImageAsset ( com . google . api . ads . admanager . axis . v201808 . CreativeAsset fallbackImageAsset ) { this . fallbackImageAsset = fallbackImageAsset ; } | Sets the fallbackImageAsset value for this BaseFlashCreative . | 46 | 15 |
39,939 | public com . google . api . ads . adwords . axis . v201809 . cm . FeedStatus getFeedStatus ( ) { return feedStatus ; } | Gets the feedStatus value for this AdCustomizerFeed . | 33 | 13 |
39,940 | public com . google . api . ads . adwords . axis . v201809 . cm . AdCustomizerFeedAttribute [ ] getFeedAttributes ( ) { return feedAttributes ; } | Gets the feedAttributes value for this AdCustomizerFeed . | 38 | 13 |
39,941 | public com . google . api . ads . adwords . axis . v201809 . rm . RuleBasedUserListPrepopulationStatus getPrepopulationStatus ( ) { return prepopulationStatus ; } | Gets the prepopulationStatus value for this RuleBasedUserList . | 41 | 15 |
39,942 | public void buyNumber ( String country , String msisdn ) throws IOException , NexmoClientException { this . buyNumber . execute ( new BuyNumberRequest ( country , msisdn ) ) ; } | Start renting a Nexmo Virtual Number . | 43 | 8 |
39,943 | public void cancelNumber ( String country , String msisdn ) throws IOException , NexmoClientException { this . cancelNumber . execute ( new CancelNumberRequest ( country , msisdn ) ) ; } | Stop renting a Nexmo Virtual Number . | 43 | 8 |
39,944 | public void linkNumber ( String msisdn , String country , String appId ) throws IOException , NexmoClientException { UpdateNumberRequest request = new UpdateNumberRequest ( msisdn , country ) ; request . setVoiceCallbackType ( UpdateNumberRequest . CallbackType . APP ) ; request . setVoiceCallbackValue ( appId ) ; this... | Link a given Nexmo Virtual Number to a Nexmo Application with the given ID . | 81 | 17 |
39,945 | public Document parseXml ( String xml ) throws NexmoResponseParseException { // TODO: Maybe an Error subclass for XML initialization errors, as these are serious and unexpected. Document doc ; this . documentBuilderLock . lock ( ) ; try { if ( this . documentBuilder == null ) { DocumentBuilderFactory documentBuilderFac... | Parse a provided XML String and return the generated DOM Document . | 162 | 13 |
39,946 | public static AdvancedInsightRequest withNumberAndCountry ( String number , String country ) { return new Builder ( number ) . country ( country ) . build ( ) ; } | Construct a AdvancedInsightRequest with a number and country . | 35 | 12 |
39,947 | public DtmfResponse sendDtmf ( String uuid , String digits ) throws IOException , NexmoClientException { return dtmf . put ( uuid , digits ) ; } | Send DTMF codes to an ongoing call . | 40 | 10 |
39,948 | public ModifyCallResponse transferCall ( String uuid , String nccoUrl ) throws IOException , NexmoClientException { return this . modifyCall ( CallModifier . transferCall ( uuid , nccoUrl ) ) ; } | Transfer a call to a different NCCO endpoint . | 51 | 11 |
39,949 | public StreamResponse startStream ( String uuid , String streamUrl , int loop ) throws IOException , NexmoClientException { return streams . put ( new StreamRequest ( uuid , streamUrl , loop ) ) ; } | Stream audio to an ongoing call . | 46 | 7 |
39,950 | public static String calculateMd5 ( String input ) throws NoSuchAlgorithmException { try { return calculateMd5 ( input , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { return null ; // -- impossible -- } } | Calculates MD5 hash for string . assume string is UTF - 8 encoded | 55 | 16 |
39,951 | public static String calculateMd5 ( String input , String encoding ) throws NoSuchAlgorithmException , UnsupportedEncodingException { MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; md . update ( input . getBytes ( encoding ) ) ; byte digest [ ] = md . digest ( ) ; final StringBuilder hexString = new StringB... | Calculates MD5 hash for string . | 141 | 9 |
39,952 | public void submitConversion ( ConversionRequest . Type type , String messageId , boolean delivered , Date timestamp ) throws IOException , NexmoClientException { this . conversionEndpoint . submitConversion ( new ConversionRequest ( type , messageId , delivered , timestamp ) ) ; } | Submit a request to the Conversion API indicating whether or not a message was delivered . | 57 | 16 |
39,953 | public SearchSmsResponse searchMessages ( String id , String ... ids ) throws IOException , NexmoClientException { List < String > idList = new ArrayList <> ( ids . length + 1 ) ; idList . add ( id ) ; idList . addAll ( Arrays . asList ( ids ) ) ; return this . searchMessages ( new SmsIdSearchRequest ( idList ) ) ; } | Search for completed SMS transactions by ID | 92 | 7 |
39,954 | public SearchSmsResponse searchMessages ( Date date , String to ) throws IOException , NexmoClientException { return this . searchMessages ( new SmsDateSearchRequest ( date , to ) ) ; } | Search for completed SMS transactions by date and recipient MSISDN . | 45 | 13 |
39,955 | public SearchRejectedMessagesResponse searchRejectedMessages ( Date date , String to ) throws IOException , NexmoClientException { return this . searchRejectedMessages ( new SearchRejectedMessagesRequest ( date , to ) ) ; } | Search for rejected SMS transactions by date and recipient MSISDN . | 52 | 13 |
39,956 | public PrefixPricingResponse getPrefixPrice ( ServiceType type , String prefix ) throws IOException , NexmoClientException { return getPrefixPrice ( new PrefixPricingRequest ( type , prefix ) ) ; } | Retrieve the pricing for a specified prefix . | 49 | 9 |
39,957 | public SecretResponse getSecret ( String apiKey , String secretId ) throws IOException , NexmoClientException { return getSecret ( new SecretRequest ( apiKey , secretId ) ) ; } | Get information for a specific secret id associated to a given API key . | 40 | 14 |
39,958 | public SecretResponse createSecret ( String apiKey , String secret ) throws IOException , NexmoClientException { return createSecret ( new CreateSecretRequest ( apiKey , secret ) ) ; } | Create a secret to be used with a specific API key . | 39 | 12 |
39,959 | public void revokeSecret ( String apiKey , String secretId ) throws IOException , NexmoClientException { revokeSecret ( new SecretRequest ( apiKey , secretId ) ) ; } | Revoke a secret associated with a specific API key . | 38 | 11 |
39,960 | public static StandardInsightRequest withNumberAndCountry ( String number , String country ) { return new Builder ( number ) . country ( country ) . build ( ) ; } | Construct a StandardInsightRequest with a number and country . | 35 | 12 |
39,961 | public String generateJwt ( ) throws NexmoUnacceptableAuthException { JWTAuthMethod authMethod = this . httpWrapper . getAuthCollection ( ) . getAuth ( JWTAuthMethod . class ) ; return authMethod . constructToken ( System . currentTimeMillis ( ) / 1000L , JWTAuthMethod . constructJTI ( ) ) ; } | Generate a JWT for the application the client has been configured with . | 80 | 15 |
39,962 | public static BasicInsightRequest withNumberAndCountry ( String number , String country ) { return new Builder ( number ) . country ( country ) . build ( ) ; } | Construct a BasicInsightRequest with a number and country . | 35 | 12 |
39,963 | public < T extends AuthMethod > T getAuth ( Class < T > type ) throws NexmoUnacceptableAuthException { for ( AuthMethod availableAuthMethod : this . authList ) { if ( type . isInstance ( availableAuthMethod ) ) { return ( T ) availableAuthMethod ; } } throw new NexmoUnacceptableAuthException ( this . authList , new Has... | Obtain an AuthMethod of type T if one is contained in this collection . | 100 | 16 |
39,964 | public static String bytesToHex ( byte [ ] bytes , String separator ) { StringBuilder tmpBuffer = new StringBuilder ( ) ; if ( bytes != null ) { for ( byte c : bytes ) { int b = c ; if ( b < 0 ) b += 256 ; if ( separator != null ) tmpBuffer . append ( separator ) ; tmpBuffer . append ( HEX_CHARS [ ( b & 0xf0 ) / 0x10 ]... | translate a byte array of raw data into a String with a hex representation of that data . Each octet will be separated with a specific separator . | 142 | 31 |
39,965 | public static byte [ ] hexToBytes ( String str ) { if ( str == null ) return null ; byte [ ] hexChars ; try { hexChars = str . toUpperCase ( ) . getBytes ( "ISO_8859-1" ) ; } catch ( UnsupportedEncodingException e ) { throw new NexmoUnexpectedException ( "ISO_8859_1 is an unsupported encoding in this JVM" ) ; } int siz... | Converts a Hex encoded String into a byte vector . | 298 | 11 |
39,966 | public BasicInsightResponse getBasicNumberInsight ( String number ) throws IOException , NexmoClientException { return getBasicNumberInsight ( BasicInsightRequest . withNumber ( number ) ) ; } | Perform a Basic Insight Request with a number . | 43 | 10 |
39,967 | public BasicInsightResponse getBasicNumberInsight ( String number , String country ) throws IOException , NexmoClientException { return getBasicNumberInsight ( BasicInsightRequest . withNumberAndCountry ( number , country ) ) ; } | Perform a Basic Insight Request with a number and country . | 50 | 12 |
39,968 | public StandardInsightResponse getStandardNumberInsight ( String number ) throws IOException , NexmoClientException { return getStandardNumberInsight ( StandardInsightRequest . withNumber ( number ) ) ; } | Perform a Standard Insight Request with a number . | 43 | 10 |
39,969 | public StandardInsightResponse getStandardNumberInsight ( String number , String country ) throws IOException , NexmoClientException { return getStandardNumberInsight ( StandardInsightRequest . withNumberAndCountry ( number , country ) ) ; } | Perform a Standard Insight Request with a number and country . | 50 | 12 |
39,970 | @ Deprecated public StandardInsightResponse getStandardNumberInsight ( String number , String country , boolean cnam ) throws IOException , NexmoClientException { return getStandardNumberInsight ( StandardInsightRequest . builder ( number ) . country ( country ) . cnam ( cnam ) . build ( ) ) ; } | Perform a Standard Insight Request with a number country and cnam . | 68 | 14 |
39,971 | public AdvancedInsightResponse getAdvancedNumberInsight ( String number ) throws IOException , NexmoClientException { return getAdvancedNumberInsight ( AdvancedInsightRequest . withNumber ( number ) ) ; } | Perform an Advanced Insight Request with a number . | 43 | 10 |
39,972 | public AdvancedInsightResponse getAdvancedNumberInsight ( String number , String country ) throws IOException , NexmoClientException { return getAdvancedNumberInsight ( AdvancedInsightRequest . withNumberAndCountry ( number , country ) ) ; } | Perform an Advanced Insight Request with a number and country . | 50 | 12 |
39,973 | @ Deprecated public AdvancedInsightResponse getAdvancedNumberInsight ( String number , String country , String ipAddress ) throws IOException , NexmoClientException { return getAdvancedNumberInsight ( AdvancedInsightRequest . builder ( number ) . country ( country ) . ipAddress ( ipAddress ) . build ( ) ) ; } | Perform an Advanced Insight Request with a number country and ipAddress . | 68 | 14 |
39,974 | public ResultT execute ( RequestT request ) throws IOException , NexmoClientException { try { RequestBuilder requestBuilder = applyAuth ( makeRequest ( request ) ) ; HttpUriRequest httpRequest = requestBuilder . build ( ) ; // If we have a URL Encoded form entity, we may need to regenerate it as UTF-8 // due to a bug (... | Execute the REST call represented by this method object . | 484 | 11 |
39,975 | public VerifyResponse verify ( final String number , final String brand , final String from , final int length , final Locale locale ) throws IOException , NexmoClientException { return this . verify . verify ( number , brand , from , length , locale ) ; } | Send a verification request to a phone number . | 54 | 9 |
39,976 | public ControlResponse advanceVerification ( String requestId ) throws IOException , NexmoClientException { return this . control . execute ( new ControlRequest ( requestId , VerifyControlCommand . TRIGGER_NEXT_EVENT ) ) ; } | Advance a current verification request to the next stage in the process . | 51 | 14 |
39,977 | public ControlResponse cancelVerification ( String requestId ) throws IOException , NexmoClientException { return this . control . execute ( new ControlRequest ( requestId , VerifyControlCommand . CANCEL ) ) ; } | Cancel a current verification request . | 45 | 7 |
39,978 | public static void parseWikipediaDump ( URL dumpFile , PageCallbackHandler handler ) throws Exception { WikiXMLParser wxsp = WikiXMLParserFactory . getSAXParser ( dumpFile ) ; wxsp . setPageCallback ( handler ) ; wxsp . parse ( ) ; } | A convenience method for the Wikipedia SAX interface | 63 | 9 |
39,979 | private JMethod getMethodsMap ( MethodType type , JFieldVar field , ClassOutline co ) { String getterBody = "return " + field . name ( ) + ";" ; for ( JMethod method : co . implClass . methods ( ) ) { String name = method . name ( ) ; if ( method . type ( ) . isPrimitive ( ) ) { if ( MethodType . GETTER == type && ( na... | I hate this shit | 293 | 4 |
39,980 | private ExecJavaCliParser createExecCommandParser ( String containerWorkDir ) { String execLine = this . filterAndExecuteLaunchScriptAndReturnExecLine ( containerWorkDir ) ; String [ ] values = execLine . split ( "\"" ) ; String javaCli = values [ 1 ] ; String [ ] javaCliValues = javaCli . split ( " " ) ; StringBuffer ... | Creates CLI parser which can be used to extract Container s class name and its launch arguments . | 202 | 19 |
39,981 | private String filterAndExecuteLaunchScriptAndReturnExecLine ( String containerWorkDir ) { BufferedReader reader = null ; BufferedWriter writer = null ; String execLine = null ; File inJvmlaunchScript = null ; try { File launchScript = new File ( containerWorkDir , "launch_container.sh" ) ; inJvmlaunchScript = new File... | This method does three things 1 . It creates an updated version of the initial launch script where it simply copies its contents less the exec line 2 . It extract the exec line and returns it so the Container s class name and launch arguments could be retrieved . 3 . It executes the exec - less launch script to ensure ... | 510 | 78 |
39,982 | private void cleanUp ( ) { try { File file = new File ( System . getProperty ( "user.dir" ) ) ; String [ ] links = file . list ( ) ; for ( String name : links ) { File potentialSymLink = new File ( file , name ) ; if ( FileUtils . isSymlink ( potentialSymLink ) ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( ... | Will clean up symlinks that were created by a launch script | 140 | 12 |
39,983 | @ Override public Map < String , Integer > getGatewayPortMappings ( ) { final Map < String , Integer > result = new ConcurrentHashMap < String , Integer > ( ) ; final Map < String , String > properties = getValByRegex ( GATEWAY_PORT_MAPPING_REGEX ) ; // Convert port no. from string to int for ( final Map . Entry < Stri... | Map of Topology names and their ports . | 222 | 9 |
39,984 | public static void put ( String key , String value ) throws Exception { Map < String , String > environemnt = new HashMap < String , String > ( System . getenv ( ) ) ; environemnt . put ( key , value ) ; updateEnvironment ( environemnt ) ; } | Allows dynamic update to the environment variables . | 64 | 8 |
39,985 | public void createShareLib ( ) { if ( ! oozieShareLibCreate ) { LOG . info ( "OOZIE: Share Lib Create Disabled... skipping" ) ; } else { final String fullOozieTarFilePath = shareLibCacheDir + Path . SEPARATOR + getOozieTarFileName ( ) ; try { // Get and extract the oozie release getOozieTarFileFromRepo ( ) ; String ooz... | Main driver that downloads extracts and deploys the oozie sharelib | 416 | 13 |
39,986 | public PageRevision getMostRecentRevision ( String ... titles ) throws Exception { URL url = new URL ( entryPoint + "/w/api.php?format=json&action=query&prop=revisions&rvprop=user|timestamp&titles=" + encode ( Joiner . on ( "|" ) . join ( titles ) , "UTF-8" ) ) ; String response = readURL ( url ) ; List < PageRevision ... | Returns the latest revision of the page which was edited last | 175 | 11 |
39,987 | public StubWithCondition match ( String label , Condition ... conditions ) { StubWithCondition swc = new StubWithCondition ( stubServer , Condition . composite ( conditions ) ) ; swc . stub . withLabel ( label ) ; return swc ; } | Creates a stub with a label and adds a condition to it | 52 | 13 |
39,988 | public boolean isApplicable ( Call call ) { return when . getPredicate ( ) . test ( call ) && ( actionSequence . size ( ) == 0 || exceededAction != null || actionSequence . size ( ) > appliedTimes ) ; } | Checks whether the call satisfies condition of this stub | 53 | 10 |
39,989 | public Response apply ( Response response ) { if ( when instanceof ConditionWithApplicables ) { for ( Applicable applicable : ( ( ConditionWithApplicables ) when ) . getApplicables ( ) ) { response = applicable . apply ( response ) ; } } Applicable chosenAction ; if ( actionSequence . isEmpty ( ) ) { chosenAction = act... | Executes all actions against the response . | 152 | 8 |
39,990 | public StubWithAction then ( Applicable ... actions ) { Stub s = this . stub . withAction ( composite ( actions ) ) ; stubServer . addStub ( s ) ; return new StubWithAction ( s ) ; } | Attach actions to the stub | 48 | 5 |
39,991 | public static Action status ( final HttpStatus status ) { return new Action ( input -> { input . setStatus ( status ) ; return input ; } ) ; } | Sets HTTP status to response | 34 | 6 |
39,992 | public static Action bytesContent ( final byte [ ] content ) { return new Action ( response -> { response . setContentLength ( content . length ) ; try { response . getOutputStream ( ) . write ( content ) ; } catch ( IOException e ) { throw new RuntimeException ( "Can not write resource content for restito stubbing." )... | Writes bytes content to response | 81 | 6 |
39,993 | public static Action header ( final String key , final String value ) { return new Action ( input -> { input . setHeader ( key , value ) ; return input ; } ) ; } | Sets key - value header on response | 38 | 8 |
39,994 | public static Action contentType ( final String contentType ) { return new Action ( r -> { r . setContentType ( contentType ) ; return r ; } ) ; } | Sets content type to the response | 36 | 7 |
39,995 | public static Action unauthorized ( final String realm ) { return new Action ( r -> { r . addHeader ( "WWW-Authenticate" , "Basic realm=\"" + realm + "\"" ) ; r . setStatus ( HttpStatus . UNAUTHORIZED_401 ) ; return r ; } ) ; } | Returns unauthorized response | 69 | 3 |
39,996 | public static Action delay ( final Integer delay ) { return new Action ( input -> { try { Thread . sleep ( delay ) ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; } return input ; } ) ; } | Sleeps so many milliseconds emulating slow requests . | 54 | 10 |
39,997 | public StubServer run ( ) { simpleServer . getServerConfiguration ( ) . addHttpHandler ( stubsToHandler ( ) , "/" ) ; try { if ( secured ) { for ( NetworkListener networkListener : simpleServer . getListeners ( ) ) { networkListener . setSecure ( true ) ; SSLEngineConfigurator sslEngineConfig = new SSLEngineConfigurato... | Starts the server | 144 | 4 |
39,998 | private String createCertificateStore ( String resourceName ) throws IOException { URL resource = StubServer . class . getResource ( "/" + resourceName ) ; File store = File . createTempFile ( resourceName , "store" ) ; try ( InputStream input = resource . openStream ( ) ) { Files . copy ( input , store . toPath ( ) , ... | Copy the Certificate store to the temporary directory as it needs to be in a real file not inside a jar for Grizzly to pick it up . | 112 | 29 |
39,999 | public static Condition method ( final Method m ) { return new Condition ( input -> m . equals ( input . getMethod ( ) ) ) ; } | Checks HTTP method | 30 | 4 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.