idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
20,600 | public String getString ( Object value ) { try { return DATE_TIME_FORMAT . format ( value ) ; } catch ( IllegalArgumentException ignore ) { } return StringValues . TO_STRING . getString ( value ) ; } | This method is not threadsafe and should therefore only be called from the EDT |
20,601 | private ApiResponse buildResponseFromContext ( Context c ) { Map < String , String > fields = new HashMap < > ( ) ; fields . put ( "name" , c . getName ( ) ) ; fields . put ( "id" , Integer . toString ( c . getIndex ( ) ) ) ; fields . put ( "description" , c . getDescription ( ) ) ; fields . put ( "inScope" , Boolean .... | Builds the response describing an Context . |
20,602 | private Tech getTech ( String techName ) throws ApiException { String trimmedTechName = techName . trim ( ) ; for ( Tech tech : Tech . builtInTech ) { if ( tech . toString ( ) . equalsIgnoreCase ( trimmedTechName ) ) return tech ; } throw new ApiException ( Type . ILLEGAL_PARAMETER , "The tech '" + trimmedTechName + "'... | Gets the tech that matches the techName or throws an exception if no tech matches |
20,603 | private JButton getStartSessionButton ( ) { if ( startSessionButton == null ) { startSessionButton = new JButton ( ) ; startSessionButton . setText ( Constant . messages . getString ( "database.newsession.button.start" ) ) ; startSessionButton . setEnabled ( false ) ; startSessionButton . addActionListener ( new java .... | This method initializes startSessionButton |
20,604 | public synchronized HttpMessage pollPath ( HttpMessage msg ) { SiteNode resultNode = null ; URI uri = msg . getRequestHeader ( ) . getURI ( ) ; SiteNode parent = getRoot ( ) ; String folder ; try { String host = getHostName ( uri ) ; parent = findChild ( parent , host ) ; if ( parent == null ) { return null ; } List < ... | Return the a HttpMessage of the same type under the tree path . |
20,605 | public synchronized SiteNode addPath ( HistoryReference ref ) { if ( Constant . isLowMemoryOptionSet ( ) ) { throw new InvalidParameterException ( "SiteMap should not be accessed when the low memory option is set" ) ; } HttpMessage msg = null ; try { msg = ref . getHttpMessage ( ) ; } catch ( Exception e ) { log . erro... | Add the HistoryReference into the SiteMap . This method will rely on reading message from the History table . Note that this method must only be called on the EventDispatchThread |
20,606 | public void setFilter ( SiteTreeFilter filter ) { this . filter = filter ; SiteNode root = getRoot ( ) ; setFilter ( filter , root ) ; root . setFiltered ( false ) ; } | Set the filter for the sites tree |
20,607 | private void clearParentFilter ( SiteNode parent ) { if ( parent != null ) { parent . setFiltered ( false ) ; clearParentFilter ( parent . getParent ( ) ) ; } } | Recurse up the tree setting all of the parent nodes to unfiltered |
20,608 | private void handleEvent ( SiteNode parent , SiteNode node , EventType eventType ) { switch ( eventType ) { case ADD : publishEvent ( SiteMapEventPublisher . SITE_NODE_ADDED_EVENT , node ) ; if ( parent == getRoot ( ) ) { publishEvent ( SiteMapEventPublisher . SITE_ADDED_EVENT , node ) ; } break ; case REMOVE : publish... | Handles the publishing of the add or remove event . Node events are always published . Site events are only published when the parent of the node is the root of the tree . |
20,609 | private static void publishEvent ( String event , SiteNode node ) { ZAP . getEventBus ( ) . publishSyncEvent ( SiteMapEventPublisher . getPublisher ( ) , new Event ( SiteMapEventPublisher . getPublisher ( ) , event , new Target ( node ) ) ) ; } | Publish the event being carried out . |
20,610 | public void reloadPolicies ( String scanPolicyName ) { DefaultComboBoxModel < String > policies = new DefaultComboBoxModel < > ( ) ; for ( String policy : extension . getPolicyManager ( ) . getAllPolicyNames ( ) ) { policies . addElement ( policy ) ; } getPolicySelector ( ) . setModel ( policies ) ; getPolicySelector (... | Reloads the scan policies which will pick any new ones that have been defined and selects the policy with the given name . |
20,611 | private ZapTextArea getTxtDescription ( ) { if ( txtDescription == null ) { txtDescription = new ZapTextArea ( ) ; txtDescription . setBorder ( javax . swing . BorderFactory . createBevelBorder ( javax . swing . border . BevelBorder . LOWERED ) ) ; txtDescription . setLineWrap ( true ) ; } return txtDescription ; } | This method initializes txtDescription |
20,612 | public void save ( ) { List < Object > contextSpecificObjects = new ArrayList < Object > ( ) ; techTreeState = getTechTree ( ) . getTechSet ( ) ; if ( ! this . getBoolValue ( FIELD_ADVANCED ) ) { contextSpecificObjects . add ( scanPolicy ) ; } else { contextSpecificObjects . add ( policyPanel . getScanPolicy ( ) ) ; if... | Use the save method to launch a scan |
20,613 | public void enableUserDefinedRPC ( ) { int enabledRpc = scannerParam . getTargetParamsEnabledRPC ( ) ; enabledRpc |= ScannerParam . RPC_USERDEF ; scannerParam . setTargetParamsEnabledRPC ( enabledRpc ) ; } | Force UserDefinedRPC setting |
20,614 | protected void initializeCredentialsConfigPanel ( ) { AuthenticationMethodType type = workingContext . getAuthenticationMethod ( ) . getType ( ) ; if ( type . hasCredentialsOptionsPanel ( ) ) { credentialsPanel = type . buildCredentialsOptionsPanel ( configuredCredentials , workingContext ) ; fieldsPanel . add ( creden... | Initialize credentials config panel . |
20,615 | private JToolBar getToolbarLeft ( ) { if ( footerToolbarLeft == null ) { footerToolbarLeft = new JToolBar ( ) ; footerToolbarLeft . setEnabled ( true ) ; footerToolbarLeft . setFloatable ( false ) ; footerToolbarLeft . setRollover ( true ) ; footerToolbarLeft . setName ( "Footer Toolbar Left" ) ; footerToolbarLeft . se... | Left toolbar for alerts |
20,616 | private JToolBar getToolbarRight ( ) { if ( footerToolbarRight == null ) { footerToolbarRight = new JToolBar ( ) ; footerToolbarRight . setEnabled ( true ) ; footerToolbarRight . setFloatable ( false ) ; footerToolbarRight . setRollover ( true ) ; footerToolbarRight . setName ( "Footer Toolbar Right" ) ; footerToolbarR... | Right toolbar for current scan results |
20,617 | public void addFooterToolbarRightLabel ( JLabel label ) { DisplayUtils . scaleIcon ( label ) ; this . footerToolbarRight . add ( label ) ; this . validate ( ) ; } | Support for dynamic scanning results in the footer |
20,618 | protected ExtensionHttpSessions getExtensionHttpSessions ( ) { if ( extensionHttpSessions == null ) { extensionHttpSessions = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionHttpSessions . class ) ; if ( extensionHttpSessions == null ) log . error ( "Http Sessions Extension should be enabl... | Gets the ExtensionHttpSessions if it s enabled . |
20,619 | private ContextUsersPanel getContextPanel ( int contextId ) { ContextUsersPanel panel = this . userPanelsMap . get ( contextId ) ; if ( panel == null ) { panel = new ContextUsersPanel ( this , contextId ) ; this . userPanelsMap . put ( contextId , panel ) ; } return panel ; } | Gets the context panel for a given context . |
20,620 | public ContextUserAuthManager getContextUserAuthManager ( int contextId ) { ContextUserAuthManager manager = contextManagers . get ( contextId ) ; if ( manager == null ) { manager = new ContextUserAuthManager ( contextId ) ; contextManagers . put ( contextId , manager ) ; } return manager ; } | Gets the context user auth manager for a given context . |
20,621 | public List < User > getUIConfiguredUsers ( int contextId ) { ContextUsersPanel panel = this . userPanelsMap . get ( contextId ) ; if ( panel != null ) { return Collections . unmodifiableList ( panel . getUsersTableModel ( ) . getUsers ( ) ) ; } return null ; } | Gets an unmodifiable view of the users that are currently shown in the UI . |
20,622 | public UsersTableModel getUIConfiguredUsersModel ( int contextId ) { ContextUsersPanel panel = this . userPanelsMap . get ( contextId ) ; if ( panel != null ) { return panel . getUsersTableModel ( ) ; } return null ; } | Gets the model of the users that are currently shown in the UI . |
20,623 | public static FindDialog getDialog ( Window parent , boolean modal ) { if ( parent == null ) { throw new IllegalArgumentException ( "The parent must not be null." ) ; } FindDialog activeDialog = getParentsMap ( ) . get ( parent ) ; if ( activeDialog != null ) { activeDialog . getTxtFind ( ) . requestFocus ( ) ; return ... | Get the FindDialog for the parent if there is one or creates and returns a new one . |
20,624 | private JButton getBtnFind ( ) { if ( btnFind == null ) { btnFind = new JButton ( ) ; btnFind . setText ( Constant . messages . getString ( "edit.find.button.find" ) ) ; btnFind . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent e ) { find ... | This method initializes btnFind |
20,625 | private void highlightAll ( ) { HighlighterManager highlighter = HighlighterManager . getInstance ( ) ; LinkedList < HighlightSearchEntry > highlights = highlighter . getHighlights ( ) ; for ( HighlightSearchEntry entry : highlights ) { highlightEntryParser ( entry ) ; } } | Highlight all search strings from HighlightManager |
20,626 | private void highlightEntryParser ( HighlightSearchEntry entry ) { String text ; int lastPos = 0 ; text = this . getText ( ) ; Highlighter hilite = this . getHighlighter ( ) ; HighlightPainter painter = new DefaultHighlighter . DefaultHighlightPainter ( entry . getColor ( ) ) ; while ( ( lastPos = text . indexOf ( entr... | Highlight all found strings |
20,627 | public void setSelectedInternalItem ( User user ) { User internalUser = null ; int index = getIndexOf ( user ) ; if ( index != - 1 ) { internalUser = getElementAt ( index ) ; } else if ( getSize ( ) > 0 ) { internalUser = getElementAt ( 0 ) ; } setSelectedItemImpl ( internalUser ) ; } | Sets the selected item as the actual internal item with the same id as the provided user . |
20,628 | public int getIndexOf ( Object object ) { int index = tableModel . getUsers ( ) . indexOf ( object ) ; if ( index < 0 && customUsers != null ) return tableModel . getUsers ( ) . size ( ) + ArrayUtils . indexOf ( customUsers , object ) ; return index ; } | Returns the index of the specified element in the model s item list . |
20,629 | public void setMessage ( HttpMessage msg ) { try { if ( script != null ) { script . parseParameters ( this , msg ) ; } } catch ( Exception e ) { extension . handleScriptException ( wrapper , e ) ; } } | Set the current message that this Variant has to scan |
20,630 | public String getParamName ( int index ) { return ( index < params . size ( ) ) ? params . get ( index ) . getName ( ) : null ; } | Support method to get back the name of the n - th parameter |
20,631 | public String getParamValue ( int index ) { return ( index < params . size ( ) ) ? params . get ( index ) . getValue ( ) : null ; } | Support method to get back the value of the n - th parameter |
20,632 | public void addParam ( String name , String value , int type ) { params . add ( new NameValuePair ( type , name , value , params . size ( ) ) ) ; } | Support method to add a new param to this custom variant |
20,633 | public void addParamQuery ( String name , String value ) { addParam ( name , value , NameValuePair . TYPE_QUERY_STRING ) ; } | Support method to add a new QueryString param to this custom variant |
20,634 | public void addParamPost ( String name , String value ) { addParam ( name , value , NameValuePair . TYPE_POST_DATA ) ; } | Support method to add a new PostData param to this custom variant |
20,635 | public void addParamHeader ( String name , String value ) { addParam ( name , value , NameValuePair . TYPE_HEADER ) ; } | Support method to add a new Header param to this custom variant |
20,636 | private String setParameter ( HttpMessage msg , NameValuePair originalPair , String paramName , String value , boolean escaped ) { try { if ( script != null ) { currentParam = originalPair ; script . setParameter ( this , msg , paramName , value , escaped ) ; } } catch ( Exception e ) { extension . handleScriptExceptio... | Inner method for correct scripting |
20,637 | private JButton getBtnAccept ( ) { if ( btnAccept == null ) { btnAccept = new JButton ( ) ; btnAccept . setText ( "Accept" ) ; btnAccept . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent e ) { accepted = true ; LicenseFrame . this . dispos... | This method initializes btnAccept |
20,638 | private JButton getBtnDecline ( ) { if ( btnDecline == null ) { btnDecline = new JButton ( ) ; btnDecline . setText ( "Decline" ) ; btnDecline . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent e ) { accepted = false ; System . exit ( 1 ) ;... | This method initializes btnDecline |
20,639 | public boolean matches ( String versionRange ) throws IllegalArgumentException { Validate . notEmpty ( versionRange , "Parameter versionRange must not be null nor empty." ) ; try { return impl . satisfies ( versionRange ) ; } catch ( com . github . zafarkhaja . semver . ParseException e ) { throw new IllegalArgumentExc... | Tells whether or not the given version range matches this version . |
20,640 | public static boolean isValidVersionRange ( String versionRange ) { try { ExpressionParser . newInstance ( ) . parse ( versionRange ) ; return true ; } catch ( com . github . zafarkhaja . semver . ParseException ignore ) { } return false ; } | Tells whether or not the given version range is valid . |
20,641 | public char getChar ( String key ) { try { String str = this . getStringImpl ( key ) ; if ( str . length ( ) > 0 ) { return str . charAt ( 0 ) ; } } catch ( Exception e ) { } return '\u0000' ; } | Returns the specified char from the language file . As these are typically used for mnemonics the null char is returned if the key is not defined |
20,642 | public static int getIntParam ( JSONObject params , String paramName ) throws ApiException { if ( ! params . containsKey ( paramName ) ) { throw new ApiException ( ApiException . Type . MISSING_PARAMETER , paramName ) ; } try { return params . getInt ( paramName ) ; } catch ( JSONException e ) { throw new ApiException ... | Gets the int param with a given name and throws an exception accordingly if not found or valid . |
20,643 | public static boolean getBooleanParam ( JSONObject params , String paramName ) throws ApiException { if ( ! params . containsKey ( paramName ) ) { throw new ApiException ( ApiException . Type . MISSING_PARAMETER , paramName ) ; } try { return params . getBoolean ( paramName ) ; } catch ( JSONException e ) { throw new A... | Gets a boolean from the parameter with the given name . |
20,644 | public static String getOptionalStringParam ( JSONObject params , String paramName ) { if ( params . containsKey ( paramName ) ) { return params . getString ( paramName ) ; } return null ; } | Gets an optional string param returning null if the parameter was not found . |
20,645 | public static String getNonEmptyStringParam ( JSONObject params , String paramName ) throws ApiException { if ( ! params . containsKey ( paramName ) ) { throw new ApiException ( Type . MISSING_PARAMETER , paramName ) ; } String value = params . getString ( paramName ) ; if ( value == null || value . isEmpty ( ) ) { thr... | Gets the non empty string param with a given name and throws an exception accordingly if not found or empty . |
20,646 | private void initialize ( ) { this . setText ( Constant . messages . getString ( "sites.resend.popup" ) ) ; this . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent evt ) { if ( treeSite != null ) { SiteNode node = ( SiteNode ) treeSite . ge... | This method initialises this |
20,647 | private JButton getBtnApply ( ) { if ( btnApply == null ) { btnApply = new JButton ( ) ; btnApply . setText ( Constant . messages . getString ( "history.filter.button.apply" ) ) ; btnApply . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent ... | This method initializes btnApply |
20,648 | private JButton getBtnReset ( ) { if ( btnReset == null ) { btnReset = new JButton ( ) ; btnReset . setText ( Constant . messages . getString ( "history.filter.button.clear" ) ) ; btnReset . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent ... | This method initializes btnReset |
20,649 | public void run ( ) { log . debug ( "HostProcess.run" ) ; try { hostProcessStartTime = System . currentTimeMillis ( ) ; pluginFactory . reset ( ) ; synchronized ( mapPluginStats ) { for ( Plugin plugin : pluginFactory . getPending ( ) ) { mapPluginStats . put ( plugin . getId ( ) , new PluginStats ( plugin . getName ( ... | Main execution method |
20,650 | public boolean isStop ( ) { if ( this . scannerParam . getMaxScanDurationInMins ( ) > 0 ) { if ( System . currentTimeMillis ( ) - this . hostProcessStartTime > TimeUnit . MINUTES . toMillis ( this . scannerParam . getMaxScanDurationInMins ( ) ) ) { this . stopReason = Constant . messages . getString ( "ascan.progress.l... | Check if the current host scan has been stopped |
20,651 | HttpRequestConfig getRedirectRequestConfig ( ) { if ( redirectRequestConfig == null ) { redirectRequestConfig = HttpRequestConfig . builder ( ) . setRedirectionValidator ( getRedirectionValidator ( ) ) . build ( ) ; } return redirectRequestConfig ; } | Gets the HTTP request configuration that ensures the followed redirections are in scan s scope . |
20,652 | HttpRedirectionValidator getRedirectionValidator ( ) { if ( redirectionValidator == null ) { redirectionValidator = redirection -> { if ( ! nodeInScope ( redirection . getEscapedURI ( ) ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Skipping redirection out of scan's scope: " + redirection ) ; } return false ; ... | Gets the redirection validator that ensures the followed redirections are in scan s scope . |
20,653 | public String getSkippedReason ( Plugin plugin ) { PluginStats pluginStats = mapPluginStats . get ( plugin . getId ( ) ) ; if ( pluginStats == null ) { return stopReason ; } return pluginStats . getSkippedReason ( ) ; } | Gets the reason why the given plugin was skipped . |
20,654 | void pluginCompleted ( Plugin plugin ) { PluginStats pluginStats = mapPluginStats . get ( plugin . getId ( ) ) ; if ( pluginStats == null ) { return ; } StringBuilder sb = new StringBuilder ( ) ; if ( isStop ( ) ) { sb . append ( "stopped host/plugin " ) ; } else if ( pluginStats . isSkipped ( ) ) { sb . append ( "skip... | Complete the current plugin and update statistics |
20,655 | public void setUser ( User user ) { this . user = user ; if ( httpSender != null ) { httpSender . setUser ( user ) ; } } | Set the user to scan as . If null then the current session will be used . |
20,656 | public int getPluginRequestCount ( int pluginId ) { PluginStats pluginStats = mapPluginStats . get ( pluginId ) ; if ( pluginStats != null ) { return pluginStats . getMessageCount ( ) ; } return 0 ; } | Gets the request count of the plugin with the given ID . |
20,657 | private void addPanelForContext ( Context context , ContextPanelFactory contextPanelFactory , String [ ] panelPath ) { AbstractContextPropertiesPanel panel = contextPanelFactory . getContextPanel ( context ) ; panel . setSessionDialog ( getSessionDialog ( ) ) ; getSessionDialog ( ) . addParamPanel ( panelPath , panel ,... | Adds a custom context panel for the given context created form the given context panel factory and placed under the given path . |
20,658 | private void parseArray ( String fieldName ) { int chr ; int idx = 0 ; while ( true ) { sr . skipWhitespaceRead ( ) ; sr . unreadLastCharacter ( ) ; parseValue ( fieldName + "[" + ( idx ++ ) + "]" ) ; chr = sr . skipWhitespaceRead ( ) ; if ( chr == END_ARRAY ) { break ; } if ( chr != VALUE_SEPARATOR ) { throw new Illeg... | Read a JSON array |
20,659 | public void addScanResult ( String uri , String method , String flags , boolean skipped ) { SpiderScanResult result = new SpiderScanResult ( uri , method , flags , ! skipped ) ; scanResults . add ( result ) ; fireTableRowsInserted ( scanResults . size ( ) - 1 , scanResults . size ( ) - 1 ) ; } | Adds a new spider scan result . Method is synchronized internally . |
20,660 | public static void mergeNodeChildren ( TreeNode node ) { DefaultMutableTreeNode masterNode = ( DefaultMutableTreeNode ) node ; for ( int i = 0 ; i < masterNode . getChildCount ( ) ; i ++ ) { DefaultMutableTreeNode child = ( DefaultMutableTreeNode ) masterNode . getChildAt ( i ) ; if ( ! child . isLeaf ( ) ) { MergeHelp... | this class instead . |
20,661 | private javax . swing . JPanel getPanelCommand ( ) { if ( panelCommand == null ) { panelCommand = new javax . swing . JPanel ( ) ; panelCommand . setLayout ( new java . awt . GridBagLayout ( ) ) ; panelCommand . setName ( "Search Panel" ) ; GridBagConstraints gridBagConstraints1 = new GridBagConstraints ( ) ; GridBagCo... | This method initializes panelCommand |
20,662 | public void setMessage ( String data , boolean isSecure ) throws HttpMalformedHeaderException { super . setMessage ( data ) ; try { parse ( isSecure ) ; } catch ( HttpMalformedHeaderException e ) { mMalformedHeader = true ; if ( log . isDebugEnabled ( ) ) { log . debug ( "Malformed header: " + data , e ) ; } throw e ; ... | Set this request header with the given message . |
20,663 | public void setURI ( URI uri ) throws URIException { if ( uri . getScheme ( ) == null || uri . getScheme ( ) . equals ( "" ) ) { mUri = new URI ( HTTP + "://" + getHeader ( HOST ) + "/" + mUri . toString ( ) , true ) ; } else { mUri = uri ; } if ( uri . getScheme ( ) . equalsIgnoreCase ( HTTPS ) ) { mIsSecure = true ; ... | Sets the URI of this request header . |
20,664 | public void setSecure ( boolean isSecure ) throws URIException { mIsSecure = isSecure ; if ( mUri == null ) { return ; } URI newUri = mUri ; if ( isSecure ( ) && mUri . getScheme ( ) . equalsIgnoreCase ( HTTP ) ) { newUri = new URI ( mUri . toString ( ) . replaceFirst ( HTTP , HTTPS ) , true ) ; } else if ( ! isSecure ... | Sets whether or not the request is done using a secure scheme HTTPS . |
20,665 | private void parse ( boolean isSecure ) throws URIException , HttpMalformedHeaderException { mIsSecure = isSecure ; Matcher matcher = patternRequestLine . matcher ( mStartLine ) ; if ( ! matcher . find ( ) ) { mMalformedHeader = true ; throw new HttpMalformedHeaderException ( "Failed to find pattern " + patternRequestL... | Parse this request header . |
20,666 | public String getHostName ( ) { String hostName = mHostName ; try { hostName = ( ( mUri . getHost ( ) != null ) ? mUri . getHost ( ) : mHostName ) ; } catch ( URIException e ) { if ( log . isDebugEnabled ( ) ) { log . warn ( e ) ; } } return hostName ; } | Get the host name in this request header . |
20,667 | public boolean isImage ( ) { if ( getURI ( ) == null ) { return false ; } try { final String path = getURI ( ) . getPath ( ) ; if ( path != null ) { return ( patternImage . matcher ( path ) . find ( ) ) ; } } catch ( URIException e ) { log . error ( e . getMessage ( ) , e ) ; } return false ; } | Return if this request header is a image request basing on the path suffix . |
20,668 | public void setGetParams ( TreeSet < HtmlParameter > getParams ) { if ( mUri == null ) { return ; } if ( getParams . isEmpty ( ) ) { try { mUri . setQuery ( "" ) ; } catch ( URIException e ) { log . error ( e . getMessage ( ) , e ) ; } return ; } StringBuilder sbQuery = new StringBuilder ( ) ; for ( HtmlParameter param... | Based on getParams |
20,669 | public void setCookieParams ( TreeSet < HtmlParameter > cookieParams ) { if ( cookieParams . isEmpty ( ) ) { setHeader ( HttpHeader . COOKIE , null ) ; } StringBuilder sbData = new StringBuilder ( ) ; for ( HtmlParameter parameter : cookieParams ) { if ( parameter . getType ( ) != HtmlParameter . Type . cookie ) { cont... | based on cookieParams |
20,670 | public List < HttpCookie > getHttpCookies ( ) { List < HttpCookie > cookies = new LinkedList < > ( ) ; TreeSet < HtmlParameter > ts = getCookieParams ( ) ; Iterator < HtmlParameter > it = ts . iterator ( ) ; while ( it . hasNext ( ) ) { HtmlParameter htmlParameter = it . next ( ) ; if ( ! htmlParameter . getName ( ) . ... | Gets a list of the http cookies from this request Header . |
20,671 | private JButton getBtnDelete ( ) { if ( btnDelete == null ) { btnDelete = new JButton ( ) ; btnDelete . setText ( Constant . messages . getString ( "history.managetags.button.delete" ) ) ; btnDelete . setMinimumSize ( new java . awt . Dimension ( 75 , 30 ) ) ; btnDelete . setPreferredSize ( new java . awt . Dimension (... | This method initializes btnDelete |
20,672 | private void fetchResource ( HttpMessage msg ) throws IOException { if ( parent . getHttpSender ( ) == null ) { return ; } try { parent . getHttpSender ( ) . sendAndReceive ( msg ) ; } catch ( ConnectException e ) { log . debug ( "Failed to connect to: " + msg . getRequestHeader ( ) . getURI ( ) , e ) ; throw e ; } cat... | Fetches a resource . |
20,673 | private ZapMenuItem getMenuItemCheckUpdate ( ) { if ( menuItemCheckUpdate == null ) { menuItemCheckUpdate = new ZapMenuItem ( "cfu.help.menu.check" , getView ( ) . getMenuShortcutKeyStroke ( KeyEvent . VK_U , 0 , false ) ) ; menuItemCheckUpdate . setText ( Constant . messages . getString ( "cfu.help.menu.check" ) ) ; m... | This method initializes menuItemEncoder |
20,674 | void processAddOnChanges ( Window caller , AddOnDependencyChecker . AddOnChangesResult changes ) { if ( addonsDialog != null ) { addonsDialog . setDownloadingUpdates ( ) ; } if ( getView ( ) != null ) { Set < AddOn > addOns = new HashSet < > ( changes . getUninstalls ( ) ) ; addOns . addAll ( changes . getOldVersions (... | Processes the given add - on changes . |
20,675 | public synchronized String installAddOns ( List < String > addons ) { StringBuilder errorMessages = new StringBuilder ( ) ; AddOnCollection aoc = getLatestVersionInfo ( ) ; if ( aoc == null ) { String error = Constant . messages . getString ( "cfu.cmdline.nocfu" ) ; errorMessages . append ( error ) ; CommandLine . erro... | Installs the specified add - ons |
20,676 | public synchronized String uninstallAddOns ( List < String > addons ) { StringBuilder errorMessages = new StringBuilder ( ) ; AddOnCollection aoc = this . getLocalVersionInfo ( ) ; if ( aoc == null ) { String error = Constant . messages . getString ( "cfu.cmdline.nocfu" ) ; errorMessages . append ( error ) ; CommandLin... | Uninstalls the specified add - ons |
20,677 | public void removeToolBarComponent ( Component component ) { validateComponentNonNull ( component ) ; getToolbar ( ) . remove ( component ) ; getToolbar ( ) . validate ( ) ; getToolbar ( ) . repaint ( ) ; } | Removes the given component to the tool bar . |
20,678 | public void setMaximumSearchResultsGUI ( int maximumSearchResultsGUI ) { if ( this . maximumSearchResultsGUI != maximumSearchResultsGUI ) { this . maximumSearchResultsGUI = maximumSearchResultsGUI ; getConfig ( ) . setProperty ( PARAM_MAXIMUM_RESULTS_GUI , maximumSearchResultsGUI ) ; } } | Sets whether the number of maximum results that should be shown in the results panel . |
20,679 | public void generateAPIFiles ( List < ApiImplementor > implementors ) throws IOException { this . generateWikiIndex ( ) ; for ( ApiImplementor imp : implementors ) { this . generateAPIFiles ( imp ) ; } this . methods = 0 ; this . generateWikiFull ( ) ; System . out . println ( "Generated a total of " + methods + " meth... | Generates the wiki files of the given API implementors . |
20,680 | private void loadSesssionManagementMethodTypes ( ExtensionHook extensionHook ) { this . sessionManagementMethodTypes = new ArrayList < > ( ) ; this . sessionManagementMethodTypes . add ( new CookieBasedSessionManagementMethodType ( ) ) ; this . sessionManagementMethodTypes . add ( new HttpAuthSessionManagementMethodTyp... | Loads session management method types and hooks them up . |
20,681 | public SessionManagementMethodType getSessionManagementMethodTypeForIdentifier ( int id ) { for ( SessionManagementMethodType t : getSessionManagementMethodTypes ( ) ) if ( t . getUniqueIdentifier ( ) == id ) return t ; return null ; } | Gets the session management method type for a given identifier . |
20,682 | protected static boolean uninstallAddOnExtension ( AddOn addOn , Extension extension , AddOnUninstallationProgressCallback callback ) { boolean uninstalledWithoutErrors = true ; if ( extension . isEnabled ( ) ) { String extUiName = extension . getUIName ( ) ; if ( extension . canUnload ( ) ) { logger . debug ( "Unloadi... | Uninstalls the given extension . |
20,683 | public static boolean uninstallAddOnFiles ( AddOn addOn , AddOnUninstallationProgressCallback callback ) { return uninstallAddOnFiles ( addOn , callback , null ) ; } | Uninstalls the files of the given add - on . |
20,684 | public int start ( ) { NullAppender na = new NullAppender ( ) ; Logger . getRootLogger ( ) . addAppender ( na ) ; Logger . getRootLogger ( ) . setLevel ( Level . OFF ) ; Logger . getLogger ( ConfigurationUtils . class ) . addAppender ( na ) ; Logger . getLogger ( DefaultFileSystem . class ) . addAppender ( na ) ; try {... | Starts the bootstrap process . |
20,685 | protected static String getStartingMessage ( ) { DateFormat dateFormat = SimpleDateFormat . getDateTimeInstance ( DateFormat . SHORT , DateFormat . MEDIUM ) ; StringBuilder strBuilder = new StringBuilder ( 200 ) ; strBuilder . append ( Constant . PROGRAM_NAME ) . append ( ' ' ) . append ( Constant . PROGRAM_VERSION ) ;... | Gets ZAP s starting message . |
20,686 | protected ContextSelectComboBox getContextSelectComboBox ( ) { if ( contextSelectBox == null ) { contextSelectBox = new ContextSelectComboBox ( ) ; contextSelectBox . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { contextSelected ( ( Context ) contextSelectBox . getSelected... | Gets the Context select combo box . |
20,687 | public static String encode ( Serializable o ) { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; try { ObjectOutputStream oos = new ObjectOutputStream ( bos ) ; try { oos . writeObject ( o ) ; oos . flush ( ) ; } finally { oos . close ( ) ; } return Base64 . encodeBytes ( bos . toByteArray ( ) ) ; } catch (... | encode a object to a base64 string |
20,688 | @ SuppressWarnings ( "unchecked" ) public static < T > T decode ( String base64 ) { try { byte [ ] b = Base64 . decode ( base64 ) ; ByteArrayInputStream bais = new ByteArrayInputStream ( b ) ; ObjectInputStream ois = new ObjectInputStream ( bais ) ; return ( T ) ois . readObject ( ) ; } catch ( IOException | ClassNotFo... | decode a base64 string to a object |
20,689 | private JScrollPane getPaneScroll ( ) { if ( paneScroll == null ) { paneScroll = new JScrollPane ( ) ; paneScroll . setName ( "paneScroll" ) ; paneScroll . setViewportView ( getTreeAlert ( ) ) ; } return paneScroll ; } | This method initializes paneScroll |
20,690 | public javax . swing . JMenu getMenuImport ( ) { if ( menuImport == null ) { menuImport = new javax . swing . JMenu ( ) ; menuImport . setText ( Constant . messages . getString ( "menu.import" ) ) ; menuImport . setMnemonic ( Constant . messages . getChar ( "menu.import.mnemonic" ) ) ; } return menuImport ; } | This method initializes menuImport |
20,691 | private ZapMenuItem getMenuFileProperties ( ) { if ( menuFileProperties == null ) { menuFileProperties = new ZapMenuItem ( "menu.file.properties" , View . getSingleton ( ) . getMenuShortcutKeyStroke ( KeyEvent . VK_P , KeyEvent . ALT_DOWN_MASK , false ) ) ; menuFileProperties . setText ( Constant . messages . getString... | This method initializes menuFileProperties |
20,692 | public JMenu getMenuHelp ( ) { if ( menuHelp == null ) { menuHelp = new JMenu ( ) ; menuHelp . setText ( Constant . messages . getString ( "menu.help" ) ) ; menuHelp . setMnemonic ( Constant . messages . getChar ( "menu.help.mnemonic" ) ) ; menuHelp . add ( getMenuHelpAbout ( ) ) ; menuHelp . add ( getMenuHelpSupport (... | This method initializes menuHelp |
20,693 | private ZapMenuItem getMenuHelpAbout ( ) { if ( menuHelpAbout == null ) { menuHelpAbout = new ZapMenuItem ( "menu.help.about" ) ; menuHelpAbout . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerformed ( java . awt . event . ActionEvent e ) { AboutDialog dialog = new AboutDialog ( ... | This method initializes menuHelpAbout |
20,694 | public JMenu getMenuAnalyse ( ) { if ( menuAnalyse == null ) { menuAnalyse = new JMenu ( ) ; menuAnalyse . setText ( Constant . messages . getString ( "menu.analyse" ) ) ; menuAnalyse . setMnemonic ( Constant . messages . getChar ( "menu.analyse.mnemonic" ) ) ; } return menuAnalyse ; } | This method initializes jMenu1 |
20,695 | public PassiveScanner getScanner ( int pluginId ) { for ( PassiveScanner scanner : passiveScanners ) { if ( scanner instanceof PluginPassiveScanner ) { if ( ( ( PluginPassiveScanner ) scanner ) . getPluginId ( ) == pluginId ) { return scanner ; } } } return null ; } | Returns the PassiveScan rule with the given id |
20,696 | public static ContentMatcher getInstance ( InputStream xmlInputStream ) { ContentMatcher cm = new ContentMatcher ( ) ; try { cm . loadXMLPatternDefinitions ( xmlInputStream ) ; } catch ( JDOMException | IOException ex ) { throw new IllegalArgumentException ( "Failed to initialize the ContentMatcher object using that st... | Direct method for a complete ContentMatcher instance creation . |
20,697 | public String findInContent ( String content ) { for ( BoyerMooreMatcher matcher : strings ) { if ( matcher . findInContent ( content ) >= 0 ) return matcher . getPattern ( ) ; } Matcher matcher ; for ( Pattern pattern : patterns ) { matcher = pattern . matcher ( content ) ; if ( matcher . find ( ) ) { return matcher .... | Search for an occurrence inside a specific content |
20,698 | public List < String > findAllInContent ( String content ) { List < String > results = new LinkedList < String > ( ) ; for ( BoyerMooreMatcher matcher : strings ) { if ( matcher . findInContent ( content ) >= 0 ) results . add ( matcher . getPattern ( ) ) ; } Matcher matcher ; for ( Pattern pattern : patterns ) { match... | Search for all possible occurrences inside a specific content |
20,699 | public void sendAndReceive ( HttpMessage msg , boolean isFollowRedirect ) throws IOException { log . debug ( "sendAndReceive " + msg . getRequestHeader ( ) . getMethod ( ) + " " + msg . getRequestHeader ( ) . getURI ( ) + " start" ) ; msg . setTimeSentMillis ( System . currentTimeMillis ( ) ) ; try { notifyRequestListe... | Send and receive a HttpMessage . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.