question: private static String parseFirebaseUrl ( String firebaseSnippet ) { int idx = firebaseSnippet . indexOf ( "databaseURL" ) ; if ( - 1 == idx ) { throw new RuntimeException ( "Please copy your Firebase web snippet into " + FIREBASE_SNIPPET_PATH ) ; } idx = firebaseSnippet . indexOf ( ':' , idx ) ; int openQuote = firebaseSnippet . indexOf ( '"' , idx ) ; int closeQuote = firebaseSnippet . indexOf ( '"' , openQuote + 1 ) ; return firebaseSnippet . substring ( openQuote + 1 , closeQuote ) ; }
target:  Parses out the Firebase database url from the client-side code snippet. The code snippet is a piece of javascript that defines an object with the key 'databaseURL'. So look for that key, then parse out its quote-surrounded value.