idx int64 0 41.2k | question stringlengths 74 4.21k | target stringlengths 5 888 |
|---|---|---|
14,200 | protected final void ok ( ) { final String dir = panel . getDirectory ( ) ; final boolean include = panel . isIncludeSubdirs ( ) ; close ( ) ; listener . finished ( dir , include ) ; } | The dialog was successfully finished . |
14,201 | public static void main ( final String [ ] args ) throws IOException { Utils4Swing . initSystemLookAndFeel ( ) ; DirectorySelector . Result result ; try { result = DirectorySelector . selectDirectory ( "Please select the destination directory:" , new File ( "." ) . getCanonicalPath ( ) , true ) ; System . out . println... | Starts the selector for a test . |
14,202 | public int handleMessage ( BaseMessage message ) { Utility . getLogger ( ) . info ( "RemoteQueue handling message " + message ) ; if ( message . getProcessedByClientSession ( ) == this . getParentSession ( ) ) return DBConstants . NORMAL_RETURN ; if ( message == m_messageLastMessage ) return DBConstants . NORMAL_RETURN... | Listen for messages . |
14,203 | public BaseMessageFilter addRemoteMessageFilter ( BaseMessageFilter messageFilter , RemoteSession remoteSession ) throws RemoteException { BaseMessageFilter remoteFilter = messageFilter ; messageFilter . setRegistryID ( null ) ; messageFilter . setFilterID ( null ) ; remoteFilter . setCreateRemoteFilter ( true ) ; remo... | Given a copy of the client s message filter set up a remote filter . |
14,204 | public static final Level brokenConnection ( Level level , Throwable thr ) { if ( thr instanceof EOFException ) { return level ; } if ( thr instanceof ClosedChannelException ) { return level ; } if ( ( thr instanceof IOException ) && ( "Broken pipe" . equals ( thr . getMessage ( ) ) || "Connection reset by peer" . equa... | Tries to detect if Throwable is caused by broken connection . If detected returns level else return SEVERE . |
14,205 | public int callRPCAsync ( String rpcName , Object ... args ) { abort ( ) ; this . rpcName = rpcName ; asyncHandle = broker . callRPCAsync ( rpcName , this , args ) ; return asyncHandle ; } | Make an asynchronous call . |
14,206 | public void abort ( ) { if ( asyncHandle != 0 ) { int handle = asyncHandle ; asyncHandle = 0 ; broker . callRPCAbort ( handle ) ; ZKUtil . fireEvent ( new AsyncRPCAbortEvent ( rpcName , target , handle ) ) ; rpcName = null ; } } | Abort any asynchronous RPC in progress . |
14,207 | public void onRPCComplete ( int handle , String data ) { if ( handle == asyncHandle ) { asyncHandle = 0 ; ZKUtil . fireEvent ( new AsyncRPCCompleteEvent ( rpcName , target , data , handle ) ) ; rpcName = null ; } } | RPC completion callback . |
14,208 | public void onRPCError ( int handle , int code , String text ) { if ( handle == asyncHandle ) { asyncHandle = 0 ; ZKUtil . fireEvent ( new AsyncRPCErrorEvent ( rpcName , target , code , text , handle ) ) ; rpcName = null ; } } | RPC error callback . |
14,209 | public int findElement ( Object bookmark , int iHandleType ) { int iTargetPosition ; Object thisBookmark = null ; if ( bookmark == null ) return - 1 ; boolean bDataRecordFormat = false ; for ( iTargetPosition = 0 ; iTargetPosition < m_iRecordListEnd ; iTargetPosition += m_iRecordListStep ) { thisBookmark = this . eleme... | Search through this list for this bookmark . |
14,210 | public void growAccessList ( int iTargetPosition ) { int iArrayIndex ; if ( m_aRecords == null ) { m_aRecords = new Object [ MAX_RECORD_ARRAY_SIZE ] ; m_iRecordListStep = 1 ; m_iRecordListMax = MAX_RECORD_ARRAY_SIZE ; } else { for ( iArrayIndex = 1 ; iArrayIndex < MAX_RECORD_ARRAY_SIZE ; iArrayIndex += 2 ) { this . fre... | Increase the granularity of the access list . |
14,211 | public List < ConstantField > getConstants ( Class < ? > aClass ) { List < ConstantField > constants = new ArrayList < > ( ) ; List < Field > fields = Arrays . asList ( aClass . getDeclaredFields ( ) ) ; for ( Field field : fields ) { if ( Modifier . isStatic ( field . getModifiers ( ) ) && ! Modifier . isFinal ( field... | Gets all fields that are potential constants . |
14,212 | public static LocalDateInterval parseString ( final String input ) { String [ ] values = input . split ( "/" ) ; try { return new LocalDateInterval ( parseLocalDate ( values [ 0 ] ) , parseLocalDate ( values [ 1 ] ) , IntervalEnding . EXCLUDING_END_DATE ) ; } catch ( Exception e ) { throw new IllegalArgumentException (... | Parse a string representation of a LocalDateInterval |
14,213 | private static LocalDate parseLocalDate ( final String input ) { if ( input . contains ( "--" ) || input . contains ( "*" ) ) { return null ; } return LocalDate . parse ( input ) ; } | Parse a string to a LocalDate |
14,214 | @ SuppressWarnings ( "unchecked" ) public SebListener disable ( Class < ? extends SebEvent > ... events ) { if ( events != null ) { enabledEvents = null ; if ( disabledEvents == null ) disabledEvents = new HashSet < > ( ) ; for ( Class < ? extends SebEvent > event : events ) { disabledEvents . add ( event ) ; } } retur... | Disables specific events only . It overrides all enabled events . |
14,215 | protected void saveFile ( SebEvent event , String content , String name , String extension ) { event . saveFile ( content , getListenerFileName ( name ) , extension ) ; } | Save string content into output file with given name and extension . |
14,216 | protected void saveFile ( SebEvent event , byte [ ] bytes , String name , String extension ) { event . saveFile ( bytes , getListenerFileName ( name ) , extension ) ; } | Save bytes into output file with given name and extension . |
14,217 | protected void saveFile ( SebEvent event , File file , String name , String extension ) { event . saveFile ( file , getListenerFileName ( name ) , extension ) ; } | Save file into output file with given name and extension . |
14,218 | public void setupPanel ( ) { this . setLayout ( new BoxLayout ( this , BoxLayout . Y_AXIS ) ) ; this . addGridHeading ( ) ; JPanel panel = new JPanel ( ) ; panel . setOpaque ( false ) ; panel . setMinimumSize ( new Dimension ( 20 , 20 ) ) ; panel . setLayout ( new BorderLayout ( ) ) ; JScrollPane scrollPane = new JScro... | Setup a new panel . |
14,219 | public void addGridDetailItem ( TableModel model , int iRowIndex , GridBagLayout gridbag , GridBagConstraints c ) { JComponent rgcompoments [ ] = new JComponent [ model . getColumnCount ( ) ] ; for ( int iColumnIndex = 0 ; iColumnIndex < rgcompoments . length ; iColumnIndex ++ ) { Object obj = model . getValueAt ( iRow... | Add this item to the grid detail at this row . |
14,220 | public Component addDetailComponent ( TableModel model , Object aValue , int iRowIndex , int iColumnIndex , GridBagConstraints c ) { JComponent component = null ; String string = "" ; if ( aValue instanceof ImageIcon ) { component = new JLabel ( ( ImageIcon ) aValue ) ; } if ( aValue instanceof PortableImage ) { compon... | Create the appropriate component and add it to the grid detail at this location . |
14,221 | public void dataToField ( ComponentCache componentCache , int iRowIndex , int iColumnIndex ) { if ( componentCache . m_rgcompoments [ iColumnIndex ] != null ) { String string = null ; if ( componentCache . m_rgcompoments [ iColumnIndex ] instanceof JTextComponent ) string = ( ( JTextComponent ) componentCache . m_rgcom... | Change the table by setting this field to the value in the component at this location . |
14,222 | public void fieldToData ( ComponentCache componentCache , int iRowIndex , int iColumnIndex ) { if ( componentCache . m_rgcompoments [ iColumnIndex ] != null ) { Object object = this . getModel ( ) . getValueAt ( iRowIndex , iColumnIndex ) ; String string = "" ; if ( object != null ) string = object . toString ( ) ; if ... | Move the data in this row and column in the table to this component . |
14,223 | public void tableChanged ( TableModelEvent e ) { if ( ( e . getFirstRow ( ) == TableModelEvent . HEADER_ROW ) || ( e . getLastRow ( ) >= m_vComponentCache . size ( ) ) ) { this . removeAll ( ) ; this . setupPanel ( ) ; this . validate ( ) ; } else if ( e . getType ( ) == TableModelEvent . UPDATE ) { int iFirstRow = e .... | The table has changed update the grid . |
14,224 | public void write ( final OutputStream out , final Stream < ? extends Triple > triples , final IRI subject ) { final Writer writer = new OutputStreamWriter ( out , UTF_8 ) ; try { template . execute ( writer , new HtmlData ( namespaceService , subject , triples . collect ( toList ( ) ) , properties ) ) . flush ( ) ; } ... | Send the content to an output stream |
14,225 | private ContentType parseContentType ( String value ) { String [ ] pcs = value . split ( "\\;" ) ; String mimeType = pcs [ 0 ] . trim ( ) ; String charSet = "UTF-8" ; for ( int i = 1 ; i < pcs . length ; i ++ ) { String s = pcs [ i ] . trim ( ) . toUpperCase ( ) ; if ( s . startsWith ( "CHARSET=" ) ) { charSet = s . su... | Parse the returned content type . |
14,226 | public static String getRandomString ( final int size , final int start , final int length ) { final StringBuilder buff = new StringBuilder ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { buff . append ( ( char ) ( RAN . nextInt ( length ) + start ) ) ; } return buff . toString ( ) ; } | Creates a size byte long unicode string . All codes are > ; = start and < ; start + length |
14,227 | public static String getRandomString ( final int size , final String stringSet ) { final StringBuilder buff = new StringBuilder ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { final char nextChar = stringSet . charAt ( RAN . nextInt ( stringSet . length ( ) ) ) ; buff . append ( nextChar ) ; } return buff . toString (... | Creates a size byte long unicode string . All codes are from the set stringSet |
14,228 | public void addChild ( Config child ) { Params . notNull ( child , "Child" ) ; child . parent = this ; children . add ( child ) ; } | Add child configuration object . |
14,229 | public void setAttribute ( String name , String value ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; Params . notEmpty ( value , "Attribute value" ) ; if ( value != null ) { attributes . put ( name , value ) ; } else { attributes . remove ( name ) ; } } | Set configuration object attribute . If attribute already exists overwrite old value . Empty value is not accepted but null is considered indication to remove attribute . So that an existing attribute cannot be either null or empty . |
14,230 | public Config getRoot ( ) { Config root = this ; while ( root . parent != null ) { root = root . parent ; } return root ; } | Get root of the tree this configuration object is part of . |
14,231 | public boolean hasAttribute ( String name , String value ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; Params . notNullOrEmpty ( value , "Attribute value" ) ; return value . equals ( attributes . get ( name ) ) ; } | Test if configuration object has an attribute with requested name and value . |
14,232 | public String getAttribute ( String name ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; return attributes . get ( name ) ; } | Get attribute value or null if there is no attribute with requested name . An existing attribute value cannot ever be empty or null so if this method returns null is for missing attribute . |
14,233 | public String getAttribute ( String name , String defaultValue ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; return getAttribute ( name , String . class , defaultValue ) ; } | Get attribute value or given default value if there is no attribute with requested name . If given default value is null and attribute is not found this method still returns null that is requested default value . |
14,234 | public < T > T getAttribute ( String name , Class < T > type ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; Params . notNull ( type , "Attribute type" ) ; return getAttribute ( name , type , null ) ; } | Get attribute value converted to requested type or null if there is no attribute with requested name . |
14,235 | public < T > T getAttribute ( String name , Class < T > type , T defaultValue ) { Params . notNullOrEmpty ( name , "Attribute name" ) ; Params . notNull ( type , "Attribute type" ) ; String value = attributes . get ( name ) ; return value != null ? converter . asObject ( value , type ) : defaultValue ; } | Get attribute value converted to requested type or default value if there is no attribute with requested name . If given default value is null and attribute is not found this method still returns null that is the requested default value . |
14,236 | public String getProperty ( String name ) { Params . notNullOrEmpty ( name , "Property name" ) ; usedProperties . add ( name ) ; return properties . getProperty ( name ) ; } | Get configuration object property value or null if there is no property with requested name . |
14,237 | public < T > T getProperty ( String name , Class < T > type ) { return getProperty ( name , type , null ) ; } | Get configuration object property converter to requested type or null if there is no property with given name . |
14,238 | public < T > T getProperty ( String name , Class < T > type , T defaultValue ) { Params . notNullOrEmpty ( name , "Property name" ) ; Params . notNull ( type , "Property type" ) ; String value = getProperty ( name ) ; if ( value != null ) { return converter . asObject ( value , type ) ; } return defaultValue ; } | Get configuration object property converter to requested type or default value if there is no property with given name . |
14,239 | public boolean hasChild ( String name ) { Params . notNullOrEmpty ( name , "Child name" ) ; for ( Config child : children ) { if ( child . name . equals ( name ) ) { return true ; } } return false ; } | Test if configuration object has at least a child with requested name . |
14,240 | public Config getChild ( String name ) { Params . notNullOrEmpty ( name , "Child name" ) ; for ( Config child : children ) { if ( child . name . equals ( name ) ) { return child ; } } return null ; } | Get configuration object first child with requested name or null if there is no child with given name . |
14,241 | public Config getChild ( int index ) { Params . range ( index , 0 , children . size ( ) , "Index" ) ; return children . get ( index ) ; } | Get configuration object child by index . Given index should be in range so that invoking this method on empty children list will throw exception . |
14,242 | public List < Config > findChildren ( String ... name ) { Params . notNullOrEmpty ( name , "Children names" ) ; List < String > names = Arrays . asList ( name ) ; List < Config > results = new ArrayList < Config > ( ) ; for ( Config child : children ) { if ( names . contains ( child . name ) ) { results . add ( child )... | Find configuration object children with requested names . |
14,243 | public < T > T getValue ( Class < T > type ) { Params . notNull ( type , "Value type" ) ; if ( value == null ) { return null ; } return converter . asObject ( value , type ) ; } | Get this configuration object value converted to requested type . Returns null if this configuration object has no value . |
14,244 | public String getChildValue ( String name ) { Config child = getChild ( name ) ; return child != null ? child . getValue ( ) : null ; } | Get named child string value or null if child not found or it has no value . |
14,245 | private void print ( Config config , int indent ) { for ( int i = 0 ; i < indent ; ++ i ) { System . out . print ( "\t" ) ; } System . out . print ( config . name ) ; System . out . print ( "\r\n" ) ; for ( Config child : config . children ) { print ( child , indent + 1 ) ; } } | Recursively print configuration object tree to standard out . |
14,246 | public synchronized Date setEndDate ( Date time ) { m_cachedInfo . setEndDate ( time ) ; int iThisIndex = m_model . indexOf ( this ) ; if ( iThisIndex != - 1 ) m_model . fireTableRowsUpdated ( iThisIndex , iThisIndex ) ; this . changeRemoteDate ( null , null , this , null , time ) ; return this . getEndDate ( ) ; } | Change the ending time of this service . First move the item on the screen then call the method to change the remote data . |
14,247 | public String [ ] getMealCache ( Date dateStart , Date dateEnd ) throws Exception { int iDays = ( int ) ( ( dateEnd . getTime ( ) - dateStart . getTime ( ) ) / Constants . KMS_IN_A_DAY ) + 2 ; if ( iDays <= 0 ) return null ; String [ ] rgstrMeals = new String [ iDays ] ; Date date = new Date ( dateStart . getTime ( ) )... | Get the meals on each day of this product and put them in an array . |
14,248 | public synchronized int setStatus ( int iStatus ) { m_cachedInfo . setStatus ( iStatus ) ; int iThisIndex = m_model . indexOf ( this ) ; if ( iThisIndex != - 1 ) m_model . fireTableRowsUpdated ( iThisIndex , iThisIndex ) ; return this . getStatus ( ) ; } | Set the status of this item . |
14,249 | public void printHtmlFooter ( PrintWriter out , ResourceBundle reg ) { String strHTML = reg . getString ( "htmlFooter" ) ; if ( ( strHTML == null ) || ( strHTML . length ( ) == 0 ) ) strHTML = "</body>\n</html>" ; out . println ( strHTML ) ; out . flush ( ) ; } | Bottom of HTML form . |
14,250 | public void printHtmlHeader ( PrintWriter out , String strTitle , String strHTMLStart , String strHTMLEnd ) { if ( ( strHTMLStart == null ) || ( strHTMLStart . length ( ) == 0 ) ) strHTMLStart = "<html>\n" + "<head>\n" + "<link rel=\"stylesheet\" type=\"text/css\" href=\"org/jbundle/res/docs/styles/css/style.css\" titl... | Default Form Header . |
14,251 | public void writeHtmlString ( String strHTML , PrintWriter out ) { int iIndex ; if ( strHTML == null ) return ; while ( ( iIndex = strHTML . indexOf ( HtmlConstants . TITLE_TAG ) ) != - 1 ) { strHTML = strHTML . substring ( 0 , iIndex ) + ( ( BasePanel ) this . getScreenField ( ) ) . getTitle ( ) + strHTML . substring ... | Parse the HTML for variables and print it . |
14,252 | public float write ( ) throws IOException { bitArray . setAll ( false ) ; for ( int ii = 0 ; ii < bytes ; ii ++ ) { bitArray . set ( ii , bb1 . get ( ii ) != bb2 . get ( ii ) ) ; } if ( ! bitArray . any ( ) ) { return 0 ; } if ( ! bitArray . and ( selfImportantArray ) ) { return 0 ; } if ( writeCount == 0 ) { DataOutpu... | Writes objects fields to stream |
14,253 | public String [ ] getRoles ( String username ) { if ( user_list . containsKey ( username ) ) { return user_list . get ( username ) . toArray ( new String [ 0 ] ) ; } else { if ( defaultRoles == null ) { return new String [ 0 ] ; } else { return defaultRoles ; } } } | Find and return all roles this user has . |
14,254 | public String [ ] getUsersInRole ( String role ) { if ( role_list . containsKey ( role ) ) { return role_list . get ( role ) . toArray ( new String [ 0 ] ) ; } else { return new String [ 0 ] ; } } | Returns a list of users who have a particular role . |
14,255 | public void setRole ( String username , String newrole ) throws RolesException { List < String > users_with_role = new ArrayList < String > ( ) ; if ( user_list . containsKey ( username ) ) { List < String > roles_of_user = user_list . get ( username ) ; if ( ! roles_of_user . contains ( newrole ) ) { roles_of_user . a... | Assign a role to a user . |
14,256 | public void removeRole ( String username , String oldrole ) throws RolesException { List < String > users_with_role = new ArrayList < String > ( ) ; if ( user_list . containsKey ( username ) ) { List < String > roles_of_user = user_list . get ( username ) ; if ( roles_of_user . contains ( oldrole ) ) { roles_of_user . ... | Remove a role from a user . |
14,257 | public void deleteRole ( String rolename ) throws RolesException { if ( role_list . containsKey ( rolename ) ) { List < String > users_with_role = role_list . get ( rolename ) ; for ( String user : users_with_role ) { List < String > roles_of_user = user_list . get ( user ) ; roles_of_user . remove ( rolename ) ; user_... | Delete a role . |
14,258 | public void renameRole ( String oldrole , String newrole ) throws RolesException { if ( role_list . containsKey ( oldrole ) ) { List < String > users_with_role = role_list . get ( oldrole ) ; for ( String user : users_with_role ) { List < String > roles_of_user = user_list . get ( user ) ; roles_of_user . remove ( oldr... | Rename a role . |
14,259 | public String [ ] searchRoles ( String search ) throws RolesException { String [ ] roles = role_list . keySet ( ) . toArray ( new String [ role_list . size ( ) ] ) ; List < String > found = new ArrayList < String > ( ) ; for ( int i = 0 ; i < roles . length ; i ++ ) { if ( roles [ i ] . toLowerCase ( ) . contains ( sea... | Returns a list of roles matching the search . |
14,260 | public void run ( ) { Folder folder = this . getInboxFolder ( ) ; if ( folder != null ) this . processMail ( folder ) ; try { folder . close ( true ) ; } catch ( MessagingException e ) { e . printStackTrace ( ) ; } } | Run the code in this process . |
14,261 | public Folder getInboxFolder ( ) { String strMessageType = MessageTransportModel . EMAIL ; String strClassName = null ; Record recMessageTransport = this . getRecord ( MessageTransportModel . MESSAGE_TRANSPORT_FILE ) ; if ( recMessageTransport == null ) recMessageTransport = Record . makeRecordFromClassName ( MessageTr... | Open the poop3 inbox . |
14,262 | public void processMail ( Folder folder ) { try { int iCount = folder . getMessageCount ( ) ; if ( iCount == 0 ) return ; String pattern = REPLY_STRING ; Message [ ] messages = null ; if ( this . getProperty ( PATTERN ) == null ) { messages = folder . getMessages ( ) ; } else { pattern = this . getProperty ( PATTERN ) ... | Go through all the mail and process the messages . |
14,263 | public String getContentString ( Message message ) { try { String strContentType = message . getContentType ( ) ; Object content = message . getContent ( ) ; if ( content instanceof MimeMultipart ) { for ( int index = 0 ; ; index ++ ) { BodyPart bodyPart = ( ( javax . mail . internet . MimeMultipart ) content ) . getBo... | Get the message content as a string . |
14,264 | public Object createObject ( String className , Class clazz ) throws ClassNotFoundException { Object object ; try { object = clazz . newInstance ( ) ; } catch ( InstantiationException ie ) { String info = "Could not create " + description + " object: " + className + ". Could not access object constructor: " ; info += i... | Dynamically creates an object |
14,265 | public double fast ( ) { readLock . lock ( ) ; try { int count = count ( ) ; return toDegrees ( sinSum / count , cosSum / count ) ; } finally { readLock . unlock ( ) ; } } | Returns fast average . Fast calculation adds and subtracts values from sum field . This might cause difference in time to actual calculating sample by sample . |
14,266 | public double average ( ) { readLock . lock ( ) ; try { int count = count ( ) ; double s = 0 ; double c = 0 ; PrimitiveIterator . OfInt it = modIterator ( ) ; while ( it . hasNext ( ) ) { int m = it . nextInt ( ) ; s += sin [ m ] ; c += cos [ m ] ; } ; return toDegrees ( s / count , c / count ) ; } finally { readLock .... | Returns sample by sample calculated average . |
14,267 | public void remove ( EventQueueEntry entry ) { List < EventQueueEntry > container = queue . get ( entry . getPriority ( ) ) ; if ( container == null ) { return ; } container . remove ( entry ) ; } | Removes the given queue entry from the notification list . |
14,268 | public void removeAll ( Object object ) { for ( Entry < Integer , List < EventQueueEntry > > e : queue . entrySet ( ) ) { List < EventQueueEntry > entries = e . getValue ( ) ; List < EventQueueEntry > toRemove = new LinkedList < > ( ) ; synchronized ( entries ) { for ( EventQueueEntry entry : entries ) { if ( entry . g... | Removes all handler methods in the given object from notifications by this queue . |
14,269 | public final int getRemaining ( ) { int rem = 0 ; for ( int ii = 0 ; ii < length ; ii ++ ) { rem += srcs [ offset + ii ] . remaining ( ) ; } return rem ; } | Returns the number of bytes that can be written . |
14,270 | public void updateImage ( ) { if ( m_iCurrentState == ON ) this . setIcon ( m_iconOn ) ; else if ( m_iCurrentState == OFF ) this . setIcon ( m_iconOff ) ; else this . setIcon ( m_iconNull ) ; } | Update the image to the current state . |
14,271 | public void toggleState ( ) { if ( m_iCurrentState == ON ) m_iCurrentState = NULL ; else if ( m_iCurrentState == OFF ) m_iCurrentState = ON ; else m_iCurrentState = OFF ; this . updateImage ( ) ; } | Toggle the button state . |
14,272 | private DirectoryService createDirectoryService ( ) { final DirectoryServiceFactory factory = new DefaultDirectoryServiceFactory ( ) ; try { factory . init ( "scribble" ) ; return factory . getDirectoryService ( ) ; } catch ( Exception e ) { throw new AssertionError ( "Unable to create directory service" , e ) ; } } | Creates a new DirectoryService instance for the test rule . Initialization of the service is done in the apply Statement phase by invoking the setupService method . |
14,273 | protected void setupService ( ) throws Exception { final DirectoryService service = this . getDirectoryService ( ) ; service . getChangeLog ( ) . setEnabled ( false ) ; this . workDir = getOuterRule ( ) . newFolder ( "dsworkdir" ) ; service . setInstanceLayout ( new InstanceLayout ( this . workDir ) ) ; final CacheServ... | Applies the configuration to the service such as AccessControl and AnonymousAccess . Both are enabled as configured . Further the method initializes the cache service . The method does not start the service . |
14,274 | private void importInitialLdif ( ) throws IOException { if ( this . initialLdif != null ) { try ( InputStream ldifStream = this . initialLdif . openStream ( ) ) { this . importLdif ( ldifStream ) ; } } } | Initializes the directory with content from the initial ldif file . Note that a partition has to be created for the root of the ldif file . |
14,275 | private void createPartitions ( ) { for ( Map . Entry < String , String > partitionEntry : this . partitions . entrySet ( ) ) { try { this . addPartitionInternal ( partitionEntry . getKey ( ) , partitionEntry . getValue ( ) ) ; } catch ( Exception e ) { throw new AssertionError ( "Could not create partitions " + this .... | Creates all paritions that are added on rule setup . |
14,276 | public void importLdif ( InputStream ldifData ) throws IOException { final File ldifFile = getOuterRule ( ) . newFile ( "scribble_import.ldif" ) ; try ( final Writer writer = new OutputStreamWriter ( new FileOutputStream ( ldifFile ) , Charsets . UTF_8 ) ) { IOUtils . copy ( ldifData , writer ) ; } final String pathToL... | Imports directory content that is defined in LDIF format and provided as input stream . The method writes the stream content into a temporary file . |
14,277 | public void addPartition ( String partitionId , String suffix ) { this . partitions . put ( partitionId , suffix ) ; } | Adds a partition to the rule . The actual parititon is created when the rule is applied . |
14,278 | public void moveTheData ( boolean bDisplayOption , int iMoveType ) { if ( m_convCheckMark != null ) if ( m_bDisableOnMove ) m_fldDest . setEnabled ( ! m_convCheckMark . getState ( ) ) ; if ( ( m_convCheckMark == null ) || ( m_convCheckMark . getState ( ) ) ) { if ( ( this . getSourceField ( ) != null ) && ( ( ! this . ... | Actually move the data . |
14,279 | public Object convertToMessage ( ) { try { Object reply = this . getRawData ( ) ; org . w3c . dom . Node nodeBody = this . getMessageBody ( reply , false ) ; if ( this . getConvertToMessage ( ) == null ) return null ; Object msg = this . getConvertToMessage ( ) . unmarshalRootElement ( nodeBody , this ) ; return msg ; ... | Convert this DOM Tree to the JAXB message tree . Don t override this method override the unmarshalRootElement method . |
14,280 | public void setMessageException ( Throwable ex ) { String strErrorMessage = ex . getMessage ( ) ; BaseMessage message = this . getMessage ( ) ; if ( ( message != null ) && ( message . getMessageHeader ( ) instanceof TrxMessageHeader ) ) ( ( TrxMessageHeader ) message . getMessageHeader ( ) ) . put ( TrxMessageHeader . ... | If an exception occurred set it in the message |
14,281 | public void addComponent ( JComponent component , boolean bLinkComponentToConverter ) { this . add ( Box . createHorizontalStrut ( 3 ) ) ; if ( this . getComponentCount ( ) < brgComponentsLinkedToConverter . length ) brgComponentsLinkedToConverter [ this . getComponentCount ( ) ] = bLinkComponentToConverter ; this . ad... | Add this component to this panel . |
14,282 | public void setControlValue ( Object objValue , Component component ) { Convert converter = null ; if ( component instanceof ScreenComponent ) converter = ( ( ScreenComponent ) component ) . getConverter ( ) ; if ( converter == null ) converter = m_converter ; if ( component instanceof FieldComponent ) ( ( FieldCompone... | Set this control to this value . |
14,283 | public Map < String , Object > getTransportProperties ( ) { Map < String , Object > propMessageTransport = null ; Record recMessageTransport = Record . makeRecordFromClassName ( MessageTransportModel . THICK_CLASS , this ) ; recMessageTransport . setKeyArea ( MessageTransportModel . CODE_KEY ) ; String strMessageType =... | Get the properties that go with this transport type . |
14,284 | public void setupReplyMessage ( BaseMessage messageReply , BaseMessage messageOut , String strMessageInfoType , String strMessageProcessType ) { if ( messageReply != null ) { TrxMessageHeader trxMessageHeaderIncomming = null ; if ( messageOut != null ) trxMessageHeaderIncomming = ( TrxMessageHeader ) messageOut . getMe... | Set up a message header for this reply using the message header for the original message . |
14,285 | public String getProperty ( TrxMessageHeader trxMessageHeader , String strParamName ) { String strProperty = ( String ) trxMessageHeader . get ( strParamName ) ; if ( strProperty == null ) strProperty = this . getProperty ( strParamName ) ; return strProperty ; } | Get this transport specific param . Get this param . The transport properties specify param names by adding the word param after it . For example to specify a different param for the messageClass for a SOAP transport the SOAP property messageClassParam = SOAPMessageClass should be set in the SOAP transport properties a... |
14,286 | public ContactTypeField getContactTypeField ( ) { BaseField field = this . getRecord ( ) . getField ( "ContactTypeID" ) ; if ( field instanceof ContactTypeField ) return ( ContactTypeField ) field ; return null ; } | Get the contact type field in the same record as this contact field . |
14,287 | public static PublicKey generatePublicKey ( String encodedPublicKey ) { try { byte [ ] decodedKey = Base64 . decode ( encodedPublicKey ) ; KeyFactory keyFactory = KeyFactory . getInstance ( KEY_FACTORY_ALGORITHM ) ; return keyFactory . generatePublic ( new X509EncodedKeySpec ( decodedKey ) ) ; } catch ( NoSuchAlgorithm... | Generates a PublicKey instance from a string containing the Base64 - encoded public key . |
14,288 | private void logNodeTypes ( final NodeType ... nodeTypes ) { if ( LOG . isDebugEnabled ( ) ) { StringBuilder buf = new StringBuilder ( 32 ) ; buf . append ( "[\n" ) ; for ( NodeType nt : nodeTypes ) { buf . append ( nt . getName ( ) ) . append ( " > " ) ; for ( NodeType st : nt . getSupertypes ( ) ) { buf . append ( st... | Helper method to logs a list of node types and their properties in a human readable way . |
14,289 | public void notifySubscribers ( final List < ? extends Subscriber > subscribers , final SyndFeed value , final SubscriptionSummaryCallback callback ) { String mimeType = null ; if ( value . getFeedType ( ) . startsWith ( "rss" ) ) { mimeType = "application/rss+xml" ; } else { mimeType = "application/atom+xml" ; } final... | This method will serialize the synd feed and build Notifications for the implementation class to handle . |
14,290 | public static String fixPropertyValue ( String string , boolean bResourceListBundle ) { if ( string == null ) string = Constants . BLANK ; StringBuffer strBuff = new StringBuffer ( ) ; StringReader stringReader = new StringReader ( string ) ; LineNumberReader lineReader = new LineNumberReader ( stringReader ) ; boolean... | Clean up this long string and convert it to a java quoted string . |
14,291 | public static String encodeLine ( String string , boolean bResourceListBundle ) { if ( string == null ) return string ; for ( int i = 0 ; i < string . length ( ) ; i ++ ) { if ( ( ( string . charAt ( i ) == '\"' ) || ( string . charAt ( i ) == '\\' ) ) || ( ( ! bResourceListBundle ) && ( string . charAt ( i ) == ':' ) ... | Encode the utf - 16 characters in this line to escaped java strings . |
14,292 | public static final < T > void doFor ( Object bean , String property , Consumer < T > consumer ) { T t = ( T ) getValue ( bean , property ) ; consumer . accept ( t ) ; } | Executes consumer for property . |
14,293 | public static final Object getValue ( Object bean , String property ) { return doFor ( bean , property , null , BeanHelper :: getValue , BeanHelper :: getValue , BeanHelper :: getFieldValue , BeanHelper :: getMethodValue ) ; } | Return propertys value . |
14,294 | public static final Class [ ] getParameterTypes ( Object bean , String property ) { Type type = ( Type ) doFor ( bean , property , null , ( Object a , int i ) -> { Object o = Array . get ( a , i ) ; return o != null ? o . getClass ( ) . getComponentType ( ) : null ; } , ( List l , int i ) -> { return l . get ( i ) . ge... | Returns actual parameter types for property |
14,295 | public static Field getField ( Class cls , String fieldname ) throws NoSuchFieldException { while ( true ) { try { return cls . getDeclaredField ( fieldname ) ; } catch ( NoSuchFieldException ex ) { cls = cls . getSuperclass ( ) ; if ( Object . class . equals ( cls ) ) { throw ex ; } } catch ( SecurityException ex ) { ... | Returns Declared field either from given class or it s super class |
14,296 | public static final Class getType ( Object bean , String property ) { return ( Class ) doFor ( bean , property , null , BeanHelper :: getObjectType , BeanHelper :: getObjectType , BeanHelper :: getFieldType , BeanHelper :: getMethodType ) ; } | Return property type . |
14,297 | public static final < T extends Annotation > T getAnnotation ( Object bean , String property , Class < T > annotationClass ) { return ( T ) doFor ( bean , property , null , ( Object a , int i ) -> { Object o = Array . get ( a , i ) ; return o != null ? o . getClass ( ) . getAnnotation ( annotationClass ) : null ; } , (... | Returns property annotation . |
14,298 | public static final boolean hasProperty ( Object bean , String property ) { try { return ( boolean ) doFor ( bean , property , null , ( Object a , int i ) -> { return true ; } , ( List l , int i ) -> { return true ; } , ( Object b , Class c , String p ) -> { getField ( c , p ) ; return true ; } , ( Object b , Method m ... | Return true if property exists . |
14,299 | public static final < T > T defaultFactory ( Class < T > cls , String hint ) { try { return cls . newInstance ( ) ; } catch ( InstantiationException | IllegalAccessException ex ) { throw new IllegalArgumentException ( ex ) ; } } | Default object factory that calls newInstance method . Checked exceptions are wrapped in IllegalArgumentException . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.