• R/O
  • SSH
  • HTTPS

提交

标签

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

作業部屋の使い方を試しています。


Commit MetaInfo

修订版107 (tree)
时间2014-12-12 02:17:19
作者tuna_p

Log Message

(empty log message)

更改概述

差异

--- branches/b3/WebScraping/src/WebScraping/utility/HtmlSearch.java (revision 106)
+++ branches/b3/WebScraping/src/WebScraping/utility/HtmlSearch.java (revision 107)
@@ -385,10 +385,6 @@
385385 }
386386 }//GEN-LAST:event_jMenuSaveActionPerformed
387387
388- private void jMenu2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu2MouseClicked
389- Search_execution();
390- }//GEN-LAST:event_jMenu2MouseClicked
391-
392388 private void jBtnRowCpyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnRowCpyActionPerformed
393389 int SelectedRow = jTable1.getSelectedRow();
394390 if(SelectedRow >= 0) {
@@ -398,10 +394,6 @@
398394 }
399395 }//GEN-LAST:event_jBtnRowCpyActionPerformed
400396
401- private void jBtnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSearchActionPerformed
402- Search_execution();
403- }//GEN-LAST:event_jBtnSearchActionPerformed
404-
405397 private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
406398 Desktop desktop = Desktop.getDesktop();
407399 String uriString = jTxtUrl.getText();
@@ -414,6 +406,14 @@
414406 }
415407 }//GEN-LAST:event_jMenuItem1ActionPerformed
416408
409+ private void jMenu2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu2MouseClicked
410+ Search_execution();
411+ }//GEN-LAST:event_jMenu2MouseClicked
412+
413+ private void jBtnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnSearchActionPerformed
414+ Search_execution();
415+ }//GEN-LAST:event_jBtnSearchActionPerformed
416+
417417 /**
418418 * 検索実行.
419419 */
@@ -423,6 +423,10 @@
423423
424424 // データ無し(404)判定
425425 String strdata = par.getStringPageData();
426+ if(strdata == null) {
427+ jTxtRtn.append("読込みページがありません");
428+ return;
429+ }
426430 String text = jTxt404msg.getText();
427431 String[] strsearch = text.split("\n");
428432 for(String strsearch1 : strsearch) {
--- branches/b3/WebScraping/src/WebScraping/core/HtmlParser.java (revision 106)
+++ branches/b3/WebScraping/src/WebScraping/core/HtmlParser.java (revision 107)
@@ -210,9 +210,9 @@
210210 * インターネット接続.
211211 */
212212 private void getPageData() {
213+ HttpURLConnection con = null;
213214 try {
214- //URL url = new URL(UrlAdress);
215- HttpURLConnection con = (HttpURLConnection)url.openConnection();
215+ con = (HttpURLConnection)url.openConnection();
216216 con.setRequestMethod("GET");
217217 BufferedReader reader = new BufferedReader(
218218 new InputStreamReader(con.getInputStream(), "utf-8"));
@@ -223,13 +223,17 @@
223223 }
224224 pageData = sb.toString();
225225
226- con.disconnect();
227- }
228- catch(IOException ex) {
226+ } catch(FileNotFoundException ex) {
227+ pageData = null;
228+ } catch (IOException ex) {
229229 Logger.getLogger(HtmlParser.class.getName()).log(Level.SEVERE, null, ex);
230+ } finally {
231+ if(con != null) {
232+ con.disconnect();
233+ }
230234 }
231235 }
232-
236+
233237 /**
234238 * HTMLパーサ.
235239 * @param skey