idx
int64
0
41.2k
question
stringlengths
74
4.04k
target
stringlengths
7
750
24,400
@ SuppressWarnings ( "UnusedReturnValue" ) public static String webread ( URL url ) throws IOException { StringBuilder result = new StringBuilder ( ) ; HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setRequestMethod ( "GET" ) ; BufferedReader rd = new BufferedReader ( new InputStreamReader ( conn . getInputStream ( ) ) ) ; String line ; while ( ( line = rd . readLine ( ) ) != null ) { result . append ( line ) ; } rd . close ( ) ; return result . toString ( ) ; }
Sends a GET request to url and retrieves the server response
24,401
public static void openInDefaultBrowser ( URL url ) throws IOException { Runtime rt = Runtime . getRuntime ( ) ; if ( SystemUtils . IS_OS_WINDOWS ) { rt . exec ( "rundll32 url.dll,FileProtocolHandler " + url ) ; } else if ( SystemUtils . IS_OS_MAC ) { rt . exec ( "open" + url ) ; } else { String [ ] browsers = { "epiphany" , "firefox" , "mozilla" , "konqueror" , "netscape" , "opera" , "links" , "lynx" } ; StringBuilder cmd = new StringBuilder ( ) ; for ( int i = 0 ; i < browsers . length ; i ++ ) cmd . append ( i == 0 ? "" : " || " ) . append ( browsers [ i ] ) . append ( " \"" ) . append ( url ) . append ( "\" " ) ; rt . exec ( new String [ ] { "sh" , "-c" , cmd . toString ( ) } ) ; } }
OPens the specified url in the default browser .
24,402
public String format ( Object expression , Object objPattern ) { if ( objPattern instanceof String ) { final String pattern = filterPattern ( ( String ) objPattern ) ; if ( expression == null ) { return null ; } if ( expression instanceof LocalDate ) { return create ( ( LocalDate ) expression ) . toDisp ( pattern ) ; } if ( expression instanceof LocalDateTime ) { return create ( ( LocalDateTime ) expression ) . toDisp ( pattern ) ; } if ( expression instanceof java . util . Date ) { return create ( ( java . util . Date ) expression ) . toDisp ( pattern ) ; } if ( expression instanceof String ) { return create ( ( String ) expression ) . toDisp ( pattern ) ; } String msg = "First argument as two arguments should be LocalDate or LocalDateTime or Date or String(expression): " + expression ; throw new TemplateProcessingException ( msg ) ; } String msg = "Second argument as two arguments should be String(pattern): objPattern=" + objPattern ; throw new TemplateProcessingException ( msg ) ; }
Get formatted date string .
24,403
private NodeMetadata enrich ( NodeMetadata nodeMetadata , Template template ) { final NodeMetadataBuilder nodeMetadataBuilder = NodeMetadataBuilder . fromNodeMetadata ( nodeMetadata ) ; if ( nodeMetadata . getHardware ( ) == null ) { nodeMetadataBuilder . hardware ( template . getHardware ( ) ) ; } if ( nodeMetadata . getImageId ( ) == null ) { nodeMetadataBuilder . imageId ( template . getImage ( ) . getId ( ) ) ; } if ( nodeMetadata . getLocation ( ) == null ) { nodeMetadataBuilder . location ( template . getLocation ( ) ) ; } return nodeMetadataBuilder . build ( ) ; }
Enriches the spawned vm with information of the template if the spawned vm does not contain information about hardware image or location
24,404
protected org . jclouds . compute . options . TemplateOptions modifyTemplateOptions ( VirtualMachineTemplate originalVirtualMachineTemplate , org . jclouds . compute . options . TemplateOptions originalTemplateOptions ) { return originalTemplateOptions ; }
Extension point for the template options . Allows the subclass to replace the jclouds template options object with a new one before it is passed to the template builder .
24,405
public boolean verify ( ) { this . errors = new LinkedList < > ( ) ; try ( BufferedReader reader = new BufferedReader ( new InputStreamReader ( generator . generate ( spaceId , ManifestFormat . TSV ) ) ) ) { WriteOnlyStringSet snapshotManifest = ManifestFileHelper . loadManifestSetFromFile ( this . md5Manifest ) ; log . info ( "loaded manifest set into memory." ) ; ManifestFormatter formatter = new TsvManifestFormatter ( ) ; if ( formatter . getHeader ( ) != null ) { reader . readLine ( ) ; } String line = null ; int stitchedManifestCount = 0 ; while ( ( line = reader . readLine ( ) ) != null ) { ManifestItem item = formatter . parseLine ( line ) ; String contentId = item . getContentId ( ) ; if ( ! contentId . equals ( Constants . SNAPSHOT_PROPS_FILENAME ) ) { if ( ! snapshotManifest . contains ( ManifestFileHelper . formatManifestSetString ( contentId , item . getContentChecksum ( ) ) ) ) { String message = "Snapshot manifest does not contain content id/checksum combination (" + contentId + ", " + item . getContentChecksum ( ) ; errors . add ( message ) ; } stitchedManifestCount ++ ; } } int snapshotCount = snapshotManifest . size ( ) ; if ( stitchedManifestCount != snapshotCount ) { String message = "Snapshot Manifest size (" + snapshotCount + ") does not equal DuraCloud Manifest (" + stitchedManifestCount + ")" ; errors . add ( message ) ; log . error ( message ) ; } } catch ( Exception e ) { String message = "Failed to verify space manifest against snapshot manifest:" + e . getMessage ( ) ; errors . add ( message ) ; log . error ( message , e ) ; } log . info ( "verification complete. error count = {}" , errors . size ( ) ) ; return getResult ( errors ) ; }
Performs the verification .
24,406
private static Identifiers handleIdentifiers ( String domainIdOrName , String projectIdOrName , String endpoint , String userId , String password ) { Set < Identifiers > possibleIdentifiers = new HashSet < Identifiers > ( ) { { add ( new Identifiers ( Identifier . byName ( domainIdOrName ) , Identifier . byName ( projectIdOrName ) ) ) ; add ( new Identifiers ( Identifier . byId ( domainIdOrName ) , Identifier . byId ( projectIdOrName ) ) ) ; add ( new Identifiers ( Identifier . byId ( domainIdOrName ) , Identifier . byName ( projectIdOrName ) ) ) ; add ( new Identifiers ( Identifier . byName ( domainIdOrName ) , Identifier . byId ( projectIdOrName ) ) ) ; } } ; for ( Identifiers candidate : possibleIdentifiers ) { try { authenticate ( endpoint , userId , password , candidate . getDomain ( ) , candidate . getProject ( ) ) ; } catch ( AuthenticationException | ClientResponseException e ) { continue ; } return candidate ; } return null ; }
This method tries to determine if the authentication should happen by using the user provided information as domain ID or domain name resp . project ID or project name .
24,407
protected void configure ( ) { bind ( DiscoveryService . class ) . to ( BaseDiscoveryService . class ) ; bind ( OperatingSystemDetectionStrategy . class ) . to ( NameSubstringBasedOperatingSystemDetectionStrategy . class ) ; }
Can be extended to load own implementation of classes .
24,408
public static Update update ( String key , Object value ) { return new Update ( ) . set ( key , value ) ; }
Static factory method to create an Update using the provided key
24,409
public static void encryptFields ( Object object , CollectionMetaData cmd , ICipher cipher ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException { for ( String secretAnnotatedFieldName : cmd . getSecretAnnotatedFieldNames ( ) ) { Method getterMethod = cmd . getGetterMethodForFieldName ( secretAnnotatedFieldName ) ; Method setterMethod = cmd . getSetterMethodForFieldName ( secretAnnotatedFieldName ) ; String value ; String encryptedValue = null ; try { value = ( String ) getterMethod . invoke ( object ) ; if ( null != value ) { encryptedValue = cipher . encrypt ( value ) ; setterMethod . invoke ( object , encryptedValue ) ; } } catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { logger . error ( "Error when invoking method for a @Secret annotated field" , e ) ; throw e ; } } }
A utility method to encrypt the value of field marked by the
24,410
public static void decryptFields ( Object object , CollectionMetaData cmd , ICipher cipher ) throws IllegalAccessException , IllegalArgumentException , InvocationTargetException { for ( String secretAnnotatedFieldName : cmd . getSecretAnnotatedFieldNames ( ) ) { Method getterMethod = cmd . getGetterMethodForFieldName ( secretAnnotatedFieldName ) ; Method setterMethod = cmd . getSetterMethodForFieldName ( secretAnnotatedFieldName ) ; String value ; String decryptedValue = null ; try { value = ( String ) getterMethod . invoke ( object ) ; if ( null != value ) { decryptedValue = cipher . decrypt ( value ) ; setterMethod . invoke ( object , decryptedValue ) ; } } catch ( IllegalAccessException | IllegalArgumentException | InvocationTargetException e ) { logger . error ( "Error when invoking method for a @Secret annotated field" , e ) ; throw e ; } } }
A utility method to decrypt the value of field marked by the
24,411
public static String generate128BitKey ( String password , String salt ) throws NoSuchAlgorithmException , UnsupportedEncodingException , InvalidKeySpecException { SecretKeyFactory factory = SecretKeyFactory . getInstance ( "PBKDF2WithHmacSHA256" ) ; KeySpec spec = new PBEKeySpec ( password . toCharArray ( ) , salt . getBytes ( ) , 65536 , 128 ) ; SecretKey key = factory . generateSecret ( spec ) ; byte [ ] keybyte = key . getEncoded ( ) ; return Base64 . getEncoder ( ) . encodeToString ( keybyte ) ; }
Utility method to help generate a strong 128 bit Key to be used for the DefaultAESCBCCipher .
24,412
public static CollectionSchemaUpdate update ( String key , IOperation operation ) { return new CollectionSchemaUpdate ( ) . set ( key , operation ) ; }
Static factory method to create an CollectionUpdate for the specified key
24,413
public CollectionSchemaUpdate set ( String key , IOperation operation ) { collectionUpdateData . put ( key , operation ) ; return this ; }
A method to set a new Operation for a key . It may be of type ADD RENAME or DELETE . Only one operation per key can be specified . Attempt to add a second operation for a any key will override the first one . Attempt to add a ADD operation for a key which already exists will have no effect . Attempt to add a DELETE operation for akey which does not exist will have no effect .
24,414
public Map < String , AddOperation > getAddOperations ( ) { Map < String , AddOperation > addOperations = new TreeMap < String , AddOperation > ( ) ; for ( Entry < String , IOperation > entry : collectionUpdateData . entrySet ( ) ) { String key = entry . getKey ( ) ; IOperation op = entry . getValue ( ) ; if ( op . getOperationType ( ) . equals ( Type . ADD ) ) { AddOperation aop = ( AddOperation ) op ; if ( null != aop . getDefaultValue ( ) ) { addOperations . put ( key , aop ) ; } } } return addOperations ; }
Returns a Map of ADD operations which have a non - null default value specified .
24,415
public Map < String , RenameOperation > getRenameOperations ( ) { Map < String , RenameOperation > renOperations = new TreeMap < String , RenameOperation > ( ) ; for ( Entry < String , IOperation > entry : collectionUpdateData . entrySet ( ) ) { String key = entry . getKey ( ) ; IOperation op = entry . getValue ( ) ; if ( op . getOperationType ( ) . equals ( Type . RENAME ) ) { renOperations . put ( key , ( RenameOperation ) op ) ; } } return renOperations ; }
Returns a Map of RENAME operations .
24,416
public Map < String , DeleteOperation > getDeleteOperations ( ) { Map < String , DeleteOperation > delOperations = new TreeMap < String , DeleteOperation > ( ) ; for ( Entry < String , IOperation > entry : collectionUpdateData . entrySet ( ) ) { String key = entry . getKey ( ) ; IOperation op = entry . getValue ( ) ; if ( op . getOperationType ( ) . equals ( Type . DELETE ) ) { delOperations . put ( key , ( DeleteOperation ) op ) ; } } return delOperations ; }
Returns a Map of DELETE operations .
24,417
protected static Object getIdForEntity ( Object document , Method getterMethodForId ) { Object id = null ; if ( null != getterMethodForId ) { try { id = getterMethodForId . invoke ( document ) ; } catch ( IllegalAccessException e ) { logger . error ( "Failed to invoke getter method for a idAnnotated field due to permissions" , e ) ; throw new InvalidJsonDbApiUsageException ( "Failed to invoke getter method for a idAnnotated field due to permissions" , e ) ; } catch ( IllegalArgumentException e ) { logger . error ( "Failed to invoke getter method for a idAnnotated field due to wrong arguments" , e ) ; throw new InvalidJsonDbApiUsageException ( "Failed to invoke getter method for a idAnnotated field due to wrong arguments" , e ) ; } catch ( InvocationTargetException e ) { logger . error ( "Failed to invoke getter method for a idAnnotated field, the method threw a exception" , e ) ; throw new InvalidJsonDbApiUsageException ( "Failed to invoke getter method for a idAnnotated field, the method threw a exception" , e ) ; } } return id ; }
A utility method to extract the value of field marked by the
24,418
protected static Object deepCopy ( Object fromBean ) { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; XMLEncoder out = new XMLEncoder ( bos ) ; out . writeObject ( fromBean ) ; out . close ( ) ; ByteArrayInputStream bis = new ByteArrayInputStream ( bos . toByteArray ( ) ) ; XMLDecoder in = new XMLDecoder ( bis , null , null , JsonDBTemplate . class . getClassLoader ( ) ) ; Object toBean = in . readObject ( ) ; in . close ( ) ; return toBean ; }
A utility method that creates a deep clone of the specified object . There is no other way of doing this reliably .
24,419
public static boolean stampVersion ( JsonDBConfig dbConfig , File f , String version ) { FileOutputStream fos = null ; OutputStreamWriter osr = null ; BufferedWriter writer = null ; try { fos = new FileOutputStream ( f ) ; osr = new OutputStreamWriter ( fos , dbConfig . getCharset ( ) ) ; writer = new BufferedWriter ( osr ) ; String versionData = dbConfig . getObjectMapper ( ) . writeValueAsString ( new SchemaVersion ( version ) ) ; writer . write ( versionData ) ; writer . newLine ( ) ; } catch ( JsonProcessingException e ) { logger . error ( "Failed to serialize SchemaVersion to Json string" , e ) ; return false ; } catch ( IOException e ) { logger . error ( "Failed to write SchemaVersion to the new .json file {}" , f , e ) ; return false ; } finally { try { writer . close ( ) ; } catch ( IOException e ) { logger . error ( "Failed to close BufferedWriter for new collection file {}" , f , e ) ; } try { osr . close ( ) ; } catch ( IOException e ) { logger . error ( "Failed to close OutputStreamWriter for new collection file {}" , f , e ) ; } try { fos . close ( ) ; } catch ( IOException e ) { logger . error ( "Failed to close FileOutputStream for new collection file {}" , f , e ) ; } } return true ; }
Utility to stamp the version into a newly created . json File This method is expected to be invoked on a newly created . json file before it is usable . So no locking code required .
24,420
public String decrypt ( String cipherText ) { this . decryptionLock . lock ( ) ; try { String decryptedValue = null ; try { byte [ ] bytes = Base64 . getDecoder ( ) . decode ( cipherText ) ; decryptedValue = new String ( decryptCipher . doFinal ( bytes ) , charset ) ; } catch ( UnsupportedEncodingException | IllegalBlockSizeException | BadPaddingException e ) { logger . error ( "DefaultAESCBCCipher failed to decrypt text" , e ) ; throw new JsonDBException ( "DefaultAESCBCCipher failed to decrypt text" , e ) ; } return decryptedValue ; } finally { this . decryptionLock . unlock ( ) ; } }
A method to decrypt the provided cipher text .
24,421
public int compare ( String expected , String actual ) { String [ ] vals1 = expected . split ( "\\." ) ; String [ ] vals2 = actual . split ( "\\." ) ; int i = 0 ; while ( i < vals1 . length && i < vals2 . length && vals1 [ i ] . equals ( vals2 [ i ] ) ) { i ++ ; } if ( i < vals1 . length && i < vals2 . length ) { int diff = Integer . valueOf ( vals1 [ i ] ) . compareTo ( Integer . valueOf ( vals2 [ i ] ) ) ; return Integer . signum ( diff ) ; } else { return Integer . signum ( vals1 . length - vals2 . length ) ; } }
compare the expected version with the actual version .
24,422
public static Keyword keyword ( Object o ) { if ( o instanceof Keyword ) return ( Keyword ) o ; else if ( o instanceof String ) { String s = ( String ) o ; if ( s . charAt ( 0 ) == ':' ) return new KeywordImpl ( s . substring ( 1 ) ) ; else return new KeywordImpl ( s ) ; } else throw new IllegalArgumentException ( "Cannot make keyword from " + o . getClass ( ) . getSimpleName ( ) ) ; }
Converts a string or keyword to a keyword
24,423
public static Symbol symbol ( Object o ) { if ( o instanceof Symbol ) return ( Symbol ) o ; else if ( o instanceof String ) { String s = ( String ) o ; if ( s . charAt ( 0 ) == ':' ) return new SymbolImpl ( s . substring ( 1 ) ) ; else return new SymbolImpl ( s ) ; } else throw new IllegalArgumentException ( "Cannot make symbol from " + o . getClass ( ) . getSimpleName ( ) ) ; }
Converts a string or a symbol to a symbol
24,424
public static < T > TaggedValue < T > taggedValue ( String tag , T rep ) { return new TaggedValueImpl < T > ( tag , rep ) ; }
Creates a TaggedValue
24,425
private long readNumber ( int firstChar , boolean isNeg ) throws IOException { out . unsafeWrite ( firstChar ) ; long v = '0' - firstChar ; int i ; for ( i = 0 ; i < 17 ; i ++ ) { int ch = getChar ( ) ; switch ( ch ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : v = v * 10 - ( ch - '0' ) ; out . unsafeWrite ( ch ) ; continue ; case '.' : out . unsafeWrite ( '.' ) ; valstate = readFrac ( out , 22 - i ) ; return 0 ; case 'e' : case 'E' : out . unsafeWrite ( ch ) ; nstate = 0 ; valstate = readExp ( out , 22 - i ) ; return 0 ; default : if ( ch != - 1 ) -- start ; valstate = LONG ; return isNeg ? v : - v ; } } boolean overflow = false ; long maxval = isNeg ? Long . MIN_VALUE : - Long . MAX_VALUE ; for ( ; i < 22 ; i ++ ) { int ch = getChar ( ) ; switch ( ch ) { case '0' : case '1' : case '2' : case '3' : case '4' : case '5' : case '6' : case '7' : case '8' : case '9' : if ( v < ( 0x8000000000000000L / 10 ) ) overflow = true ; v *= 10 ; int digit = ch - '0' ; if ( v < maxval + digit ) overflow = true ; v -= digit ; out . unsafeWrite ( ch ) ; continue ; case '.' : out . unsafeWrite ( '.' ) ; valstate = readFrac ( out , 22 - i ) ; return 0 ; case 'e' : case 'E' : out . unsafeWrite ( ch ) ; nstate = 0 ; valstate = readExp ( out , 22 - i ) ; return 0 ; default : if ( ch != - 1 ) -- start ; valstate = overflow ? BIGNUMBER : LONG ; return isNeg ? v : - v ; } } nstate = 0 ; valstate = BIGNUMBER ; return 0 ; }
Returns the long read ... only significant if valstate == LONG after this call . firstChar should be the first numeric digit read .
24,426
private int readFrac ( CharArr arr , int lim ) throws IOException { nstate = HAS_FRACTION ; while ( -- lim >= 0 ) { int ch = getChar ( ) ; if ( ch >= '0' && ch <= '9' ) { arr . write ( ch ) ; } else if ( ch == 'e' || ch == 'E' ) { arr . write ( ch ) ; return readExp ( arr , lim ) ; } else { if ( ch != - 1 ) start -- ; return NUMBER ; } } return BIGNUMBER ; }
read digits right of decimal point
24,427
private int readExp ( CharArr arr , int lim ) throws IOException { nstate |= HAS_EXPONENT ; int ch = getChar ( ) ; lim -- ; if ( ch == '+' || ch == '-' ) { arr . write ( ch ) ; ch = getChar ( ) ; lim -- ; } if ( ch < '0' || ch > '9' ) { throw err ( "missing exponent number" ) ; } arr . write ( ch ) ; return readExpDigits ( arr , lim ) ; }
call after e or E has been seen to read the rest of the exponent
24,428
private int readExpDigits ( CharArr arr , int lim ) throws IOException { while ( -- lim >= 0 ) { int ch = getChar ( ) ; if ( ch >= '0' && ch <= '9' ) { arr . write ( ch ) ; } else { if ( ch != - 1 ) start -- ; return NUMBER ; } } return BIGNUMBER ; }
continuation of readExpStart
24,429
private char readEscapedChar ( ) throws IOException { int ch = getChar ( ) ; switch ( ch ) { case '"' : return '"' ; case '\'' : return '\'' ; case '\\' : return '\\' ; case '/' : return '/' ; case 'n' : return '\n' ; case 'r' : return '\r' ; case 't' : return '\t' ; case 'f' : return '\f' ; case 'b' : return '\b' ; case 'u' : return ( char ) ( ( hexval ( getChar ( ) ) << 12 ) | ( hexval ( getChar ( ) ) << 8 ) | ( hexval ( getChar ( ) ) << 4 ) | ( hexval ( getChar ( ) ) ) ) ; } if ( ( flags & ALLOW_BACKSLASH_ESCAPING_ANY_CHARACTER ) != 0 && ch != EOF ) { return ( char ) ch ; } throw err ( "Invalid character escape" ) ; }
backslash has already been read when this is called
24,430
private void readStringChars2 ( CharArr arr , int middle ) throws IOException { if ( stringTerm == 0 ) { readStringBare ( arr ) ; return ; } char terminator = ( char ) stringTerm ; for ( ; ; ) { if ( middle >= end ) { arr . write ( buf , start , middle - start ) ; start = middle ; getMore ( ) ; middle = start ; } int ch = buf [ middle ++ ] ; if ( ch == terminator ) { int len = middle - start - 1 ; if ( len > 0 ) arr . write ( buf , start , len ) ; start = middle ; return ; } else if ( ch == '\\' ) { int len = middle - start - 1 ; if ( len > 0 ) arr . write ( buf , start , len ) ; start = middle ; arr . write ( readEscapedChar ( ) ) ; middle = start ; } } }
this should be faster for strings with fewer escapes but probably slower for many escapes .
24,431
public void getNumberChars ( CharArr output ) throws IOException { int ev = 0 ; if ( valstate == 0 ) ev = nextEvent ( ) ; if ( valstate == LONG || valstate == NUMBER ) output . write ( this . out ) ; else if ( valstate == BIGNUMBER ) { continueNumber ( output ) ; } else { throw err ( "Unexpected " + ev ) ; } valstate = 0 ; }
Reads a JSON numeric value into the output .
24,432
public long parseLong ( char [ ] arr , int start , int end ) { long x = 0 ; boolean negative = arr [ start ] == '-' ; for ( int i = negative ? start + 1 : start ; i < end ; i ++ ) { x = x * 10 + ( arr [ i ] - '0' ) ; } return negative ? - x : x ; }
belongs in number utils or charutil?
24,433
protected SocketFactory createSocketFactory ( InetAddress address , int port , InetAddress localAddr , int localPort , long timeout ) { SocketFactory factory ; factory = new PlainSocketFactory ( address , port , localAddr , localPort , timeout ) ; factory = new PooledSocketFactory ( factory ) ; factory = new LazySocketFactory ( factory ) ; return factory ; }
Create socket factories for newly resolved addresses . Default implementation returns a LazySocketFactory wrapping a PooledSocketFactory wrapping a PlainSocketFactory .
24,434
public String encodeIntArray ( int [ ] input ) throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream ( ) ; DataOutputStream dos = new DataOutputStream ( bos ) ; int length = input . length ; dos . writeInt ( length ) ; for ( int i = 0 ; i < length ; i ++ ) { dos . writeInt ( input [ i ] ) ; } return new String ( Base64 . encodeBase64URLSafe ( bos . toByteArray ( ) ) ) ; }
Encode the given integer array into Base64 format .
24,435
public int [ ] decodeIntArray ( String input ) throws IOException { int [ ] result = null ; ByteArrayInputStream bis = new ByteArrayInputStream ( Base64 . decodeBase64 ( input ) ) ; DataInputStream dis = new DataInputStream ( bis ) ; int length = dis . readInt ( ) ; result = new int [ length ] ; for ( int i = 0 ; i < length ; i ++ ) { result [ i ] = dis . readInt ( ) ; } return result ; }
Decode the given Base64 encoded value into an integer array .
24,436
public String decodeHexToString ( String str ) throws DecoderException { String result = null ; byte [ ] bytes = Hex . decodeHex ( str . toCharArray ( ) ) ; if ( bytes != null && bytes . length > 0 ) { result = new String ( bytes ) ; } return result ; }
Decode the given hexidecimal formatted value into a string representing the bytes of the decoded value .
24,437
public String getName ( ) { FeatureDescriptor fd = getFeatureDescriptor ( ) ; if ( fd == null ) { return null ; } return fd . getName ( ) ; }
Returns the feature name
24,438
public String getDescription ( ) { FeatureDescriptor fd = getFeatureDescriptor ( ) ; if ( fd == null ) { return "" ; } return getTeaToolsUtils ( ) . getDescription ( fd ) ; }
Returns the shortDescription or if the shortDescription is the same as the displayName .
24,439
public String getQualifiedTypeNameForFile ( ) { String typeName = getTypeNameForFile ( ) ; String qualifiedTypeName = mDoc . qualifiedTypeName ( ) ; int packageLength = qualifiedTypeName . length ( ) - typeName . length ( ) ; if ( packageLength <= 0 ) { return typeName ; } String packagePath = qualifiedTypeName . substring ( 0 , packageLength ) ; return packagePath + typeName ; }
Converts inner class names .
24,440
public MethodDoc getMatchingMethod ( MethodDoc method ) { MethodDoc [ ] methods = getMethods ( ) ; for ( int i = 0 ; i < methods . length ; i ++ ) { if ( method . getName ( ) . equals ( methods [ i ] . getName ( ) ) && method . getSignature ( ) . equals ( methods [ i ] . getSignature ( ) ) ) { return methods [ i ] ; } } return null ; }
Get a MethodDoc in this ClassDoc with a name and signature matching that of the specified MethodDoc
24,441
public MethodDoc getMatchingMethod ( MethodDoc method , MethodFinder mf ) { MethodDoc md = getMatchingMethod ( method ) ; if ( md != null ) { if ( mf . checkMethod ( md ) ) { return md ; } } return null ; }
Get a MethodDoc in this ClassDoc with a name and signature matching that of the specified MethodDoc and accepted by the specified MethodFinder
24,442
public MethodDoc findMatchingMethod ( MethodDoc method , MethodFinder mf ) { MethodDoc md = findMatchingInterfaceMethod ( method , mf ) ; if ( md != null ) { return md ; } ClassDoc superClass = getSuperclass ( ) ; if ( superClass != null ) { md = superClass . getMatchingMethod ( method , mf ) ; if ( md != null ) { return md ; } return superClass . findMatchingMethod ( method , mf ) ; } return null ; }
Find a MethodDoc with a name and signature matching that of the specified MethodDoc and accepted by the specified MethodFinder . This method searches the interfaces and super class ancestry of the class represented by this ClassDoc for a matching method .
24,443
public String getTagValue ( String tagName ) { Tag [ ] tags = getTagMap ( ) . get ( tagName ) ; if ( tags == null || tags . length == 0 ) { return null ; } return tags [ tags . length - 1 ] . getText ( ) ; }
Gets the text value of the first tag in doc that matches tagName
24,444
public static Map < String , PropertyDescriptor > getAllProperties ( GenericType root ) throws IntrospectionException { Map < String , PropertyDescriptor > properties = cPropertiesCache . get ( root ) ; if ( properties == null ) { GenericType rootType = root . getRootType ( ) ; if ( rootType == null ) { rootType = root ; } properties = Collections . unmodifiableMap ( createProperties ( rootType , root ) ) ; cPropertiesCache . put ( root , properties ) ; } return properties ; }
A function that returns a Map of all the available properties on a given class including write - only properties . The properties returned is mostly a superset of those returned from the standard JavaBeans Introspector except pure indexed properties are discarded .
24,445
public static String findTemplateName ( org . teatrove . tea . compiler . Scanner scanner ) { Token token ; String name = null ; try { while ( ( ( token = scanner . readToken ( ) ) . getID ( ) ) != Token . EOF ) { if ( token . getID ( ) == Token . TEMPLATE ) { token = scanner . readToken ( ) ; if ( token . getID ( ) == Token . IDENT ) { name = token . getStringValue ( ) ; } break ; } } } catch ( IOException ioe ) { ioe . printStackTrace ( ) ; } return name ; }
Finds the name of the template using the specified tea scanner .
24,446
public Template parseTeaTemplate ( String templateName ) throws IOException { if ( templateName == null ) { return null ; } preserveParseTree ( templateName ) ; compile ( templateName ) ; CompilationUnit unit = getCompilationUnit ( templateName , null ) ; if ( unit == null ) { return null ; } return unit . getParseTree ( ) ; }
Perform Tea parsing . This method will compile the named template .
24,447
public boolean isValueKnown ( ) { Type type = getType ( ) ; if ( type != null ) { Class < ? > clazz = type . getObjectClass ( ) ; return Number . class . isAssignableFrom ( clazz ) || clazz . isAssignableFrom ( Number . class ) ; } else { return false ; } }
Value is known only if type is a number or can be assigned a number .
24,448
public Object [ ] cloneArray ( Object [ ] array ) { Class < ? > clazz = array . getClass ( ) . getComponentType ( ) ; Object newArray = Array . newInstance ( clazz , array . length ) ; System . arraycopy ( array , 0 , newArray , 0 , array . length ) ; return ( Object [ ] ) newArray ; }
Clone the given array into a new instance of the same type and dimensions . The values are directly copied by memory so this is not a deep clone operation . However manipulation of the contents of the array will not impact the given array .
24,449
public HttpClient setHeader ( String name , Object value ) { if ( mHeaders == null ) { mHeaders = new HttpHeaderMap ( ) ; } mHeaders . put ( name , value ) ; return this ; }
Set a header name - value pair to the request .
24,450
public HttpClient addHeader ( String name , Object value ) { if ( mHeaders == null ) { mHeaders = new HttpHeaderMap ( ) ; } mHeaders . add ( name , value ) ; return this ; }
Add a header name - value pair to the request in order for multiple values to be specified .
24,451
public Response getResponse ( PostData postData ) throws ConnectException , SocketException { CheckedSocket socket = mFactory . getSocket ( mSession ) ; try { CharToByteBuffer request = new FastCharToByteBuffer ( new DefaultByteBuffer ( ) , "8859_1" ) ; request = new InternedCharToByteBuffer ( request ) ; request . append ( mMethod ) ; request . append ( ' ' ) ; request . append ( mURI ) ; request . append ( ' ' ) ; request . append ( mProtocol ) ; request . append ( "\r\n" ) ; if ( mHeaders != null ) { mHeaders . appendTo ( request ) ; } request . append ( "\r\n" ) ; Response response ; try { response = sendRequest ( socket , request , postData ) ; } catch ( InterruptedIOException e ) { throw e ; } catch ( IOException e ) { response = null ; } if ( response == null ) { try { socket . close ( ) ; } catch ( IOException e ) { } socket = mFactory . createSocket ( mSession ) ; response = sendRequest ( socket , request , postData ) ; if ( response == null ) { throw new ConnectException ( "No response from server " + socket . getInetAddress ( ) + ":" + socket . getPort ( ) ) ; } } return response ; } catch ( SocketException e ) { throw e ; } catch ( InterruptedIOException e ) { throw new ConnectException ( "Read timeout expired: " + mReadTimeout + ", " + e ) ; } catch ( IOException e ) { throw new SocketException ( e . toString ( ) ) ; } }
Opens a connection passes on the current request settings and returns the server s response . The optional PostData parameter is used to supply post data to the server . The Content - Length header specifies how much data will be read from the PostData InputStream . If it is not specified data will be read from the InputStream until EOF is reached .
24,452
public void addRootLogListener ( LogListener listener ) { if ( mParent == null ) { addLogListener ( listener ) ; } else { mParent . addRootLogListener ( listener ) ; } }
adds a listener to the root log the log with a null parent
24,453
public void debug ( String s ) { if ( isEnabled ( ) && isDebugEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . DEBUG_TYPE , s ) ) ; } }
Simple method for logging a single debugging message .
24,454
public void debug ( Throwable t ) { if ( isEnabled ( ) && isDebugEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . DEBUG_TYPE , t ) ) ; } }
Simple method for logging a single debugging exception .
24,455
public void info ( String s ) { if ( isEnabled ( ) && isInfoEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . INFO_TYPE , s ) ) ; } }
Simple method for logging a single information message .
24,456
public void info ( Throwable t ) { if ( isEnabled ( ) && isInfoEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . INFO_TYPE , t ) ) ; } }
Simple method for logging a single information exception .
24,457
public void warn ( String s ) { if ( isEnabled ( ) && isWarnEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . WARN_TYPE , s ) ) ; } }
Simple method for logging a single warning message .
24,458
public void warn ( Throwable t ) { if ( isEnabled ( ) && isWarnEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . WARN_TYPE , t ) ) ; } }
Simple method for logging a single warning exception .
24,459
public void error ( String s ) { if ( isEnabled ( ) && isErrorEnabled ( ) ) { dispatchLogMessage ( new LogEvent ( this , LogEvent . ERROR_TYPE , s ) ) ; } }
Simple method for logging a single error message .
24,460
public void error ( Throwable t ) { if ( isEnabled ( ) && isErrorEnabled ( ) ) { dispatchLogException ( new LogEvent ( this , LogEvent . ERROR_TYPE , t ) ) ; } }
Simple method for logging a single error exception .
24,461
public Log [ ] getChildren ( ) { Collection copy ; synchronized ( mChildren ) { copy = new ArrayList ( mChildren . size ( ) ) ; Iterator it = mChildren . iterator ( ) ; while ( it . hasNext ( ) ) { Log child = ( Log ) ( ( WeakReference ) it . next ( ) ) . get ( ) ; if ( child == null ) { it . remove ( ) ; } else { copy . add ( child ) ; } } } return ( Log [ ] ) copy . toArray ( new Log [ copy . size ( ) ] ) ; }
Returns a copy of the children Logs .
24,462
public void setEnabled ( boolean enabled ) { setEnabled ( enabled , ENABLED_MASK ) ; if ( enabled ) { Log parent ; if ( ( parent = mParent ) != null ) { parent . setEnabled ( true ) ; } } }
When this Log is enabled all parent Logs are also enabled . When this Log is disabled parent Logs are unaffected .
24,463
public void applyProperties ( Map properties ) { if ( properties . containsKey ( "enabled" ) ) { setEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "enabled" ) ) ) ; } if ( properties . containsKey ( "debug" ) ) { setDebugEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "debug" ) ) ) ; } if ( properties . containsKey ( "info" ) ) { setInfoEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "info" ) ) ) ; } if ( properties . containsKey ( "warn" ) ) { setWarnEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "warn" ) ) ) ; } if ( properties . containsKey ( "error" ) ) { setErrorEnabled ( ! "false" . equalsIgnoreCase ( ( String ) properties . get ( "error" ) ) ) ; } }
Understands and applies the following boolean properties . True is the default value if the value doesn t equal false ignoring case .
24,464
private static PropertyDescriptor [ ] [ ] getBeanProperties ( Class < ? > beanType ) { List < PropertyDescriptor > readProperties = new ArrayList < PropertyDescriptor > ( ) ; List < PropertyDescriptor > writeProperties = new ArrayList < PropertyDescriptor > ( ) ; try { Map < ? , ? > map = CompleteIntrospector . getAllProperties ( beanType ) ; Iterator < ? > it = map . values ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { PropertyDescriptor pd = ( PropertyDescriptor ) it . next ( ) ; if ( pd . getReadMethod ( ) != null ) { readProperties . add ( pd ) ; } if ( pd . getWriteMethod ( ) != null ) { writeProperties . add ( pd ) ; } } } catch ( IntrospectionException e ) { throw new RuntimeException ( e . toString ( ) ) ; } PropertyDescriptor [ ] [ ] props = new PropertyDescriptor [ 2 ] [ ] ; props [ 0 ] = new PropertyDescriptor [ readProperties . size ( ) ] ; readProperties . toArray ( props [ 0 ] ) ; props [ 1 ] = new PropertyDescriptor [ writeProperties . size ( ) ] ; writeProperties . toArray ( props [ 1 ] ) ; return props ; }
Returns two arrays of PropertyDescriptors . Array 0 has contains read PropertyDescriptors array 1 contains the write PropertyDescriptors .
24,465
static void writeShort ( OutputStream out , int i ) throws IOException { out . write ( ( byte ) i ) ; out . write ( ( byte ) ( i >> 8 ) ) ; }
Writes a short in Intel byte order .
24,466
void appendCompressed ( ByteData compressed , ByteData original ) throws IOException { mCompressedSegments ++ ; mBuffer . appendSurrogate ( new CompressedData ( compressed , original ) ) ; }
Called from DetachedResponseImpl .
24,467
public static int toDecimalDigits ( float v , char [ ] digits , int offset , int maxDigits , int maxFractDigits , int roundMode ) { int bits = Float . floatToIntBits ( v ) ; int f = bits & 0x7fffff ; int e = ( bits >> 23 ) & 0xff ; if ( e != 0 ) { return toDecimalDigits ( f + 0x800000 , e - 126 , 24 , digits , offset , maxDigits , maxFractDigits , roundMode ) ; } else { return toDecimalDigits ( f , - 125 , 23 , digits , offset , maxDigits , maxFractDigits , roundMode ) ; } }
Produces decimal digits for non - zero finite floating point values . The sign of the value is discarded . Passing in Infinity or NaN produces invalid digits . The maximum number of decimal digits that this function will likely produce is 9 .
24,468
public static int toDecimalDigits ( double v , char [ ] digits , int offset , int maxDigits , int maxFractDigits , int roundMode ) { long bits = Double . doubleToLongBits ( v ) ; long f = bits & 0xfffffffffffffL ; int e = ( int ) ( ( bits >> 52 ) & 0x7ff ) ; if ( e != 0 ) { return toDecimalDigits ( f + 0x10000000000000L , e - 1022 , 53 , digits , offset , maxDigits , maxFractDigits , roundMode ) ; } else { return toDecimalDigits ( f , - 1023 , 52 , digits , offset , maxDigits , maxFractDigits , roundMode ) ; } }
Produces decimal digits for non - zero finite floating point values . The sign of the value is discarded . Passing in Infinity or NaN produces invalid digits . The maximum number of decimal digits that this function will likely produce is 18 .
24,469
public TransactionQueueData add ( TransactionQueueData data ) { return new TransactionQueueData ( null , Math . min ( mSnapshotStart , data . mSnapshotStart ) , Math . max ( mSnapshotEnd , data . mSnapshotEnd ) , mQueueSize + data . mQueueSize , mThreadCount + data . mThreadCount , mServicingCount + data . mServicingCount , Math . max ( mPeakQueueSize , data . mPeakQueueSize ) , Math . max ( mPeakThreadCount , data . mPeakThreadCount ) , Math . max ( mPeakServicingCount , data . mPeakServicingCount ) , mTotalEnqueueAttempts + data . mTotalEnqueueAttempts , mTotalEnqueued + data . mTotalEnqueued , mTotalServiced + data . mTotalServiced , mTotalExpired + data . mTotalExpired , mTotalServiceExceptions + data . mTotalServiceExceptions , mTotalUncaughtExceptions + data . mTotalUncaughtExceptions , mTotalQueueDuration + data . mTotalQueueDuration , mTotalServiceDuration + data . mTotalServiceDuration ) ; }
Adds TransactionQueueData to another .
24,470
public Object get ( Object key ) { Object value = mCacheMap . get ( key ) ; if ( value != null || mCacheMap . containsKey ( key ) ) { return value ; } value = mBackingMap . get ( key ) ; if ( value != null || mBackingMap . containsKey ( key ) ) { mCacheMap . put ( key , value ) ; } return value ; }
Returns the value from the cache or if not found the backing map . If the backing map is accessed the value is saved in the cache for future gets .
24,471
public Object put ( Object key , Object value ) { mCacheMap . put ( key , value ) ; return mBackingMap . put ( key , value ) ; }
Puts the entry into both the cache and backing map . The old value in the backing map is returned .
24,472
public Object remove ( Object key ) { mCacheMap . remove ( key ) ; return mBackingMap . remove ( key ) ; }
Removes the key from both the cache and backing map . The old value in the backing map is returned .
24,473
public Plugin getPlugin ( String name ) { if ( mPluginContext != null ) { return mPluginContext . getPlugin ( name ) ; } return null ; }
Returns a Plugin by name .
24,474
public Plugin [ ] getPlugins ( ) { if ( mPluginContext != null ) { Collection c = mPluginContext . getPlugins ( ) . values ( ) ; if ( c != null ) { return ( Plugin [ ] ) c . toArray ( new Plugin [ c . size ( ) ] ) ; } } return new Plugin [ 0 ] ; }
Returns an array of all of the Plugins .
24,475
public boolean isOwnedBy ( String possibleOwner ) { boolean retval = false ; if ( this . owner != null ) { retval = ( this . owner . compareTo ( possibleOwner ) == 0 ) ; } return retval ; }
Convenience function for comparing possibleOwner against this . owner
24,476
public void deleteAtManagementGroup ( String policySetDefinitionName , String managementGroupId ) { deleteAtManagementGroupWithServiceResponseAsync ( policySetDefinitionName , managementGroupId ) . toBlocking ( ) . single ( ) . body ( ) ; }
Deletes a policy set definition . This operation deletes the policy set definition in the given management group with the given name .
24,477
public void delete ( String resourceGroupName , String workflowName ) { deleteWithServiceResponseAsync ( resourceGroupName , workflowName ) . toBlocking ( ) . single ( ) . body ( ) ; }
Deletes a workflow .
24,478
public Observable < Page < WorkflowInner > > listByResourceGroupNextAsync ( final String nextPageLink ) { return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < WorkflowInner > > , Page < WorkflowInner > > ( ) { public Page < WorkflowInner > call ( ServiceResponse < Page < WorkflowInner > > response ) { return response . body ( ) ; } } ) ; }
Gets a list of workflows by resource group .
24,479
public Observable < Page < ClusterInner > > listByResourceGroupAsync ( String resourceGroupName ) { return listByResourceGroupWithServiceResponseAsync ( resourceGroupName ) . map ( new Func1 < ServiceResponse < List < ClusterInner > > , Page < ClusterInner > > ( ) { public Page < ClusterInner > call ( ServiceResponse < List < ClusterInner > > response ) { PageImpl < ClusterInner > page = new PageImpl < > ( ) ; page . setItems ( response . body ( ) ) ; return page ; } } ) ; }
Lists all Kusto clusters within a resource group .
24,480
public static EntityGetOperation < AssetDeliveryPolicyInfo > get ( String assetDeliveryPolicyId ) { return new DefaultGetOperation < AssetDeliveryPolicyInfo > ( ENTITY_SET , assetDeliveryPolicyId , AssetDeliveryPolicyInfo . class ) ; }
Create an operation that will retrieve the given asset delivery policy
24,481
public static DefaultListOperation < AssetDeliveryPolicyInfo > list ( LinkInfo < AssetDeliveryPolicyInfo > link ) { return new DefaultListOperation < AssetDeliveryPolicyInfo > ( link . getHref ( ) , new GenericType < ListResult < AssetDeliveryPolicyInfo > > ( ) { } ) ; }
Create an operation that will list all the asset delivery policies at the given link .
24,482
public Observable < AdvisorListResultInner > listByDatabaseAsync ( String resourceGroupName , String serverName , String databaseName ) { return listByDatabaseWithServiceResponseAsync ( resourceGroupName , serverName , databaseName ) . map ( new Func1 < ServiceResponse < AdvisorListResultInner > , AdvisorListResultInner > ( ) { public AdvisorListResultInner call ( ServiceResponse < AdvisorListResultInner > response ) { return response . body ( ) ; } } ) ; }
Returns a list of database advisors .
24,483
public AdvisorInner createOrUpdate ( String resourceGroupName , String serverName , String databaseName , String advisorName , AutoExecuteStatus autoExecuteValue ) { return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , advisorName , autoExecuteValue ) . toBlocking ( ) . single ( ) . body ( ) ; }
Creates or updates a database advisor .
24,484
public static MSICredentials getMSICredentials ( String managementEndpoint ) { String websiteName = System . getenv ( "WEBSITE_SITE_NAME" ) ; if ( websiteName != null && ! websiteName . isEmpty ( ) ) { MSIConfigurationForAppService config = new MSIConfigurationForAppService ( managementEndpoint ) ; return forAppService ( config ) ; } else { MSIConfigurationForVirtualMachine config = new MSIConfigurationForVirtualMachine ( managementEndpoint ) ; return forVirtualMachine ( config ) ; } }
This method checks if the env vars MSI_ENDPOINT and MSI_SECRET exist . If they do we return the msi creds class for APP Svcs otherwise we return one for VM
24,485
T unsafeGetIfOpened ( ) { if ( innerObject != null && innerObject . getState ( ) == IOObject . IOObjectState . OPENED ) { return innerObject ; } return null ; }
should be invoked from reactor thread
24,486
public void delete ( String resourceGroupName , String registryName , String taskName ) { deleteWithServiceResponseAsync ( resourceGroupName , registryName , taskName ) . toBlocking ( ) . last ( ) . body ( ) ; }
Deletes a specified task .
24,487
public static void main ( String [ ] args ) throws NoSuchAlgorithmException , InvalidKeyException { final String connectionString = "endpoint={endpoint_value};id={id_value};name={secret_value}" ; final HttpMethodRequestTracker tracker = new HttpMethodRequestTracker ( ) ; final ConfigurationAsyncClient client = ConfigurationAsyncClient . builder ( ) . credentials ( new ConfigurationClientCredentials ( connectionString ) ) . addPolicy ( new HttpMethodRequestTrackingPolicy ( tracker ) ) . httpLogDetailLevel ( HttpLogDetailLevel . HEADERS ) . build ( ) ; final List < ConfigurationSetting > settings = Flux . concat ( client . addSetting ( new ConfigurationSetting ( ) . key ( "hello" ) . value ( "world" ) ) , client . setSetting ( new ConfigurationSetting ( ) . key ( "newSetting" ) . value ( "newValue" ) ) ) . then ( client . listSettings ( new SettingSelector ( ) . key ( "*" ) ) . collectList ( ) ) . block ( ) ; final Stream < ConfigurationSetting > stream = settings == null ? Stream . empty ( ) : settings . stream ( ) ; Flux . merge ( stream . map ( client :: deleteSetting ) . collect ( Collectors . toList ( ) ) ) . blockLast ( ) ; tracker . print ( ) ; }
Runs the sample algorithm and demonstrates how to add a custom policy to the HTTP pipeline .
24,488
public ConnectionStringBuilder setEndpoint ( String namespaceName , String domainName ) { try { this . endpoint = new URI ( String . format ( Locale . US , END_POINT_FORMAT , namespaceName , domainName ) ) ; } catch ( URISyntaxException exception ) { throw new IllegalConnectionStringFormatException ( String . format ( Locale . US , "Invalid namespace name: %s" , namespaceName ) , exception ) ; } return this ; }
Set an endpoint which can be used to connect to the EventHub instance .
24,489
public void marshalEntry ( Object content , OutputStream stream ) throws JAXBException { marshaller . marshal ( createEntry ( content ) , stream ) ; }
Convert the given content into an ATOM entry and write it to the given stream .
24,490
public Observable < Page < VaultInner > > listByResourceGroupAsync ( final String resourceGroupName , final Integer top ) { return listByResourceGroupWithServiceResponseAsync ( resourceGroupName , top ) . map ( new Func1 < ServiceResponse < Page < VaultInner > > , Page < VaultInner > > ( ) { public Page < VaultInner > call ( ServiceResponse < Page < VaultInner > > response ) { return response . body ( ) ; } } ) ; }
The List operation gets information about the vaults associated with the subscription and within the specified resource group .
24,491
public void setData ( String key , Object value ) { this . data = this . data . addData ( key , value ) ; }
Stores a key - value data in the context .
24,492
private void resetInputStreams ( ) throws IOException , MessagingException { for ( int ix = 0 ; ix < this . getCount ( ) ; ix ++ ) { BodyPart part = this . getBodyPart ( ix ) ; if ( part . getContent ( ) instanceof MimeMultipart ) { MimeMultipart subContent = ( MimeMultipart ) part . getContent ( ) ; for ( int jx = 0 ; jx < subContent . getCount ( ) ; jx ++ ) { BodyPart subPart = subContent . getBodyPart ( jx ) ; if ( subPart . getContent ( ) instanceof ByteArrayInputStream ) { ( ( ByteArrayInputStream ) subPart . getContent ( ) ) . reset ( ) ; } } } } }
reset all input streams to allow redirect filter to write the output twice
24,493
public Observable < Page < IntegrationAccountSessionInner > > listByIntegrationAccountsNextAsync ( final String nextPageLink ) { return listByIntegrationAccountsNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < IntegrationAccountSessionInner > > , Page < IntegrationAccountSessionInner > > ( ) { public Page < IntegrationAccountSessionInner > call ( ServiceResponse < Page < IntegrationAccountSessionInner > > response ) { return response . body ( ) ; } } ) ; }
Gets a list of integration account sessions .
24,494
public static JWSObject deserialize ( String json ) throws IOException { ObjectMapper mapper = new ObjectMapper ( ) ; return mapper . readValue ( json , JWSObject . class ) ; }
Construct JWSObject from json string .
24,495
public KeyIdentifier keyIdentifier ( ) { if ( key ( ) == null || key ( ) . kid ( ) == null || key ( ) . kid ( ) . length ( ) == 0 ) { return null ; } return new KeyIdentifier ( key ( ) . kid ( ) ) ; }
The key identifier .
24,496
public Map < String , String > getCachedChallenge ( HttpUrl url ) { if ( url == null ) { return null ; } String authority = getAuthority ( url ) ; authority = authority . toLowerCase ( Locale . ENGLISH ) ; return cachedChallenges . get ( authority ) ; }
Uses authority to retrieve the cached values .
24,497
public void addCachedChallenge ( HttpUrl url , Map < String , String > challenge ) { if ( url == null || challenge == null ) { return ; } String authority = getAuthority ( url ) ; authority = authority . toLowerCase ( Locale . ENGLISH ) ; cachedChallenges . put ( authority , challenge ) ; }
Uses authority to cache challenge .
24,498
public String getAuthority ( HttpUrl url ) { String scheme = url . scheme ( ) ; String host = url . host ( ) ; int port = url . port ( ) ; StringBuilder builder = new StringBuilder ( ) ; if ( scheme != null ) { builder . append ( scheme ) . append ( "://" ) ; } builder . append ( host ) ; if ( port >= 0 ) { builder . append ( ':' ) . append ( port ) ; } return builder . toString ( ) ; }
Gets authority of a url .
24,499
static Mono < Object > decode ( HttpResponse httpResponse , SerializerAdapter serializer , HttpResponseDecodeData decodeData ) { Type headerType = decodeData . headersType ( ) ; if ( headerType == null ) { return Mono . empty ( ) ; } else { return Mono . defer ( ( ) -> { try { return Mono . just ( deserializeHeaders ( httpResponse . headers ( ) , serializer , decodeData ) ) ; } catch ( IOException e ) { return Mono . error ( new HttpRequestException ( "HTTP response has malformed headers" , httpResponse , e ) ) ; } } ) ; } }
Decode headers of the http response .