Takuya Ono
takuy****@users*****
2007年 8月 18日 (土) 04:14:57 JST
Index: BetaProject/src/org/jent/checksmtp/SMTPclient.java diff -u BetaProject/src/org/jent/checksmtp/SMTPclient.java:1.6 BetaProject/src/org/jent/checksmtp/SMTPclient.java:1.7 --- BetaProject/src/org/jent/checksmtp/SMTPclient.java:1.6 Fri Aug 17 01:48:47 2007 +++ BetaProject/src/org/jent/checksmtp/SMTPclient.java Sat Aug 18 04:14:57 2007 @@ -57,14 +57,14 @@ } } catch (BindException bindEx) { //fatalError = true; - String errorMessage = "Recive Port bind error. " + bindEx.getMessage(); + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.Recive_Port_bind_error") + bindEx.getMessage(); System.err.println(errorMessage); bindEx.printStackTrace(); new MessageDialogUI(errorMessage, bindEx, MessageDialogUI.ERROR_MODE); break; } catch (IOException e) { fatalError = true; - String errorMessage = "I/O Error Occurred. Stop service."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.IO_Error_Occurred"); System.err.println(errorMessage); e.printStackTrace(); new MessageDialogUI(errorMessage, e, MessageDialogUI.ERROR_MODE); @@ -72,8 +72,7 @@ } catch (IllegalArgumentException iaEx) { //Port value out of range fatalError = true; - String errorMessage = "Argument Error Occurted(" + iaEx.getMessage() + - "). Stop service."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.Argument_Error_Occurted") + iaEx.getMessage(); System.err.println(errorMessage); iaEx.printStackTrace(); new MessageDialogUI(errorMessage, iaEx, MessageDialogUI.ERROR_MODE); @@ -113,7 +112,7 @@ } } catch (RuntimeException rEx) { fatalError = true; - String errorMessage = "Runtime Exception was occurred. Stop service."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPCLient.error.Runtime_Exception_was_occurred"); System.err.println(errorMessage); new MessageDialogUI(errorMessage, rEx, MessageDialogUI.ERROR_MODE); break; @@ -121,7 +120,7 @@ } if ( !fatalError ) { //Servce stop by non fatal error. Unexpected. - String errorMessage = "Unexpected service stoping ocurreed. Stoped service."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("SMTPClient.error.Unexpected_service_stoping_ocurreed"); System.err.println(errorMessage); new MessageDialogUI(errorMessage, null, MessageDialogUI.ERROR_MODE); } Index: BetaProject/src/org/jent/checksmtp/ToListUI.java diff -u BetaProject/src/org/jent/checksmtp/ToListUI.java:1.6 BetaProject/src/org/jent/checksmtp/ToListUI.java:1.7 --- BetaProject/src/org/jent/checksmtp/ToListUI.java:1.6 Fri Aug 17 01:50:27 2007 +++ BetaProject/src/org/jent/checksmtp/ToListUI.java Sat Aug 18 04:14:57 2007 @@ -194,7 +194,7 @@ ApplicationProperties.setConfirmDialogPosH(h); ApplicationProperties.setConfirmDialogPosW(w); if ( !ApplicationProperties.save() ) { - new MessageDialogUI("Fail the properties file of dialog potition save.", + new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("ToListUI.error.Fail_the_properties_file_of_dialog_potition_save."), null, MessageDialogUI.ERROR_MODE); } } Index: BetaProject/src/org/jent/checksmtp/Bundle_ja_JP.properties diff -u BetaProject/src/org/jent/checksmtp/Bundle_ja_JP.properties:1.2 BetaProject/src/org/jent/checksmtp/Bundle_ja_JP.properties:1.3 --- BetaProject/src/org/jent/checksmtp/Bundle_ja_JP.properties:1.2 Fri Aug 17 01:52:08 2007 +++ BetaProject/src/org/jent/checksmtp/Bundle_ja_JP.properties Sat Aug 18 04:14:57 2007 @@ -86,3 +86,35 @@ ApplicationUI.jLabelProgramName.text=\u30E1\u30FC\u30EB\u9001\u4FE1\u5148\u78BA\u8A8D\u30D7\u30ED\u30B0\u30E9\u30E0 ApplicationUI.jPanelAbout.TabConstraints.tabTitle=\u60C5\u5831 + +ApplicationUI.Port_number_is_integer_from_1_to_65535.=\u30DD\u30FC\u30C8\u756A\u53F7\u306F1\u301C65535\u307E\u3067\u3067\u3059\u3002 + +ApplicationUI.error.Fail_the_properties_file_save.=\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u30D5\u30A1\u30A4\u30EB\u306B\u4FDD\u5B58\u3059\u308B\u3053\u3068\u304C\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002 + +ApplicationUI.error.Out_of_range.=\u7BC4\u56F2\u304C\u4E0D\u6B63\u3067\u3059\u3002 + +ApplicationUI.shortTitle=\u30E1\u30FC\u30EB\u9001\u4FE1\u5148\u78BA\u8A8D + +ToListUI.error.Fail_the_properties_file_of_dialog_potition_save.=\u30C0\u30A4\u30A2\u30ED\u30B0\u306E\u4F4D\u7F6E\u306E\u4FDD\u5B58\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + +LDAPSearch.error.LDAPSearch_init_error.=LDAP\u691C\u7D22\u306E\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + +LDAPSearch.error.LDAP_Search_Error.=LDAP\u691C\u7D22\u3067\u30A8\u30E9\u30FC + +LDAPSearch.error.LDAP_Unexpected_Error.=LDAP\u3067\u4E88\u60F3\u5916\u306E\u30A8\u30E9\u30FC + +Processer.error.Execption_occurred_at_starting_SMTP_thread.=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3068\u306ESMTP\u901A\u4FE1\u306E\u521D\u671F\u5316\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + +Processer.error.Runtime_Exception_occurred_in_SMTP_parse=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3068\u306ESMTP\u901A\u4FE1\u4E2D\u306B\u5B9F\u884C\u6642\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002 + +Processer.error.Error_occurred_in_SMTP_parse.=\u30E1\u30FC\u30EB\u30B5\u30FC\u30D0\u3068\u306ESMTP\u901A\u4FE1\u3067\u30A8\u30E9\u30FC\u304C\u767A\u751F\u3057\u307E\u3057\u305F\u3002 + +SMTPClient.error.Recive_Port_bind_error=\u53D7\u4FE1\u7528\u306E\u30DD\u30FC\u30C8\u306E\u521D\u671F\u5316(bind)\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002 + +SMTPClient.error.IO_Error_Occurred=\u53D7\u4FE1\u5F85\u3067\u901A\u4FE1\u30A8\u30E9\u30FC + +SMTPClient.error.Argument_Error_Occurted=\u8A2D\u5B9A\u5024\u304C\u6B63\u3057\u304F\u306A\u3044\u305F\u3081\u306B\u53D7\u4FE1\u304C\u3067\u304D\u3066\u3044\u307E\u305B\u3093\u3002\u8A2D\u5B9A\u3092\u5909\u3048\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002 + +SMTPCLient.error.Runtime_Exception_was_occurred=\u5B9F\u884C\u6642\u30A8\u30E9\u30FC\u306B\u3088\u308A\u53D7\u4FE1\u304C\u3067\u304D\u306A\u304F\u306A\u308A\u307E\u3057\u305F\u3002\u8A2D\u5B9A\u3092\u5909\u3048\u3066\u307F\u3066\u304F\u3060\u3055\u3044\u3002 + +SMTPClient.error.Unexpected_service_stoping_ocurreed=\u4E88\u60F3\u5916\u306E\u30A8\u30E9\u30FC\u306B\u3088\u308A\u53D7\u4FE1\u304C\u505C\u6B62\u3057\u3066\u3057\u307E\u3044\u307E\u3057\u305F\u3002 Index: BetaProject/src/org/jent/checksmtp/Bundle.properties diff -u BetaProject/src/org/jent/checksmtp/Bundle.properties:1.2 BetaProject/src/org/jent/checksmtp/Bundle.properties:1.3 --- BetaProject/src/org/jent/checksmtp/Bundle.properties:1.2 Fri Aug 17 01:52:08 2007 +++ BetaProject/src/org/jent/checksmtp/Bundle.properties Sat Aug 18 04:14:57 2007 @@ -91,8 +91,40 @@ ApplicationUI.jLabelProgramName.text=Mail Distination Confirm Program -ApplicationUI.jLabelProgramVersion.text=0.4 +ApplicationUI.jLabelProgramVersion.text=0.5 Test Build ApplicationUI.jPanelAbout.TabConstraints.tabTitle=About ApplicationUI.jLabelSfURL.text=http\://mdc.sourceforge.jp/ + +ApplicationUI.Port_number_is_integer_from_1_to_65535.=Port number is integer from 1 to 65535. + +ApplicationUI.shortTitle=mdc + +ApplicationUI.error.Fail_the_properties_file_save.=Fail the properties file save. + +ApplicationUI.error.Out_of_range.=Out of range. + +ToListUI.error.Fail_the_properties_file_of_dialog_potition_save.=Fail the properties file of dialog potition save. + +LDAPSearch.error.LDAPSearch_init_error.=LDAPSearch init error. + +LDAPSearch.error.LDAP_Search_Error.=LDAP Search Error. + +LDAPSearch.error.LDAP_Unexpected_Error.=LDAP Unexpected Error. + +Processer.error.Execption_occurred_at_starting_SMTP_thread.=Execption occurred at starting SMTP thread. + +Processer.error.Runtime_Exception_occurred_in_SMTP_parse=Runtime Exception occurred in SMTP parse + +Processer.error.Error_occurred_in_SMTP_parse.=Error occurred in SMTP parse. + +SMTPClient.error.Recive_Port_bind_error=Recive Port bind error. + +SMTPClient.error.IO_Error_Occurred=I/O Error Occurred. Stop service. + +SMTPClient.error.Argument_Error_Occurted=Stop Service. Argument Error Occurted. + +SMTPCLient.error.Runtime_Exception_was_occurred=Runtime Exception was occurred. Stop service. + +SMTPClient.error.Unexpected_service_stoping_ocurreed=Unexpected service stoping ocurreed. Stoped service. Index: BetaProject/src/org/jent/checksmtp/LDAPSearch.java diff -u BetaProject/src/org/jent/checksmtp/LDAPSearch.java:1.5 BetaProject/src/org/jent/checksmtp/LDAPSearch.java:1.6 --- BetaProject/src/org/jent/checksmtp/LDAPSearch.java:1.5 Thu Aug 16 04:17:01 2007 +++ BetaProject/src/org/jent/checksmtp/LDAPSearch.java Sat Aug 18 04:14:57 2007 @@ -36,12 +36,12 @@ lastProviderUrl = ApplicationProperties.getLdapProviderURL(); Properties env = new Properties(); env.setProperty(Context.INITIAL_CONTEXT_FACTORY, - "com.sun.jndi.ldap.LdapCtxFactory"); + "com.sun.jndi.ldap.LdapCtxFactory"); // NOI18N env.put(Context.PROVIDER_URL, lastProviderUrl); ctx = new InitialDirContext(env); } catch (NamingException e) { - String errorMessage = "LDAPSearch init error."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("LDAPSearch.error.LDAPSearch_init_error."); System.err.println(errorMessage); lastProviderUrl = null; e.printStackTrace(); @@ -80,13 +80,13 @@ } catch (NamingException e) { - System.err.println("Ignore LDAPSearch close error."); + System.err.println("Ignore LDAPSearch close error."); //e.printStackTrace(); } } public static String search(String mail) { - String ans = ""; + String ans = ""; // NOI18N if (!ApplicationProperties.getLdap()) { return ans; @@ -99,7 +99,7 @@ init(); } - Pattern pattern = Pattern.compile("[ \t]+"); //Attributes separate by space. + Pattern pattern = Pattern.compile("[ \t]+"); // NOI18N Attributes separate by space. String[] attrNames = pattern.split(ApplicationProperties.getLdapAttributes()); System.err.println("LDAP Serarch= " + mail + " " + attrNames[0]); @@ -112,7 +112,7 @@ try { NamingEnumeration mailList = ctx.search(ApplicationProperties.getLdapRoot(), - "(mail=" + mail + ")", ctrl); + "(mail=" + mail + ")", ctrl); // NOI18N while ( mailList.hasMore() ) { SearchResult sr = (SearchResult) mailList.next(); @@ -123,19 +123,19 @@ String str; if (attr == null) { - str = ""; + str = ""; // NOI18N } else { str = (String) attr.get(); } - if (str == null) { str = ""; } + if (str == null) { str = ""; } // NOI18N if (ApplicationProperties.getLdapIsSjis()) { - str = new String(str.getBytes("ISO-8859-1"), "UTF-8"); + str = new String(str.getBytes("ISO-8859-1"), "UTF-8"); // NOI18N } - if (i != 0) { ans += " "; } + if (i != 0) { ans += " "; } // NOI18N ans += str; } - System.err.println("ANS=" + ans); + System.err.println("ANS=" + ans); } mailList.close(); } catch (TimeLimitExceededException tlEx) { @@ -145,7 +145,7 @@ System.out.println("LDAP Search Name Not Found."); //IGNORE Exception } catch (NamingException e) { - String errorMessage = "LDAP Search Error."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("LDAPSearch.error.LDAP_Search_Error."); System.err.println(errorMessage); e.printStackTrace(); //ctx reflesh @@ -156,7 +156,7 @@ System.err.println("LDAP SJIS Error."); e.printStackTrace(); } catch (NullPointerException npEx) { //for failsafe. - String errorMessage = "LDAP Unexpected Error."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("LDAPSearch.error.LDAP_Unexpected_Error."); NullPointerException e = npEx; System.err.println(errorMessage); e.printStackTrace(); Index: BetaProject/src/org/jent/checksmtp/Processer.java diff -u BetaProject/src/org/jent/checksmtp/Processer.java:1.7 BetaProject/src/org/jent/checksmtp/Processer.java:1.8 --- BetaProject/src/org/jent/checksmtp/Processer.java:1.7 Thu Aug 16 04:17:01 2007 +++ BetaProject/src/org/jent/checksmtp/Processer.java Sat Aug 18 04:14:57 2007 @@ -35,10 +35,10 @@ private final int R502CommandNotImplemented = 502; //SMTP command - private final String COMMAND_RCPT_TO = "RCPT TO:"; - private final String COMMAND_DATA = "DATA"; - private final String COMMAND_RESET = "RSET"; - private final String COMMAND_TURN = "TURN"; + private final String COMMAND_RCPT_TO = "RCPT TO:"; // NOI18N + private final String COMMAND_DATA = "DATA"; // NOI18N + private final String COMMAND_RESET = "RSET"; // NOI18N + private final String COMMAND_TURN = "TURN"; // NOI18N //private final String COMMAND_NOOP = "NOOP"; //private final String COMAMND_QUIT = "QUIT"; @@ -77,12 +77,12 @@ server.getInputStream())); serverWriter = new PrintWriter(new SmtpBufferedWriter( new OutputStreamWriter(server.getOutputStream(), - "ISO-8859-1")), true); + "ISO-8859-1")), true); // NOI18N clientReader = new BufferedReader(new InputStreamReader( client.getInputStream())); clientWriter = new PrintWriter(new SmtpBufferedWriter( new OutputStreamWriter(client.getOutputStream(), - "ISO-8859-1")), true); + "ISO-8859-1")), true); // NOI18N smtpStart(serverReader, clientWriter, clientReader, serverWriter); @@ -98,11 +98,11 @@ client.close(); client = null; } catch (IOException e) { - String errorMessage = "Execption occurred at starting SMTP thread."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Execption_occurred_at_starting_SMTP_thread."); System.err.println(errorMessage); new MessageDialogUI(errorMessage, e, MessageDialogUI.ERROR_MODE); } catch (RuntimeException runEx) { - new MessageDialogUI("Runtime Exception occurred in SMTP parse", + new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Runtime_Exception_occurred_in_SMTP_parse"), runEx, MessageDialogUI.ERROR_MODE); } finally { //for failsafe Socket close. @@ -203,7 +203,7 @@ line = clientReader.readLine(); serverWriter.println(line); - if (line.equals(".")) { + if (line.equals(".")) { // NOI18N break; //end of mail dara. } } @@ -269,11 +269,11 @@ } } } catch (IOException e) { - String errorMessage = "Error occurred in SMTP parse."; + String errorMessage = java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Error_occurred_in_SMTP_parse."); System.err.println(errorMessage); new MessageDialogUI(errorMessage, e, MessageDialogUI.ERROR_MODE); } catch (RuntimeException runEx) { - new MessageDialogUI("Runtime Exception occurred in SMTP parse", + new MessageDialogUI(java.util.ResourceBundle.getBundle("org/jent/checksmtp/Bundle").getString("Processer.error.Runtime_Exception_occurred_in_SMTP_parse"), runEx, MessageDialogUI.ERROR_MODE); } @@ -285,18 +285,18 @@ //Splitting Mail address. String str = line.substring(COMMAND_RCPT_TO.length() + 1); - Pattern pattern = Pattern.compile("[< >]+"); + Pattern pattern = Pattern.compile("[< >]+"); // NOI18N String[] address = pattern.split(str); // 0<1>2 3 int i; for (i = 0; i < address.length; i++) { - if (!address[i].equals("")) { + if (!address[i].equals("")) { // NOI18N break; } } //Search LDAP - str = address[i] + " " + LDAPSearch.search(address[i]); + str = address[i] + " " + LDAPSearch.search(address[i]); // NOI18N return str; } }