/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package buzzerproxy; import java.util.logging.Level; import java.util.logging.Logger; import org.apache.http.client.ClientProtocolException; public class Google { private String GOOGLE_SEARCH_BASE = "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&" + "q=intitle:'index+of'%20+'last+modified'%20+'parent+directory'%20+description%20+size+FILETYP+SEARCHQUERY&key=AIzaSyAcvn-vGugDlvBilWabtpfGeC619KQxo_w"; public String getGoogleContent(String searchQuery, String fileType) { if (searchQuery == null || !(searchQuery instanceof String) || fileType == null || !(fileType instanceof String)) { Exception e = new Exception(); Logger.getLogger(Google.class.getName()).log(Level.SEVERE, null, e); System.exit(1); } // if ( str == null || !(str instanceof String)){ Http h = new Http(); String returnContent = ""; searchQuery = searchQuery.replace(" ", "%20"); fileType = fileType.replace(" ", "%20"); String searchUrl = GOOGLE_SEARCH_BASE.replace("SEARCHQUERY", searchQuery).replace("FILETYP", fileType); try { returnContent = h.get(searchUrl); } catch (ClientProtocolException ex) { Logger.getLogger(Google.class.getName()).log(Level.SEVERE, null, ex); } return returnContent; } // public String getGoogleContent(String searchQuery, String fileType){ } // public class Google {