idx
int64
0
165k
question
stringlengths
73
5.81k
target
stringlengths
5
918
133,000
public static < K , V > Map < K , V > zipMap ( Iterable < K > keys , Iterable < V > values ) { Map < K , V > retVal = new LinkedHashMap < > ( ) ; Iterator < K > keysIter = keys . iterator ( ) ; Iterator < V > valsIter = values . iterator ( ) ; while ( keysIter . hasNext ( ) ) { final K key = keysIter . next ( ) ; Preco...
Create a Map from iterables of keys and values . Will throw an exception if there are more keys than values or more values than keys .
133,001
public static < K , V > Map < K , V > zipMapPartial ( Iterable < K > keys , Iterable < V > values ) { Map < K , V > retVal = new LinkedHashMap < > ( ) ; Iterator < K > keysIter = keys . iterator ( ) ; Iterator < V > valsIter = values . iterator ( ) ; while ( keysIter . hasNext ( ) ) { final K key = keysIter . next ( ) ...
Create a Map from iterables of keys and values . If there are more keys than values or more values than keys the excess will be omitted .
133,002
public static long copyToFileAndClose ( InputStream is , File file , long timeout ) throws IOException , TimeoutException { file . getParentFile ( ) . mkdirs ( ) ; try ( OutputStream os = new BufferedOutputStream ( new FileOutputStream ( file ) ) ) { final long retval = copyWithTimeout ( is , os , timeout ) ; os . flus...
Copy bytes from is to file but timeout if the copy takes too long . The timeout is best effort and not guaranteed . Specifically is . read will not be interrupted .
133,003
public static long copyWithTimeout ( InputStream is , OutputStream os , long timeout ) throws IOException , TimeoutException { byte [ ] buffer = new byte [ DEFAULT_BUFFER_SIZE ] ; int n ; long startTime = System . currentTimeMillis ( ) ; long size = 0 ; while ( - 1 != ( n = is . read ( buffer ) ) ) { if ( System . curr...
Copy from the input stream to the output stream and tries to exit if the copy exceeds the timeout . The timeout is best effort . Specifically is . read will not be interrupted .
133,004
public static FileUtils . FileCopyResult unzip ( final File pulledFile , final File outDir ) throws IOException { if ( ! ( outDir . exists ( ) && outDir . isDirectory ( ) ) ) { throw new ISE ( "outDir[%s] must exist and be a directory" , outDir ) ; } log . info ( "Unzipping file[%s] to [%s]" , pulledFile , outDir ) ; f...
Unzip the pulled file to an output directory . This is only expected to work on zips with lone files and is not intended for zips with directory structures .
133,005
public static void scheduleWithFixedDelay ( ScheduledExecutorService exec , Duration delay , Runnable runnable ) { scheduleWithFixedDelay ( exec , delay , delay , runnable ) ; }
Run runnable repeatedly with the given delay between calls . Exceptions are caught and logged as errors .
133,006
public static void scheduleWithFixedDelay ( final ScheduledExecutorService exec , final Duration initialDelay , final Duration delay , final Callable < Signal > callable ) { log . debug ( "Scheduling repeatedly: %s with delay %s" , callable , delay ) ; exec . schedule ( new Runnable ( ) { public void run ( ) { try { lo...
Run callable repeatedly with the given delay between calls until it returns Signal . STOP . Exceptions are caught and logged as errors .
133,007
public static void scheduleAtFixedRate ( ScheduledExecutorService exec , Duration rate , Runnable runnable ) { scheduleAtFixedRate ( exec , rate , rate , runnable ) ; }
Run runnable once every period . Exceptions are caught and logged as errors .
133,008
void validateAndPrepare ( Message message , Address [ ] addresses ) throws MessagingException { if ( message . getFrom ( ) == null || message . getFrom ( ) . length == 0 ) { fail ( message , addresses , "No or empty FROM address set!" ) ; } if ( addresses . length == 0 ) { fail ( message , addresses , "No RECIPIENTS se...
Validate FROM and RECIPIENTS
133,009
static Map < String , Collection < String > > extractTextParts ( Multipart multiPart ) throws MessagingException , IOException { HashMap < String , Collection < String > > bodies = new HashMap < > ( ) ; for ( int i = 0 ; i < multiPart . getCount ( ) ; i ++ ) { checkPartForTextType ( bodies , multiPart . getBodyPart ( i...
Extract parts from Multi - part message .
133,010
private static void checkPartForTextType ( HashMap < String , Collection < String > > bodies , Part part ) throws IOException , MessagingException { Object content = part . getContent ( ) ; if ( content instanceof CharSequence ) { String ct = part . getContentType ( ) ; Collection < String > value = bodies . get ( ct )...
Recursive find body parts and save them to HashMap
133,011
public DirectoryPollerBuilder setPollingInterval ( long interval , TimeUnit timeUnit ) { if ( interval < 0 ) { throw new IllegalArgumentException ( "Argument 'interval' is negative: " + interval ) ; } pollingIntervalInMillis = timeUnit . toMillis ( interval ) ; return this ; }
Set the interval between each poll cycle . Optional parameter . Default value is 1000 milliseconds .
133,012
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "DELEGATE" ) public org . openprovenance . prov . model . QualifiedName getDelegate ( ) { return delegate ; }
Gets the value of the delegate property .
133,013
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "RESPONSIBLE" ) public org . openprovenance . prov . model . QualifiedName getResponsible ( ) { return responsible ; }
Gets the value of the responsible property .
133,014
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "ACTIVITY" ) public org . openprovenance . prov . model . QualifiedName getActivity ( ) { return activity ; }
Gets the value of the activity property .
133,015
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "AGENT" ) public org . openprovenance . prov . model . QualifiedName getAgent ( ) { return agent ; }
Gets the value of the agent property .
133,016
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "SPECIFICENTITY_MENTIONOF_PK" ) public org . openprovenance . prov . model . QualifiedName getSpecificEntity ( ) { return specificEntity ; }
Gets the value of the specificEntity property .
133,017
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "GENERALENTITY_MENTIONOF_PK" ) public org . openprovenance . prov . model . QualifiedName getGeneralEntity ( ) { return generalEntity ; }
Gets the value of the generalEntity property .
133,018
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "BUNDLE" ) public org . openprovenance . prov . model . QualifiedName getBundle ( ) { return bundle ; }
Gets the value of the bundle property .
133,019
public String buildAcceptHeader ( ) { StringBuffer mimetypes = new StringBuffer ( ) ; Enumeration < ProvFormat > e = mimeTypeMap . keys ( ) ; String sep = "" ; while ( e . hasMoreElements ( ) ) { ProvFormat f = e . nextElement ( ) ; if ( isInputFormat ( f ) ) { mimetypes . append ( sep ) ; sep = "," ; mimetypes . appen...
Create a list of mime types supported by ProvToolbox in view of constructing an Accept Header .
133,020
public URLConnection connectWithRedirect ( URL theURL ) throws IOException { URLConnection conn = null ; String accept_header = buildAcceptHeader ( ) ; int redirect_count = 0 ; boolean done = false ; while ( ! done ) { if ( theURL . getProtocol ( ) . equals ( "file" ) ) { return null ; } Boolean isHttp = ( theURL . get...
A method to connect to a URL and follow redirects if any .
133,021
public String convertExtensionToMediaType ( String extension ) { ProvFormat format = extensionRevMap . get ( extension ) ; if ( format == null ) return null ; return mimeTypeMap . get ( format ) ; }
Maps an file extension to a Media type
133,022
public String getExtension ( ProvFormat format ) { String extension = UNKNOWN ; if ( format != null ) { extension = extensionMap . get ( format ) ; } return extension ; }
Returns an extension for a given type of serialization of PROV
133,023
String getOption ( String [ ] options , int index ) { if ( ( options != null ) && ( options . length > index ) ) { return options [ index ] ; } return null ; }
Returns an option at given index in an array of options or null
133,024
public List < Variant > getVariants ( ) { List < Variant > vs = new ArrayList < Variant > ( ) ; for ( Map . Entry < String , ProvFormat > entry : mimeTypeRevMap . entrySet ( ) ) { if ( isOutputFormat ( entry . getValue ( ) ) ) { String [ ] parts = entry . getKey ( ) . split ( "/" ) ; MediaType m = new MediaType ( parts...
Support for content negotiation jax - rs style . Create a list of media type supported by the framework .
133,025
public Boolean isInputFormat ( ProvFormat format ) { ProvFormatType t = provTypeMap . get ( format ) ; return ( t . equals ( ProvFormatType . INPUT ) || t . equals ( ProvFormatType . INPUTOUTPUT ) ) ; }
Determines whether this format received as argument is an input format .
133,026
public Boolean isOutputFormat ( ProvFormat format ) { ProvFormatType t = provTypeMap . get ( format ) ; return ( t . equals ( ProvFormatType . OUTPUT ) || t . equals ( ProvFormatType . INPUTOUTPUT ) ) ; }
Determines whether this format received as argument is an output format .
133,027
public Object loadProvUnknownGraph ( String filename ) { try { Utility u = new Utility ( ) ; CommonTree tree = u . convertASNToTree ( filename ) ; Object o = u . convertTreeToJavaBean ( tree , pFactory ) ; if ( o != null ) { return o ; } } catch ( RecognitionException t1 ) { } catch ( IOException e ) { } try { File in ...
Experimental code trying to load a document without knowing its serialization format . First parser that succeeds returns a results . Not a robust method!
133,028
public Document readDocument ( String url ) { try { URL theURL = new URL ( url ) ; URLConnection conn = connectWithRedirect ( theURL ) ; if ( conn == null ) return null ; ProvFormat format = null ; String content_type = conn . getContentType ( ) ; logger . debug ( "Content-type: " + content_type ) ; if ( content_type !...
Reads a document from a URL . Uses the Content - type header field to determine the mime - type of the resource and therefore the parser to read the document .
133,029
public Document readDocumentFromFile ( String filename ) { ProvFormat format = getTypeForFile ( filename ) ; if ( format == null ) { throw new InteropException ( "Unknown output file format: " + filename ) ; } return readDocumentFromFile ( filename , format ) ; }
Reads a document from a file using the file extension to decide which parser to read the file with .
133,030
public Document readDocumentFromFile ( String filename , ProvFormat format ) { try { switch ( format ) { case DOT : case JPEG : case PNG : case SVG : throw new UnsupportedOperationException ( ) ; case JSON : { return new org . openprovenance . prov . json . Converter ( pFactory ) . readDocument ( filename ) ; } case PR...
Reads a document from a file using the format to decide which parser to read the file with .
133,031
public List < org . openprovenance . prov . model . Other > getOther ( ) { if ( other == null ) { other = new ArrayList < org . openprovenance . prov . model . Other > ( ) ; } return this . other ; }
Gets the value of the other property .
133,032
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "DICTIONARY__DICTIONARYMEMBER_0" ) public org . openprovenance . prov . model . QualifiedName getDictionary ( ) { return dictionary ; }
Gets the value of the dictionary property .
133,033
public List < org . openprovenance . prov . model . Entry > getKeyEntityPair ( ) { if ( keyEntityPair == null ) { keyEntityPair = new ArrayList < org . openprovenance . prov . model . Entry > ( ) ; } return this . keyEntityPair ; }
Gets the value of the keyEntityPair property .
133,034
protected Key valueToKey ( Value value ) { if ( value instanceof Resource ) { return pFactory . newKey ( convertResourceToQualifiedName ( ( Resource ) value ) , name . PROV_QUALIFIED_NAME ) ; } else if ( value instanceof Literal ) { Literal lit = ( Literal ) value ; QualifiedName type ; QualifiedName xsdtype ; if ( lit...
code replicated from valueToObject
133,035
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "COLLECTION" ) public org . openprovenance . prov . model . QualifiedName getCollection ( ) { return collection ; }
Gets the value of the collection property .
133,036
@ ManyToMany ( targetEntity = AStatement . class , cascade = { CascadeType . ALL } ) @ JoinTable ( name = "BUNDLE_STATEMENT_JOIN" , joinColumns = { @ JoinColumn ( name = "BUNDLE" ) } , inverseJoinColumns = { @ JoinColumn ( name = "STATEMENT" ) } ) public List < Statement > getStatement ( ) { if ( statement == null ) { ...
Gets the value of the statement property .
133,037
@ ManyToMany ( targetEntity = AStatement . class , cascade = { CascadeType . ALL } ) @ JoinTable ( name = "DOCUMENT_STATEMENT_JOIN" , joinColumns = { @ JoinColumn ( name = "DOCUMENT" ) } , inverseJoinColumns = { @ JoinColumn ( name = "STATEMENT" ) } ) public List < StatementOrBundle > getStatementOrBundle ( ) { if ( st...
Gets the value of the statementOrBundle property .
133,038
@ Column ( name = "PK" ) @ GeneratedValue ( strategy = GenerationType . AUTO ) public Long getPk ( ) { return pk ; }
Gets the value of the pk property .
133,039
public Agent newAgent ( Agent a ) { Agent res = newAgent ( a . getId ( ) ) ; res . getType ( ) . addAll ( a . getType ( ) ) ; res . getLabel ( ) . addAll ( a . getLabel ( ) ) ; return res ; }
Creates a copy of an agent . The copy is shallow in the sense that the new Agent shares the same attributes as the original Agent .
133,040
public Entity newEntity ( Entity e ) { Entity res = newEntity ( e . getId ( ) ) ; res . getOther ( ) . addAll ( e . getOther ( ) ) ; res . getType ( ) . addAll ( e . getType ( ) ) ; res . getLabel ( ) . addAll ( e . getLabel ( ) ) ; res . getLocation ( ) . addAll ( e . getLocation ( ) ) ; return res ; }
Creates a copy of an entity . The copy is shallow in the sense that the new Entity shares the same attributes as the original Entity .
133,041
public Entry newEntry ( Key key , QualifiedName entity ) { Entry res = of . createEntry ( ) ; res . setKey ( key ) ; res . setEntity ( entity ) ; return res ; }
Factory method for Key - entity entries . Key - entity entries are used to identify the members of a dictionary .
133,042
public void setKey ( org . openprovenance . prov . model . Key value ) { this . key = ( org . openprovenance . prov . sql . Key ) value ; }
Sets the value of the key property .
133,043
public List < org . openprovenance . prov . model . Key > getKey ( ) { if ( key == null ) { key = AttributeList . populateKnownAttributes ( this , all , org . openprovenance . prov . model . Key . class ) ; } return this . key ; }
Gets the value of the key property .
133,044
final public QualifiedName stringToQualifiedName ( String str , org . w3c . dom . Element el ) { if ( str == null ) return null ; int index = str . indexOf ( ':' ) ; if ( index == - 1 ) { QualifiedName qn = pFactory . newQualifiedName ( el . lookupNamespaceURI ( null ) , str , null ) ; return qn ; } String prefix = str...
Converts a string to a QualifiedName extracting namespace from the DOM . Ensures that the generated qualified name is properly escaped according to PROV - N syntax .
133,045
public Document parseRDF ( InputStream inputStream , RDFFormat format , String baseuri ) throws RDFParseException , RDFHandlerException , IOException { RDFParser rdfParser = Rio . createParser ( format ) ; return parseRDF ( inputStream , rdfParser , baseuri ) ; }
Parse from input stream no base uri specified .
133,046
public Document parseRDF ( InputStream inputStream , RDFParser rdfParser , String baseuri ) throws IOException , RDFParseException , RDFHandlerException { RdfCollector rdfCollector = new QualifiedCollector ( pFactory , onto ) ; rdfParser . setRDFHandler ( rdfCollector ) ; rdfParser . parse ( inputStream , baseuri ) ; D...
Parse from input stream passing base uri .
133,047
public boolean hasNoTime ( Statement o ) { if ( o instanceof HasTime ) return false ; if ( o instanceof Activity ) return false ; return true ; }
Indicates whether object has no time field .
133,048
public String selectColor ( List < String > colors ) { String tr = "transparent" ; for ( String c : colors ) { if ( ! ( c . equals ( tr ) ) ) return c ; } return tr ; }
returns the first non transparent color
133,049
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "ALTERNATE1" ) public org . openprovenance . prov . model . QualifiedName getAlternate1 ( ) { return alternate1 ; }
Gets the value of the alternate1 property .
133,050
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "ALTERNATE2" ) public org . openprovenance . prov . model . QualifiedName getAlternate2 ( ) { return alternate2 ; }
Gets the value of the alternate2 property .
133,051
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "PLAN" ) public org . openprovenance . prov . model . QualifiedName getPlan ( ) { return plan ; }
Gets the value of the plan property .
133,052
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "INFLUENCEE" ) public org . openprovenance . prov . model . QualifiedName getInfluencee ( ) { return influencee ; }
Gets the value of the influencee property .
133,053
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "INFLUENCER" ) public org . openprovenance . prov . model . QualifiedName getInfluencer ( ) { return influencer ; }
Gets the value of the influencer property .
133,054
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "GENERATED_ENTITY" ) public org . openprovenance . prov . model . QualifiedName getGeneratedEntity ( ) { return generatedEntity ; }
Gets the value of the generatedEntity property .
133,055
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "USED_ENTITY" ) public org . openprovenance . prov . model . QualifiedName getUsedEntity ( ) { return usedEntity ; }
Gets the value of the usedEntity property .
133,056
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "GENERATION" ) public org . openprovenance . prov . model . QualifiedName getGeneration ( ) { return generation ; }
Gets the value of the generation property .
133,057
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "USAGE" ) public org . openprovenance . prov . model . QualifiedName getUsage ( ) { return usage ; }
Gets the value of the usage property .
133,058
public AValue getValueItem ( ) { if ( ( avalue == null ) && ( value != null ) ) { if ( type == null ) { avalue = SQLValueConverter . convertToAValue ( vc . getXsdType ( value ) , value ) ; } else if ( value instanceof LangString ) { avalue = SQLValueConverter . convertToAValue ( type , ( ( LangString ) value ) . getVal...
Gets the value of the test property .
133,059
public void setValueItem ( AValue value ) { this . avalue = value ; if ( value != null ) { Object o = SQLValueConverter . convertFromAValue ( value ) ; if ( o != null ) { if ( o instanceof QualifiedName ) { this . value = o ; } else { this . value = o . toString ( ) ; } } } }
Sets the value of the test property .
133,060
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "TRIGGER_" ) public org . openprovenance . prov . model . QualifiedName getTrigger ( ) { return trigger ; }
Gets the value of the trigger property .
133,061
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "STARTER" ) public org . openprovenance . prov . model . QualifiedName getStarter ( ) { return starter ; }
Gets the value of the starter property .
133,062
public Object convertJavaBeanToJavaBean ( Document doc , ProvFactory pFactory ) { BeanTraversal bt = new BeanTraversal ( pFactory , pFactory ) ; Document o = bt . doAction ( doc ) ; return o ; }
A conversion function that copies a Java Bean deeply .
133,063
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "QN" ) public QualifiedName getQualifiedName ( ) { return qualifiedName ; }
Gets the value of the qualifiedName property .
133,064
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "ENDER" ) public org . openprovenance . prov . model . QualifiedName getEnder ( ) { return ender ; }
Gets the value of the ender property .
133,065
public void updateNamespaces ( Document document ) { Namespace rootNamespace = Namespace . gatherNamespaces ( document ) ; document . setNamespace ( rootNamespace ) ; for ( org . openprovenance . prov . model . Bundle bu : utils . getBundle ( document ) ) { Namespace ns = bu . getNamespace ( ) ; if ( ns != null ) { ns ...
After reading a document this method should be called to ensure that Namespaces are properly chained .
133,066
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "INFORMED" ) public org . openprovenance . prov . model . QualifiedName getInformed ( ) { return informed ; }
Gets the value of the informed property .
133,067
@ ManyToOne ( targetEntity = org . openprovenance . prov . sql . QualifiedName . class , cascade = { CascadeType . ALL } ) @ JoinColumn ( name = "INFORMANT" ) public org . openprovenance . prov . model . QualifiedName getInformant ( ) { return informant ; }
Gets the value of the informant property .
133,068
public < T extends Relation > T add ( T statement , int num , Collection < T > anonRelationCollection , HashMap < QualifiedName , Collection < T > > namedRelationMap , HashMap < QualifiedName , Collection < T > > effectRelationMap , HashMap < QualifiedName , Collection < T > > causeRelationMap ) { QualifiedName aid2 = ...
Add an edge to the graph . Update namedRelationMap effectRelationMap and causeRelationMap accordingly . Edges with different attributes are considered distinct .
133,069
public Object marshal ( org . openprovenance . prov . model . Attribute attribute ) { return DOMProcessing . marshalAttribute ( attribute ) ; }
Marshals an Attribute to a DOM Element .
133,070
protected PGPSecretKey retrieveSecretKey ( PGPSecretKeyRingCollection secretKeyRingCollection , KeyFilter < PGPSecretKey > keyFilter ) throws PGPException { LOGGER . trace ( "retrieveSecretKey(PGPSecretKeyRingCollection, KeyFilter<PGPSecretKey>)" ) ; LOGGER . trace ( "Secret KeyRing Collection: {}, Key Filter: {}" , se...
retrieve the appropriate secret key from the secret key ring collection based on the key filter
133,071
protected PGPSecretKey findSecretKey ( InputStream secretKey , final long keyId ) throws IOException , PGPException { LOGGER . trace ( "findSecretKey(InputStream, long)" ) ; LOGGER . trace ( "Secret Key: {}, Key ID: {}" , secretKey == null ? "not set" : "set" , keyId ) ; return findSecretKey ( secretKey , new KeyFilter...
helper method to read a specific secret key
133,072
protected PGPSecretKey findSecretKey ( InputStream secretKey , KeyFilter < PGPSecretKey > keyFilter ) throws IOException , PGPException { LOGGER . trace ( "findSecretKey(InputStream, KeyFilter<PGPSecretKey>)" ) ; PGPSecretKey result = null ; LOGGER . debug ( "Wrapping secret key stream in ArmoredInputStream" ) ; try ( ...
reads the given secret key and applies the provided key filter
133,073
protected PGPPrivateKey findPrivateKey ( PGPSecretKey pgpSecretKey , String password ) throws PGPException { LOGGER . trace ( "findPrivateKey(PGPSecretKey, String)" ) ; LOGGER . trace ( "Secret Key: {}, Password: {}" , pgpSecretKey == null ? "not set" : "set" , password == null ? "not set" : "********" ) ; PGPPrivateKe...
read the private key from the given secret key
133,074
protected PGPPublicKey findPublicKey ( InputStream publicKey , KeyFilter < PGPPublicKey > keyFilter ) { LOGGER . trace ( "findPublicKey(InputStream, KeyFilter<PGPPublicKey>)" ) ; LOGGER . trace ( "Public Key: {}, Key Filter: {}" , publicKey == null ? "not set" : "set" , keyFilter == null ? "not set" : "set" ) ; return ...
reads the public key from the given stream
133,075
protected PGPPublicKey retrievePublicKey ( PGPPublicKeyRing publicKeyRing , KeyFilter < PGPPublicKey > keyFilter ) { LOGGER . trace ( "retrievePublicKey(PGPPublicKeyRing, KeyFilter<PGPPublicKey>)" ) ; PGPPublicKey result = null ; Iterator < PGPPublicKey > publicKeyIterator = publicKeyRing . getPublicKeys ( ) ; LOGGER ....
reads the PGP public key from a PublicKeyRing
133,076
protected PGPPublicKeyRing readPublicKeyRing ( InputStream publicKey ) { LOGGER . trace ( "readPublicKeyRing(InputStream)" ) ; PGPPublicKeyRing result = null ; LOGGER . debug ( "Wrapping public key stream in decoder stream" ) ; try ( InputStream decoderStream = PGPUtil . getDecoderStream ( publicKey ) ) { LOGGER . debu...
reads the public key ring from the input stream
133,077
public static void copy ( InputStream inputStream , OutputStream outputStream ) throws IOException { LOGGER . trace ( "copy(InputStream, OutputStream)" ) ; copy ( inputStream , outputStream , new byte [ BUFFER_SIZE ] ) ; }
copies the input stream to the output stream
133,078
public static void copy ( InputStream inputStream , OutputStream outputStream , byte [ ] buffer ) throws IOException { LOGGER . trace ( "copy(InputStream, OutputStream, byte[])" ) ; copy ( inputStream , outputStream , buffer , null ) ; }
copies the input stream to the output stream using a custom buffer size
133,079
public static void copy ( InputStream inputStream , final OutputStream outputStream , byte [ ] buffer , final StreamHandler addtionalHandling ) throws IOException { LOGGER . trace ( "copy(InputStream, OutputStream, byte[], StreamHandler)" ) ; LOGGER . debug ( "buffer size: {} bytes" , ( buffer != null ) ? buffer . leng...
copies the input stream to the output stream using a custom buffer size and applying additional stream handling
133,080
public static void process ( InputStream inputStream , StreamHandler handler ) throws IOException { LOGGER . trace ( "process(InputStream, StreamHandler)" ) ; process ( inputStream , handler , new byte [ BUFFER_SIZE ] ) ; }
generic processing of a stream
133,081
public static void process ( InputStream inputStream , StreamHandler handler , byte [ ] buffer ) throws IOException { LOGGER . trace ( "process(InputStream, StreamHandler, byte[])" ) ; LOGGER . debug ( "buffer size: {} bytes" , buffer != null ? buffer . length : "null" ) ; int read = - 1 ; while ( ( read = inputStream ...
generic processing of a stream with a custom buffer
133,082
private PGPKeyRingGenerator createKeyRingGenerator ( String userId , String password , int keySize ) { LOGGER . trace ( "createKeyRingGenerator(String, String, int)" ) ; LOGGER . trace ( "User ID: {}, Password: {}, Key Size: {}" , userId , password == null ? "not set" : "********" , keySize ) ; PGPKeyRingGenerator gene...
creates and initializes a PGP Key Ring Generator
133,083
@ CacheControl ( policy = { CachePolicy . MUST_REVALIDATE } , maxAge = 15 * 60 ) @ RequestMapping ( "/directions.do" ) public String handleProducDirectionsRequest ( Model model ) { model . addAttribute ( "pageName" , "Directions" ) ; return "page" ; }
Directions page allowing caching for 15 minutes but requiring re - revalidation before serving user a potentially stale resource .
133,084
@ CacheControl ( policy = { CachePolicy . PRIVATE , CachePolicy . MUST_REVALIDATE } ) @ RequestMapping ( "/account.do" ) public String handleAccountRequest ( Model model ) { model . addAttribute ( "pageName" , "Your Account" ) ; return "page" ; }
Personalized accounts page . Content is private to the user so it should only be stored in a private cache .
133,085
public void makeDisabled ( boolean b ) throws IOException { if ( disabled == b ) { return ; } this . disabled = b ; Collection < P > projects = getItems ( ) ; if ( b ) { if ( disabledSubProjects . isEmpty ( ) ) { for ( P project : projects ) { if ( project . isDisabled ( ) ) { disabledSubProjects . add ( project . getN...
Marks the build as disabled .
133,086
protected void init ( ) { for ( int i = 0 ; i < config . getFilter ( ) . getInclusions ( ) . size ( ) ; i ++ ) { inclusions . add ( Pattern . compile ( config . getFilter ( ) . getInclusions ( ) . get ( i ) ) . asPredicate ( ) ) ; } for ( int i = 0 ; i < config . getFilter ( ) . getExclusions ( ) . size ( ) ; i ++ ) { ...
This method initialises the filter .
133,087
public boolean isIncluded ( String endpoint ) { for ( int i = 0 ; i < inclusions . size ( ) ; i ++ ) { if ( inclusions . get ( i ) . test ( endpoint ) ) { return true ; } } return false ; }
This method determines whether the supplied endpoint should be included .
133,088
public boolean isExcluded ( String endpoint ) { for ( int i = 0 ; i < exclusions . size ( ) ; i ++ ) { if ( exclusions . get ( i ) . test ( endpoint ) ) { return true ; } } return false ; }
This method determines whether the supplied endpoint should be excluded .
133,089
public Message addContent ( String name , String type , String value ) { content . put ( name , new Content ( type , value ) ) ; return this ; }
This method adds new content .
133,090
public FragmentBuilder getFragmentBuilder ( ) { FragmentBuilder builder = builders . get ( ) ; if ( builder == null ) { if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Creating new FragmentBuilder" ) ; } builder = new FragmentBuilder ( ) ; builders . set ( builder ) ; int currentCount = threadCounter . inc...
This method returns the appropriate fragment builder for the current thread .
133,091
public void setFragmentBuilder ( FragmentBuilder builder ) { FragmentBuilder currentBuilder = builders . get ( ) ; if ( currentBuilder == null && builder != null ) { int currentCount = threadCounter . incrementAndGet ( ) ; int builderCount = builder . incrementThreadCount ( ) ; if ( log . isLoggable ( Level . FINEST ) ...
This method sets the builder for this thread of execution .
133,092
public void clear ( ) { int currentCount = threadCounter . decrementAndGet ( ) ; if ( log . isLoggable ( Level . FINEST ) ) { log . finest ( "Clear: Disassociate Thread from FragmentBuilder(1): current thread count=" + currentCount ) ; synchronized ( threadNames ) { threadNames . remove ( Thread . currentThread ( ) . g...
This method clears the trace fragment builder for the current thread of execution .
133,093
protected static List < Trace > internalQuery ( ElasticsearchClient client , String tenantId , Criteria criteria ) { List < Trace > ret = new ArrayList < Trace > ( ) ; String index = client . getIndex ( tenantId ) ; try { RefreshRequestBuilder refreshRequestBuilder = client . getClient ( ) . admin ( ) . indices ( ) . p...
This method performs the query .
133,094
public static void decodeProperties ( Set < PropertyCriteria > properties , String encoded ) { if ( encoded != null && ! encoded . trim ( ) . isEmpty ( ) ) { StringTokenizer st = new StringTokenizer ( encoded , "," ) ; while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; String [ ] parts = token . spl...
This method processes a comma separated list of properties defined as a name|value pair .
133,095
public static void decodeCorrelationIdentifiers ( Set < CorrelationIdentifier > correlations , String encoded ) { if ( encoded != null && ! encoded . trim ( ) . isEmpty ( ) ) { StringTokenizer st = new StringTokenizer ( encoded , "," ) ; while ( st . hasMoreTokens ( ) ) { String token = st . nextToken ( ) ; String [ ] ...
This method processes a comma separated list of correlation identifiers defined as a scope|value pair .
133,096
public static Reference findPrimaryReference ( List < Reference > references ) { List < Reference > followsFrom = references . stream ( ) . filter ( ref -> References . FOLLOWS_FROM . equals ( ref . getReferenceType ( ) ) && ref . getReferredTo ( ) instanceof APMSpan ) . collect ( Collectors . toList ( ) ) ; List < Ref...
This method identifies the primary parent reference that should be used to link the associated span to an existing trace instance .
133,097
protected void initTopLevelState ( APMSpan topSpan , TraceRecorder recorder , ContextSampler sampler ) { nodeBuilder = new NodeBuilder ( ) ; traceContext = new TraceContext ( topSpan , nodeBuilder , recorder , sampler ) ; }
This method initialises the node builder and trace context for a top level trace fragment .
133,098
protected void initFromExtractedTraceState ( APMSpanBuilder builder , TraceRecorder recorder , Reference ref , ContextSampler sampler ) { APMSpanBuilder parentBuilder = ( APMSpanBuilder ) ref . getReferredTo ( ) ; initTopLevelState ( this , recorder , sampler ) ; if ( parentBuilder . state ( ) . containsKey ( Constants...
This method initialises the span based on extracted trace state .
133,099
protected void initChildOf ( APMSpanBuilder builder , Reference ref ) { APMSpan parent = ( APMSpan ) ref . getReferredTo ( ) ; if ( parent . getNodeBuilder ( ) != null ) { nodeBuilder = new NodeBuilder ( parent . getNodeBuilder ( ) ) ; traceContext = parent . traceContext ; if ( parent . getTags ( ) . containsKey ( Con...
This method initialises the span based on a child - of relationship .