idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
20,400 | private void saveClientCertSettings ( ) { if ( getBoolean ( PERSIST_CLIENT_CERT , false ) ) { logger . warn ( "Saving Client Certificate settings: password will be found in config" ) ; setUseClientCert ( getBoolean ( USE_CLIENT_CERT , false ) ) ; setClientCertLocation ( getString ( CLIENT_CERT_LOCATION , "" ) ) ; setCl... | Saves the client cert settings if the flag is set explicitly . Only works for the CLI currently . |
20,401 | private void clientCertCheck ( ) { boolean enableClientCert = getBoolean ( USE_CLIENT_CERT , false ) ; String certPath = getString ( CLIENT_CERT_LOCATION , "" ) ; String certPass = getString ( CLIENT_CERT_PASSWORD , "" ) ; int certIndex = getInt ( CLIENT_CERT_INDEX , 0 ) ; if ( enableClientCert && ! certPath . isEmpty ... | Enables ClientCertificate from - config CLI parameters Requires location password and a flag to use client certificate . |
20,402 | public List < BreakpointMessageInterface > getBreakpointsEnabledList ( ) { if ( mode . equals ( Mode . safe ) ) { return new ArrayList < > ( ) ; } return getBreakpointsModel ( ) . getBreakpointsEnabledList ( ) ; } | Exposes list of enabled breakpoints . |
20,403 | public int findInContent ( String content ) { int n = content . length ( ) ; int m = pattern . length ( ) ; int skip ; char val ; for ( int i = 0 ; i <= n - m ; i = i + skip ) { skip = 0 ; for ( int j = m - 1 ; j >= 0 ; j -- ) { if ( pattern . charAt ( j ) != content . charAt ( i + j ) ) { val = content . charAt ( i + ... | Returns the index within this string of the first occurrence of the specified substring . If it is not a substring return - 1 . |
20,404 | private ExtensionSpider getExtensionSpider ( ) { if ( extension == null ) { extension = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionSpider . class ) ; } return extension ; } | Gets the extension spider . |
20,405 | public Component getTableCellEditorComponent ( JTable table , Object value , boolean isSelected , int rowIndex , int vColIndex ) { if ( isSelected ) { } button . setText ( ( String ) value ) ; row = rowIndex ; return button ; } | This method is called when a cell value is edited by the user . |
20,406 | public void setScanHeadersAllRequests ( boolean scanAllRequests ) { if ( scanAllRequests == scanHeadersAllRequests ) { return ; } this . scanHeadersAllRequests = scanAllRequests ; getConfig ( ) . setProperty ( SCAN_HEADERS_ALL_REQUESTS , this . scanHeadersAllRequests ) ; } | Sets whether or not the HTTP Headers of all requests should be scanned not just requests that send parameters through the query or request body . |
20,407 | public static void removeAllSeparators ( JPopupMenu popupMenu ) { for ( int i = 0 ; i < popupMenu . getComponentCount ( ) ; i ++ ) { if ( isPopupMenuSeparator ( popupMenu . getComponent ( i ) ) ) { popupMenu . remove ( i ) ; i -- ; } } } | Removes all separators from the given pop up menu . |
20,408 | public static boolean addSeparatorIfNeeded ( JPopupMenu popupMenu ) { final int menuComponentCount = popupMenu . getComponentCount ( ) ; if ( menuComponentCount == 0 ) { return false ; } final Component lastMenuComponent = popupMenu . getComponent ( menuComponentCount - 1 ) ; if ( isPopupMenuSeparator ( lastMenuCompone... | Appends a separator to the end of the menu if it exists at least one non separator menu component immediately before and if there isn t already a separator at the end of the menu . |
20,409 | public List < Integer > getHistoryIdsOfHistType ( long sessionId , int ... histTypes ) throws DatabaseException { return getHistoryIdsByParams ( sessionId , 0 , true , histTypes ) ; } | Gets all the history record IDs of the given session and with the given history types . |
20,410 | public Context getContext ( ) { if ( context == null ) { context = Model . getSingleton ( ) . getSession ( ) . getContext ( this . contextId ) ; } return context ; } | Lazy loader for getting the context to which this user corresponds . |
20,411 | public void authenticate ( ) { log . info ( "Authenticating user: " + this . name ) ; WebSession result = null ; try { result = getContext ( ) . getAuthenticationMethod ( ) . authenticate ( getContext ( ) . getSessionManagementMethod ( ) , this . authenticationCredentials , this ) ; } catch ( UnsupportedAuthenticationC... | Authenticates the user using its authentication credentials and the authentication method corresponding to its Context . |
20,412 | private static ExtensionAuthentication getAuthenticationExtension ( ) { if ( extensionAuth == null ) { extensionAuth = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionAuthentication . class ) ; } return extensionAuth ; } | Gets a reference to the authentication extension . |
20,413 | public static String encode ( User user ) { StringBuilder out = new StringBuilder ( ) ; out . append ( user . id ) . append ( FIELD_SEPARATOR ) ; out . append ( user . isEnabled ( ) ) . append ( FIELD_SEPARATOR ) ; out . append ( Base64 . encodeBase64String ( user . name . getBytes ( ) ) ) . append ( FIELD_SEPARATOR ) ... | Encodes the User in a String . Fields that contain strings are Base64 encoded . |
20,414 | private void initContextPanel ( AbstractContextPropertiesPanel contextPanel ) { Context ctx = uiContexts . get ( contextPanel . getContextIndex ( ) ) ; if ( ctx != null ) { contextPanel . initContextData ( session , ctx ) ; } } | Initialises the given panel with the current session and the corresponding UI shared context . |
20,415 | public void recreateUISharedContexts ( Session session ) { uiContexts . clear ( ) ; for ( Context context : session . getContexts ( ) ) { Context uiContext = context . duplicate ( ) ; uiContexts . put ( context . getIndex ( ) , uiContext ) ; } } | Reset the UI shared Context copies . The effect is that previous copies are discarded and new copies are created . |
20,416 | private static boolean hasSameDefaultAccelerator ( KeyboardMapping km , KeyStroke ks ) { KeyStroke kmKs = km . getDefaultKeyStroke ( ) ; if ( kmKs == null ) { return false ; } return kmKs . getKeyCode ( ) == ks . getKeyCode ( ) && kmKs . getModifiers ( ) == ks . getModifiers ( ) ; } | Tells whether or not the given keyboard mapping has the given default accelerator . |
20,417 | private KeyStroke getDefaultAccelerator ( ZapMenuItem menuItem ) { if ( isIdentifierWithDuplicatedAccelerator ( menuItem . getIdentifier ( ) ) ) { return null ; } return menuItem . getDefaultAccelerator ( ) ; } | Gets the default accelerator of the given menu taken into account duplicated default accelerators . |
20,418 | public void setTokenValue ( String tokenName , Cookie value ) { if ( value == null ) { tokenValues . remove ( tokenName ) ; } else { tokenValues . put ( tokenName , value ) ; } } | Sets a particular value for a session token . If the value is null that token is deleted from the session . |
20,419 | public String getTokenValue ( String tokenName ) { Cookie ck = tokenValues . get ( tokenName ) ; if ( ck != null ) { return ck . getValue ( ) ; } return null ; } | Gets the token value . |
20,420 | public String getTokenValuesString ( ) { if ( tokenValues . isEmpty ( ) ) { return "" ; } StringBuilder buf = new StringBuilder ( ) ; for ( Map . Entry < String , Cookie > entry : tokenValues . entrySet ( ) ) { buf . append ( entry . getKey ( ) ) . append ( '=' ) . append ( entry . getValue ( ) . getValue ( ) ) . appen... | Gets the token values string representation . |
20,421 | public final void setBackgroundImage ( URL imageUrl ) { if ( imageUrl != null ) { try { img = ImageIO . read ( imageUrl ) ; } catch ( IOException ioe ) { } } } | set the current Background image |
20,422 | protected void paintComponent ( Graphics g ) { if ( img != null ) { setOpaque ( false ) ; Map < RenderingHints . Key , Object > hints = new HashMap < RenderingHints . Key , Object > ( ) ; hints . put ( RenderingHints . KEY_INTERPOLATION , RenderingHints . VALUE_INTERPOLATION_BICUBIC ) ; hints . put ( RenderingHints . K... | Overridden method to paint a background before the rest |
20,423 | protected boolean handleCmdLineSessionArgsSynchronously ( Control control ) { if ( getArgs ( ) . isEnabled ( CommandLine . SESSION ) && getArgs ( ) . isEnabled ( CommandLine . NEW_SESSION ) ) { System . err . println ( "Error: Invalid command line options: option '" + CommandLine . SESSION + "' not allowed with option ... | Handles command line session related arguments synchronously . |
20,424 | protected void warnAddOnsAndExtensionsNoLongerRunnable ( ) { final AddOnLoader addOnLoader = ExtensionFactory . getAddOnLoader ( ) ; List < String > idsAddOnsNoLongerRunning = addOnLoader . getIdsAddOnsWithRunningIssuesSinceLastRun ( ) ; if ( idsAddOnsNoLongerRunning . isEmpty ( ) ) { return ; } List < AddOn > addOnsNo... | Warns through logging about add - ons and extensions that are no longer runnable because of changes in its dependencies . |
20,425 | private boolean isCertExpired ( X509Certificate cert ) { if ( cert != null && cert . getNotAfter ( ) . before ( new Date ( ) ) ) { return true ; } return false ; } | Returns true if the certificate expired before the current date otherwise false . |
20,426 | private void warnRooCaCertExpired ( ) { X509Certificate cert = getRootCaCertificate ( ) ; if ( cert == null ) { return ; } String warnMsg = Constant . messages . getString ( "dynssl.warn.cert.expired" , cert . getNotAfter ( ) . toString ( ) , new Date ( ) . toString ( ) ) ; if ( View . isInitialised ( ) ) { getView ( )... | Displays a warning dialog and logs a warning message if ZAPs Root CA certificate has expired . |
20,427 | protected JComboBox < AuthenticationMethodType > getAuthenticationMethodsComboBox ( ) { if ( authenticationMethodsComboBox == null ) { Vector < AuthenticationMethodType > methods = new Vector < > ( extension . getAuthenticationMethodTypes ( ) ) ; authenticationMethodsComboBox = new JComboBox < > ( methods ) ; authentic... | Gets the authentication method types combo box . |
20,428 | private boolean confirmAndResetUsersCredentials ( AuthenticationMethodType type ) { ExtensionUserManagement usersExtension = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionUserManagement . class ) ; if ( usersExtension == null ) { return true ; } List < User > users = usersExtension . get... | Make sure the user acknowledges the Users corresponding to this context will have the credentials changed with the new type of authentication method . |
20,429 | public String getString ( String key ) { Object obj = get ( key ) ; if ( obj != null && obj instanceof String ) { return ( String ) obj ; } return null ; } | Get the first item in KB matching the key as a String . |
20,430 | public synchronized boolean stopServer ( ) { if ( ! isProxyRunning ) { return false ; } isProxyRunning = false ; HttpUtil . closeServerSocket ( proxySocket ) ; try { thread . join ( ) ; } catch ( Exception e ) { } proxySocket = null ; return true ; } | Stops the proxy server . |
20,431 | private ZapMenuItem getMenuItemPolicy ( ) { if ( menuItemPolicy == null ) { menuItemPolicy = new ZapMenuItem ( "menu.analyse.scanPolicy" , getView ( ) . getMenuShortcutKeyStroke ( KeyEvent . VK_P , 0 , false ) ) ; menuItemPolicy . addActionListener ( new java . awt . event . ActionListener ( ) { public void actionPerfo... | This method initializes menuItemPolicy |
20,432 | public void showCustomScanDialog ( Target target ) { if ( customScanDialog == null ) { String [ ] tabs = CustomScanDialog . STD_TAB_LABELS ; if ( this . customScanPanels . size ( ) > 0 ) { List < String > tabList = new ArrayList < String > ( ) ; for ( String str : CustomScanDialog . STD_TAB_LABELS ) { tabList . add ( s... | Shows the active scan dialogue with the given target if not already visible . |
20,433 | protected void readResponseBody ( HttpState state , HttpConnection conn ) throws HttpException , IOException { LOG . trace ( "enter HeadMethod.readResponseBody(HttpState, HttpConnection)" ) ; int bodyCheckTimeout = getParams ( ) . getIntParameter ( HttpMethodParams . HEAD_BODY_CHECK_TIMEOUT , - 1 ) ; if ( bodyCheckTime... | Implementation copied from HeadMethod . |
20,434 | public void clearFields ( ) { this . requiredFields = NO_FIELDS ; this . optionalFields = NO_FIELDS ; this . textFields = Collections . emptyMap ( ) ; removeAll ( ) ; validate ( ) ; } | Clears all the fields leaving an empty panel . |
20,435 | public Map < String , String > getFieldValues ( ) { Map < String , String > values = new HashMap < > ( requiredFields . length + optionalFields . length ) ; for ( Entry < String , ZapTextField > f : textFields . entrySet ( ) ) values . put ( f . getKey ( ) , f . getValue ( ) . getText ( ) ) ; return values ; } | Gets a mapping of the field names to the configured field values . |
20,436 | public void validateFields ( ) throws IllegalStateException { for ( String rf : requiredFields ) if ( textFields . get ( rf ) . getText ( ) . trim ( ) . isEmpty ( ) ) { textFields . get ( rf ) . requestFocusInWindow ( ) ; throw new IllegalStateException ( Constant . messages . getString ( "authentication.method.script.... | Validate the fields of the panel checking that all the required fields has been filled . If any of the fields are not in the proper state an IllegalStateException is thrown containing a message describing the problem . |
20,437 | private ZapTextArea getTxtOutput ( ) { if ( txtOutput == null ) { txtOutput = new ZapTextArea ( ) ; txtOutput . setEditable ( false ) ; txtOutput . setLineWrap ( true ) ; txtOutput . setName ( "" ) ; txtOutput . addMouseListener ( new java . awt . event . MouseAdapter ( ) { public void mousePressed ( java . awt . event... | This method initializes txtOutput |
20,438 | private JPanel getJPanelBottom ( ) { if ( jPanelBottom == null ) { GridBagConstraints gridBagConstraints2 = new GridBagConstraints ( ) ; gridBagConstraints2 . insets = new java . awt . Insets ( 5 , 3 , 5 , 5 ) ; gridBagConstraints2 . gridy = 0 ; gridBagConstraints2 . anchor = java . awt . GridBagConstraints . EAST ; gr... | This method initializes jPanelBottom |
20,439 | private JButton getBtnClose ( ) { if ( btnClose == null ) { btnClose = new JButton ( ) ; btnClose . setText ( "Close" ) ; btnClose . setVisible ( false ) ; btnClose . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent arg0 ) { stop ( ) ; } } ) ; } return btnClose ; } | This method initializes jButton1 |
20,440 | private JTextPane getTxtLicense ( ) { if ( txtLicense == null ) { txtLicense = new JTextPane ( ) ; txtLicense . setName ( "txtLicense" ) ; txtLicense . setEditable ( false ) ; } return txtLicense ; } | This method initializes txtLicense |
20,441 | public boolean isToExclude ( HttpMessage msg , NameValuePair param ) { return ( ( paramType == NameValuePair . TYPE_UNDEFINED ) || ( param . getType ( ) == paramType ) ) && ( ( urlPattern == null ) || urlPattern . matcher ( msg . getRequestHeader ( ) . getURI ( ) . toString ( ) . toUpperCase ( Locale . ROOT ) ) . match... | Check if the parameter should be excluded by the scanner |
20,442 | public JTree getTreeSite ( ) { if ( treeSite == null ) { treeSite = new JTree ( new DefaultTreeModel ( new DefaultMutableTreeNode ( ) ) ) ; treeSite . setShowsRootHandles ( true ) ; treeSite . setName ( "treeSite" ) ; treeSite . setToggleClickCount ( 1 ) ; LookAndFeel laf = UIManager . getLookAndFeel ( ) ; if ( laf != ... | This method initializes treeSite |
20,443 | public int getProgressPercentage ( ) { if ( isRunning ( ) ) { int progress = ( hProcess . getTestCurrentCount ( plugin ) * 100 ) / hProcess . getTestTotalCount ( ) ; return progress >= 100 ? 99 : progress ; } else if ( isCompleted ( ) || isSkipped ( ) ) { return 100 ; } else { return 0 ; } } | Get back the percentage of completion . |
20,444 | void refresh ( ) { if ( isCompleted ( ) ) { return ; } if ( hProcess . getCompleted ( ) . contains ( plugin ) ) { status = STATUS_COMPLETED ; } else if ( hProcess . getRunning ( ) . contains ( plugin ) ) { status = STATUS_RUNNING ; } } | Refresh the state of this scan progress item . |
20,445 | protected void parse ( ) { maximumInstances = getInt ( PARAM_MAXIMUM_INSTANCES , DEFAULT_MAXIMUM_INSTANCES ) ; mergeRelatedIssues = getBoolean ( PARAM_MERGE_RELATED_ISSUES , true ) ; overridesFilename = getString ( PARAM_OVERRIDES_FILENAME , "" ) ; } | Parses the alert options . |
20,446 | public void setMaximumInstances ( int maximumInstances ) { int newValue = maximumInstances < 0 ? 0 : maximumInstances ; if ( this . maximumInstances != newValue ) { this . maximumInstances = newValue ; getConfig ( ) . setProperty ( PARAM_MAXIMUM_INSTANCES , this . maximumInstances ) ; } } | Sets the maximum instances of an alert to include in a report . |
20,447 | AlertPanel getAlertPanel ( ) { if ( alertPanel == null ) { alertPanel = new AlertPanel ( this ) ; alertPanel . setSize ( 345 , 122 ) ; setMainTreeModel ( ) ; } return alertPanel ; } | This method initializes alertPanel |
20,448 | public void showAlertEditDialog ( Alert alert ) { if ( dialogAlertAdd == null || ! dialogAlertAdd . isVisible ( ) ) { dialogAlertAdd = new AlertAddDialog ( getView ( ) . getMainFrame ( ) , false ) ; dialogAlertAdd . setVisible ( true ) ; dialogAlertAdd . setAlert ( alert ) ; } } | Shows the Edit Alert dialogue with the given alert . |
20,449 | public static String toHexString ( byte [ ] b ) { if ( null == b ) return null ; int len = b . length ; byte [ ] hex = new byte [ len << 1 ] ; for ( int i = 0 , j = 0 ; i < len ; i ++ , j += 2 ) { hex [ j ] = ( byte ) ( ( b [ i ] & 0xF0 ) >> 4 ) ; hex [ j ] += 10 > hex [ j ] ? 48 : 87 ; hex [ j + 1 ] = ( byte ) ( b [ i... | Converts a byte array into a hexadecimal String . |
20,450 | public static String hashSHA ( String str ) { byte [ ] b = str . getBytes ( ) ; MessageDigest md = null ; try { md = MessageDigest . getInstance ( "SHA1" ) ; md . update ( b ) ; } catch ( NoSuchAlgorithmException e ) { e . printStackTrace ( ) ; } return toHexString ( md . digest ( ) ) ; } | Returns the SHA hash of a String . |
20,451 | public static synchronized String rot13 ( String input ) { StringBuffer output = new StringBuffer ( ) ; if ( input != null ) { for ( int i = 0 ; i < input . length ( ) ; i ++ ) { char inChar = input . charAt ( i ) ; if ( ( inChar >= 'A' ) & ( inChar <= 'Z' ) ) { inChar += 13 ; if ( inChar > 'Z' ) { inChar -= 26 ; } } i... | Description of the Method |
20,452 | public void load ( FileConfiguration config ) { this . config = config ; try { parse ( ) ; } catch ( Exception e ) { logger . error ( e . getMessage ( ) , e ) ; } } | Loads the configurations from the given configuration file . |
20,453 | public void load ( String filePath , ControlOverrides overrides ) { try { config = new ZapXmlConfiguration ( filePath ) ; if ( overrides != null ) { for ( Entry < String , String > entry : overrides . getOrderedConfigs ( ) . entrySet ( ) ) { logger . info ( "Setting config " + entry . getKey ( ) + " = " + entry . getVa... | Loads the configurations from the file located at the given path and using the given overrides |
20,454 | protected Element [ ] getElements ( Element base , String childTag ) { NodeList nodeList = base . getElementsByTagName ( childTag ) ; if ( nodeList . getLength ( ) == 0 ) { return null ; } Element [ ] elements = new Element [ nodeList . getLength ( ) ] ; for ( int i = 0 ; i < nodeList . getLength ( ) ; i ++ ) { element... | Get all elements under a base element matching a tag name |
20,455 | private String getText ( Element element ) { try { for ( int i = 0 ; i < element . getChildNodes ( ) . getLength ( ) ; i ++ ) { Node node = element . getChildNodes ( ) . item ( i ) ; if ( node . getNodeType ( ) == Node . TEXT_NODE ) { return node . getNodeValue ( ) ; } } } catch ( Exception e ) { } return "" ; } | Get the text in text node from the element . |
20,456 | protected String getValue ( Element base , String tag ) { Element element = null ; String result = "" ; try { element = getElement ( base , tag ) ; result = getText ( element ) ; } catch ( Exception e ) { } return result ; } | Get the value of the tag under a base element |
20,457 | private ExtensionAuthentication getExtensionAuthentication ( ) { if ( extensionAuth == null ) { extensionAuth = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionAuthentication . class ) ; } return extensionAuth ; } | Gets the authentication extension |
20,458 | private ExtensionUserManagement getExtensionUserManagement ( ) { if ( extensionUsers == null ) { extensionUsers = Control . getSingleton ( ) . getExtensionLoader ( ) . getExtension ( ExtensionUserManagement . class ) ; } return extensionUsers ; } | Gets the Users extension |
20,459 | private boolean parseSource ( HttpMessage message , Source source , int depth , String baseURL ) { log . debug ( "Parsing an HTML message..." ) ; boolean resourcesfound = false ; List < Element > elements = source . getAllElements ( HTMLElementName . A ) ; for ( Element el : elements ) { resourcesfound |= processAttrib... | Parses the HTML Jericho source for the elements that contain references to other resources . |
20,460 | private boolean processAttributeElement ( HttpMessage message , int depth , String baseURL , Element element , String attributeName ) { String localURL = element . getAttributeValue ( attributeName ) ; if ( localURL == null ) { return false ; } processURL ( message , depth , localURL , baseURL ) ; return true ; } | Processes the attribute with the given name of a Jericho element for an URL . If an URL is found notifies the listeners . |
20,461 | public void appendMsg ( final String msg ) { if ( ! EventQueue . isDispatchThread ( ) ) { try { EventQueue . invokeAndWait ( new Runnable ( ) { public void run ( ) { appendMsg ( msg ) ; } } ) ; } catch ( InvocationTargetException e ) { LOGGER . error ( "Failed to append message: " , e ) ; } catch ( InterruptedException... | Append a message to the output window of this splash screen |
20,462 | private void validateTabbed ( int tabIndex ) { if ( ! isTabbed ( ) ) { throw new IllegalArgumentException ( "Not initialised as a tabbed dialog - must use method without tab parameters" ) ; } if ( tabIndex < 0 || tabIndex >= this . tabPanels . size ( ) ) { throw new IllegalArgumentException ( "Invalid tab index: " + ta... | Validates that the dialogue is tabbed and the given tab index is valid . |
20,463 | public void addTableField ( String fieldLabel , JTable field , List < JButton > buttons ) { validateNotTabbed ( ) ; JScrollPane scrollPane = new JScrollPane ( ) ; scrollPane . setVerticalScrollBarPolicy ( JScrollPane . VERTICAL_SCROLLBAR_AS_NEEDED ) ; scrollPane . setViewportView ( field ) ; field . setFillsViewportHei... | Add a table field . |
20,464 | public void setTabsVisible ( String [ ] tabLabels , boolean visible ) { if ( visible ) { for ( String label : tabLabels ) { String name = Constant . messages . getString ( label ) ; JPanel tabPanel = this . tabNameMap . get ( label ) ; tabbedPane . addTab ( name , getTabComponent ( tabPanel ) ) ; } } else { for ( Strin... | Set the visibility of the specified tabs . The labels must have been used to create the tabs in the constructor |
20,465 | public static ValidationResult isValidAddOn ( Path file ) { if ( file == null || file . getNameCount ( ) == 0 ) { return new ValidationResult ( ValidationResult . Validity . INVALID_PATH ) ; } if ( ! isAddOnFileName ( file . getFileName ( ) . toString ( ) ) ) { return new ValidationResult ( ValidationResult . Validity ... | Tells whether or not the given file is a ZAP add - on . |
20,466 | public List < Extension > getLoadedExtensionsWithDeps ( ) { List < String > classnames = getExtensionsWithDeps ( ) ; ArrayList < Extension > loadedExtensions = new ArrayList < > ( extensionsWithDeps . size ( ) ) ; for ( Extension extension : getLoadedExtensions ( ) ) { if ( classnames . contains ( extension . getClass ... | Gets the extensions of this add - on that have dependencies and were loaded . |
20,467 | public List < Extension > getLoadedExtensions ( ) { if ( loadedExtensions == null ) { return Collections . emptyList ( ) ; } return Collections . unmodifiableList ( loadedExtensions ) ; } | Gets the extensions of this add - on that were loaded . |
20,468 | public List < String > getIdsAddOnDependencies ( ) { if ( dependencies == null ) { return Collections . emptyList ( ) ; } List < String > ids = new ArrayList < > ( dependencies . getAddOns ( ) . size ( ) ) ; for ( AddOnDep dep : dependencies . getAddOns ( ) ) { ids . add ( dep . getId ( ) ) ; } return ids ; } | Returns the IDs of the add - ons dependencies an empty collection if none . |
20,469 | public void generateAPIFiles ( List < ApiImplementor > implementors ) throws IOException { for ( ApiImplementor implementor : implementors ) { this . generateAPIFiles ( implementor ) ; } } | Generates the API client files of the given API implementors . |
20,470 | public void setResponseBody ( HttpResponseBody resBody ) { if ( resBody == null ) { throw new IllegalArgumentException ( "The parameter resBody must not be null." ) ; } mResBody = resBody ; getResponseBody ( ) . setCharset ( getResponseHeader ( ) . getCharset ( ) ) ; } | Sets the response body of this message . |
20,471 | private static void validateFormatForViewAction ( Format format ) throws ApiException { switch ( format ) { case JSON : case JSONP : case XML : case HTML : return ; default : throw new ApiException ( ApiException . Type . BAD_FORMAT , "The format OTHER should not be used with views and actions." ) ; } } | Validates that the given format is supported for views and actions . |
20,472 | public void removeCallBackUrls ( ApiImplementor impl ) { if ( impl == null ) { throw new IllegalArgumentException ( "Parameter impl must not be null." ) ; } logger . debug ( "All callbacks removed for " + impl . getClass ( ) . getCanonicalName ( ) ) ; this . callBacks . values ( ) . removeIf ( impl :: equals ) ; } | Removes the given implementor as a callback handler . |
20,473 | public String getOneTimeNonce ( String apiUrl ) { String nonce = Long . toHexString ( random . nextLong ( ) ) ; this . nonces . put ( nonce , new Nonce ( nonce , apiUrl , true ) ) ; return nonce ; } | Returns a one time nonce to be used with the API call specified by the URL |
20,474 | public String getLongLivedNonce ( String apiUrl ) { String nonce = Long . toHexString ( random . nextLong ( ) ) ; this . nonces . put ( nonce , new Nonce ( nonce , apiUrl , false ) ) ; return nonce ; } | Returns a nonce that will be valid for the lifetime of the ZAP process to used with the API call specified by the URL |
20,475 | public void setLoggedInIndicatorPattern ( String loggedInIndicatorPattern ) { if ( loggedInIndicatorPattern == null || loggedInIndicatorPattern . trim ( ) . length ( ) == 0 ) { this . loggedInIndicatorPattern = null ; } else { this . loggedInIndicatorPattern = Pattern . compile ( loggedInIndicatorPattern ) ; } } | Sets the logged in indicator pattern . |
20,476 | public void setLoggedOutIndicatorPattern ( String loggedOutIndicatorPattern ) { if ( loggedOutIndicatorPattern == null || loggedOutIndicatorPattern . trim ( ) . length ( ) == 0 ) { this . loggedOutIndicatorPattern = null ; } else { this . loggedOutIndicatorPattern = Pattern . compile ( loggedOutIndicatorPattern ) ; } } | Sets the logged out indicator pattern . |
20,477 | public boolean isSameType ( AuthenticationMethod other ) { if ( other == null ) return false ; return other . getClass ( ) . equals ( this . getClass ( ) ) ; } | Checks if another method is of the same type . |
20,478 | private void showHiddenTabPopup ( ) { JPopupMenu menu = new JPopupMenu ( ) ; if ( getMousePosition ( ) == null ) { return ; } Collections . sort ( this . hiddenTabs , NAME_COMPARATOR ) ; for ( Component c : this . hiddenTabs ) { if ( c instanceof AbstractPanel ) { final AbstractPanel ap = ( AbstractPanel ) c ; JMenuIte... | Show a popup containing a list of all of the hidden tabs - selecting one will reveal that tab |
20,479 | public void removeTabAt ( int index ) { if ( index < 0 || index >= getTabCount ( ) ) { throw new IndexOutOfBoundsException ( "Index: " + index + ", Tab count: " + getTabCount ( ) ) ; } Component component = getComponentAt ( index ) ; super . removeTabAt ( index ) ; if ( ! ( component instanceof AbstractPanel ) ) { retu... | Removes the tab at the given index and the corresponding panel . |
20,480 | public void setShowTabNames ( boolean showTabNames ) { for ( int i = 0 ; i < getTabCount ( ) ; i ++ ) { String title = showTabNames ? getComponentAt ( i ) . getName ( ) : "" ; setTitleAt ( i , title ) ; } } | Sets whether or not the tab names should be shown . |
20,481 | public final void setUndoManagerPolicy ( UndoManagerPolicy policy ) throws NullPointerException { if ( policy == null ) { throw new NullPointerException ( "The policy must not be null." ) ; } if ( this . policy == policy ) { return ; } final UndoManagerPolicy oldPolicy = this . policy ; this . policy = policy ; if ( ol... | Sets the new policy . |
20,482 | public void addUser ( User user ) { this . users . add ( user ) ; this . fireTableRowsInserted ( this . users . size ( ) - 1 , this . users . size ( ) - 1 ) ; } | Adds a new user to this model |
20,483 | private JCheckBox getChkProxyOnly ( ) { if ( proxyOnlyCheckbox == null ) { proxyOnlyCheckbox = new JCheckBox ( ) ; proxyOnlyCheckbox . setText ( Constant . messages . getString ( "httpsessions.options.label.proxyOnly" ) ) ; } return proxyOnlyCheckbox ; } | Gets the chk proxy only . |
20,484 | private void initialize ( ) { this . setOrder ( EXTENSION_ORDER ) ; this . customParsers = new LinkedList < > ( ) ; this . customFetchFilters = new LinkedList < > ( ) ; this . customParseFilters = new LinkedList < > ( ) ; this . scanController = new SpiderScanController ( this ) ; } | This method initializes this extension . |
20,485 | public void startScanNode ( SiteNode node ) { Target target = new Target ( node ) ; target . setRecurse ( true ) ; this . startScan ( target , null , null ) ; } | Start scan node . |
20,486 | public void startScanAllInScope ( ) { Target target = new Target ( true ) ; target . setRecurse ( true ) ; this . startScan ( target , null , null ) ; } | Start scan all in scope . |
20,487 | public void startScan ( SiteNode startNode ) { Target target = new Target ( startNode ) ; target . setRecurse ( true ) ; this . startScan ( target , null , null ) ; } | Start scan . |
20,488 | public void startScanAllInContext ( Context context , User user ) { Target target = new Target ( context ) ; target . setRecurse ( true ) ; this . startScan ( target , user , null ) ; } | Start scan all in context from the POV of an User . |
20,489 | private String createDisplayName ( Target target , Object [ ] customConfigurations ) { HttpPrefixFetchFilter subtreeFecthFilter = getUriPrefixFecthFilter ( customConfigurations ) ; if ( subtreeFecthFilter != null ) { return abbreviateDisplayName ( subtreeFecthFilter . getNormalisedPrefix ( ) ) ; } if ( target . getCont... | Creates the display name for the given target and optionally the given custom configurations . |
20,490 | public void showSpiderDialog ( Target target ) { if ( spiderDialog == null ) { spiderDialog = new SpiderDialog ( this , View . getSingleton ( ) . getMainFrame ( ) , new Dimension ( 700 , 430 ) ) ; } if ( spiderDialog . isVisible ( ) ) { spiderDialog . toFront ( ) ; return ; } if ( target != null ) { spiderDialog . init... | Shows the spider dialogue with the given target if not already visible . |
20,491 | private JTable getTableFilter ( ) { if ( tableFilter == null ) { tableFilter = new JTable ( ) ; tableFilter . setRowHeight ( DisplayUtils . getScaledSize ( 18 ) ) ; tableFilter . setIntercellSpacing ( new java . awt . Dimension ( 1 , 1 ) ) ; tableFilter . setModel ( getAllFilterTableModel ( ) ) ; for ( int i = 0 ; i < ... | This method initializes tableFilter |
20,492 | private JButton getBtnEnableAll ( ) { if ( btnEnableAll == null ) { btnEnableAll = new JButton ( ) ; btnEnableAll . setText ( Constant . messages . getString ( "filter.button.enableall" ) ) ; btnEnableAll . setEnabled ( false ) ; btnEnableAll . addActionListener ( new java . awt . event . ActionListener ( ) { public vo... | This method initializes btnEnableAll |
20,493 | private JButton getBtnDisableAll ( ) { if ( btnDisableAll == null ) { btnDisableAll = new JButton ( ) ; btnDisableAll . setText ( Constant . messages . getString ( "filter.button.disableall" ) ) ; btnDisableAll . setEnabled ( false ) ; btnDisableAll . addActionListener ( new java . awt . event . ActionListener ( ) { pu... | This method initializes btnDisableAll |
20,494 | public void addPolicyPanel ( AbstractParamPanel panel ) { this . additionalPanels . add ( panel ) ; addParamPanel ( ROOT , panel . getName ( ) , panel , true ) ; } | Adds the given panel positioned under the root node and in alphabetic order . |
20,495 | public PolicyAllCategoryPanel getPolicyAllCategoryPanel ( ) { if ( policyAllCategoryPanel == null ) { policyAllCategoryPanel = new PolicyAllCategoryPanel ( this . pmd , extension , policy ) ; policyAllCategoryPanel . setName ( Constant . messages . getString ( "ascan.policy.title" ) ) ; } return policyAllCategoryPanel ... | This method initializes policyAllCategoryPanel |
20,496 | private static byte [ ] makeRandomChallenge ( final Random random ) throws AuthenticationException { final byte [ ] rval = new byte [ 8 ] ; synchronized ( random ) { random . nextBytes ( rval ) ; } return rval ; } | Calculate a challenge block |
20,497 | private static byte [ ] makeSecondaryKey ( final Random random ) throws AuthenticationException { final byte [ ] rval = new byte [ 16 ] ; synchronized ( random ) { random . nextBytes ( rval ) ; } return rval ; } | Calculate a 16 - byte secondary key |
20,498 | static byte [ ] hmacMD5 ( final byte [ ] value , final byte [ ] key ) throws AuthenticationException { final HMACMD5 hmacMD5 = new HMACMD5 ( key ) ; hmacMD5 . update ( value ) ; return hmacMD5 . getOutput ( ) ; } | Calculates HMAC - MD5 |
20,499 | static byte [ ] ntlm2SessionResponse ( final byte [ ] ntlmHash , final byte [ ] challenge , final byte [ ] clientChallenge ) throws AuthenticationException { try { final MessageDigest md5 = getMD5 ( ) ; md5 . update ( challenge ) ; md5 . update ( clientChallenge ) ; final byte [ ] digest = md5 . digest ( ) ; final byte... | Calculates the NTLM2 Session Response for the given challenge using the specified password and client challenge . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.