• R/O
  • HTTP
  • SSH
  • HTTPS

rapideact: Commit


Commit MetaInfo

Revision1747a545f7584591d674699100498395a94c38ac (tree)
Time2017-01-30 07:56:57
Authorkuboryu <kuboryu@yaho...>
Commiterkuboryu

Log Message

20170130

Change Summary

Incremental Difference

--- a/com/rapide_act/CmnUtils.java
+++ b/com/rapide_act/CmnUtils.java
@@ -33,7 +33,7 @@ import org.apache.commons.codec.binary.Base64;
3333
3434 public class CmnUtils{
3535
36- public static void writeCsv(String _file, int _columnCount, ArrayList<String> _alData) throws Exception{
36+ protected static void writeCsv(String _file, int _columnCount, ArrayList<String> _alData) throws Exception{
3737 PrintWriter pw = null;
3838 try {
3939 debugPrint("Start write csv," + "columnCount=" + _columnCount);
@@ -58,7 +58,7 @@ public class CmnUtils{
5858 }
5959 }
6060
61- public static void printConsole(int _columnCount, ArrayList<String> _alData) throws Exception{
61+ protected static void printConsole(int _columnCount, ArrayList<String> _alData) throws Exception{
6262 try {
6363 debugPrint("Start console print");
6464 for(int i=0;i<_alData.size();i++){
@@ -80,34 +80,34 @@ public class CmnUtils{
8080 }
8181 }
8282
83- public static void debugPrint(String _message) throws Exception{
83+ protected static void debugPrint(String _message) throws Exception{
8484 if(System.getProperty("debug")!=null)System.out.println(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + " [DEBUG] " + _message);
8585 }
8686
87- public static void debugPrinting(String _message) throws Exception{
87+ protected static void debugPrinting(String _message) throws Exception{
8888 if(System.getProperty("debug")!=null)System.out.print(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + " [DEBUG] " + _message);
8989 }
9090
91- public static void infoPrint(String _message) throws Exception{
91+ protected static void infoPrint(String _message) throws Exception{
9292 System.out.println(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + " [INFO] " + _message);
9393 }
94- public static void infoPrinting(String _message) throws Exception{
94+ protected static void infoPrinting(String _message) throws Exception{
9595 System.out.print(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + " [INFO] " + _message);
9696 }
9797
98- public static void errorPrint(String _message) throws Exception{
98+ protected static void errorPrint(String _message) throws Exception{
9999 System.out.println(new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()) + " [ERROR] " + _message);
100100 }
101101
102- public static String getTimestamp() throws Exception{
102+ protected static String getTimestamp() throws Exception{
103103 return (new java.text.SimpleDateFormat("yyyyMMddHHmmssSSS").format(new Date()));
104104 }
105105
106- public static String getYmdhm() throws Exception{
106+ protected static String getYmdhm() throws Exception{
107107 return (new java.text.SimpleDateFormat("yyyyMMddHHmm").format(new Date()));
108108 }
109109
110- public static int getArrayRowNo(ArrayList<String> _al, int _alMember, int _seq, String _value) throws Exception {
110+ protected static int getArrayRowNo(ArrayList<String> _al, int _alMember, int _seq, String _value) throws Exception {
111111 int ret = -1;
112112 for(int i=0;i<_al.size()/_alMember;i++){
113113 if(_al.get(i*_alMember + _seq).equals(_value)){
@@ -118,7 +118,7 @@ public class CmnUtils{
118118 return ret;
119119 }
120120
121- public static String [] getArrayRowData(ArrayList<String> _al, int _alMember, int _row) throws Exception {
121+ protected static String [] getArrayRowData(ArrayList<String> _al, int _alMember, int _row) throws Exception {
122122 String [] rowData = new String[_alMember];
123123 int colNo = 0;
124124 for(int i=_row*_alMember;i<_row*_alMember + _alMember;i++){
@@ -128,37 +128,37 @@ public class CmnUtils{
128128 return rowData;
129129 }
130130
131- public static String [] splitCsv(String _line) throws Exception {
131+ protected static String [] splitCsv(String _line) throws Exception {
132132 return split(_line, ",");
133133 }
134134
135- public static String [] splitSpace(String _line) throws Exception {
135+ protected static String [] splitSpace(String _line) throws Exception {
136136 return split(_line, " ");
137137 }
138138
139- public static String [] splitDot(String _line) throws Exception {
139+ protected static String [] splitDot(String _line) throws Exception {
140140 return split(_line, "\\.");
141141 }
142142
143- public static String [] splitCrLf(String _line) throws Exception {
143+ protected static String [] splitCrLf(String _line) throws Exception {
144144 return split(_line, "\r\n");
145145 }
146146
147- public static String [] splitSlash(String _line) throws Exception {
147+ protected static String [] splitSlash(String _line) throws Exception {
148148 return split(_line, "/");
149149 }
150150
151- public static String [] splitTab(String _line) throws Exception {
151+ protected static String [] splitTab(String _line) throws Exception {
152152 return split(_line, "\t");
153153 }
154154
155- public static String [] split(String _line, String _delim) throws Exception {
155+ protected static String [] split(String _line, String _delim) throws Exception {
156156 String [] strSplit;
157157 strSplit = _line.split(_delim, -1);
158158 return strSplit;
159159 }
160160
161- public static boolean isLastCrLf(String _str) throws Exception{
161+ protected static boolean isLastCrLf(String _str) throws Exception{
162162 boolean rtn = false;
163163 char[] charArray = _str.toCharArray();
164164 if (_str.length() > 1){
@@ -169,8 +169,8 @@ public class CmnUtils{
169169 return rtn;
170170 }
171171
172- public static char[] hexArray = "0123456789ABCDEF".toCharArray();
173- public static String bytesToHex(byte[] _bytes){
172+ protected static char[] hexArray = "0123456789ABCDEF".toCharArray();
173+ protected static String bytesToHex(byte[] _bytes){
174174 char[] hexChars = new char[_bytes.length * 2];
175175 for(int j=0;j<_bytes.length;j++){
176176 int v = _bytes[j] & 0xFF;
@@ -179,7 +179,7 @@ public class CmnUtils{
179179 }
180180 return new String(hexChars);
181181 }
182- public static byte[] hexToBytes(String _hex){
182+ protected static byte[] hexToBytes(String _hex){
183183 byte[] bytes = new byte[_hex.length()/2];
184184 for(int j=0;j<_hex.length()/2;j++){
185185 bytes[j] = (byte)Integer.parseInt(_hex.substring(j*2,(j+1)*2),16);
@@ -187,22 +187,22 @@ public class CmnUtils{
187187 return bytes;
188188 }
189189
190- public static String bytesToBase64(byte[] _bytes){
190+ protected static String bytesToBase64(byte[] _bytes){
191191 return new String(Base64.encodeBase64(_bytes));
192192 }
193- public static byte[] base64ToBytes(String _base64){
193+ protected static byte[] base64ToBytes(String _base64){
194194 return Base64.decodeBase64(_base64.getBytes());
195195 }
196196
197- public static String clobToString(Clob _clob) throws Exception{
197+ protected static String clobToString(Clob _clob) throws Exception{
198198 return _clob.getSubString(1, (int)_clob.length());
199199 }
200200
201- public static String getLineSeparator(){
201+ protected static String getLineSeparator(){
202202 return System.getProperty("line.separator");
203203 }
204204
205- public static boolean isMatch(String [] _tables, String _table) throws Exception{
205+ protected static boolean isMatch(String [] _tables, String _table) throws Exception{
206206 boolean rtn = false;
207207 Pattern p = null;
208208 Matcher m = null;
@@ -221,7 +221,7 @@ public class CmnUtils{
221221 return rtn;
222222 }
223223
224- public static String getYesNo(boolean _bln){
224+ protected static String getYesNo(boolean _bln){
225225 String retVal;
226226 if(_bln){
227227 retVal = "Yes";
@@ -231,7 +231,7 @@ public class CmnUtils{
231231 return retVal;
232232 }
233233
234- public static boolean isMatch(String [] _tabCols, String _table, String _col) throws Exception{
234+ protected static boolean isMatch(String [] _tabCols, String _table, String _col) throws Exception{
235235 boolean rtn = false;
236236 Pattern p = null;
237237 Matcher m = null;
@@ -257,7 +257,7 @@ public class CmnUtils{
257257 return rtn;
258258 }
259259
260- public static boolean isJapanese(String _str) throws Exception{
260+ protected static boolean isJapanese(String _str) throws Exception{
261261 for(int i=0;i<_str.length();i++){
262262 char chr = _str.charAt(i);
263263 Character.UnicodeBlock unicodeBlock = Character.UnicodeBlock.of(chr);
@@ -270,7 +270,7 @@ public class CmnUtils{
270270 return false;
271271 }
272272
273- public static boolean isHankaku(char _chr) throws Exception{
273+ protected static boolean isHankaku(char _chr) throws Exception{
274274 if((_chr <= '\u007e') || (_chr == '\u00a5') || (_chr == '\u203e') || (_chr >= '\uff61' && _chr <= '\uff9f')){
275275 return true;
276276 } else {
@@ -278,7 +278,7 @@ public class CmnUtils{
278278 }
279279 }
280280
281- public static boolean isColString(String _str) throws Exception{
281+ protected static boolean isColString(String _str) throws Exception{
282282 if(
283283 _str.toUpperCase().equals("XML") ||
284284 _str.toUpperCase().equals("UNIQUEIDENTIFIER") ||
@@ -299,7 +299,7 @@ public class CmnUtils{
299299 }
300300 }
301301
302- public static boolean isColDate(String _str) throws Exception{
302+ protected static boolean isColDate(String _str) throws Exception{
303303 if(
304304 _str.toUpperCase().equals("DATE")){
305305 return true;
@@ -308,7 +308,7 @@ public class CmnUtils{
308308 }
309309 }
310310
311- public static boolean isColTime(String _str) throws Exception{
311+ protected static boolean isColTime(String _str) throws Exception{
312312 if(
313313 _str.toUpperCase().equals("TIME")){
314314 return true;
@@ -317,7 +317,7 @@ public class CmnUtils{
317317 }
318318 }
319319
320- public static boolean isColTimestamp(String _str) throws Exception{
320+ protected static boolean isColTimestamp(String _str) throws Exception{
321321 if(
322322 _str.toUpperCase().equals("TIMESTAMP") ||
323323 _str.toUpperCase().equals("SMALLDATETIME") ||
@@ -329,7 +329,7 @@ public class CmnUtils{
329329 }
330330 }
331331
332- public static boolean isColBigDecimal(String _str) throws Exception{
332+ protected static boolean isColBigDecimal(String _str) throws Exception{
333333 if(
334334 _str.toUpperCase().equals("NUMERIC") ||
335335 _str.toUpperCase().equals("NUMBER") ||
@@ -342,7 +342,7 @@ public class CmnUtils{
342342 }
343343 }
344344
345- public static boolean isColShort(String _str) throws Exception{
345+ protected static boolean isColShort(String _str) throws Exception{
346346 if(
347347 _str.toUpperCase().equals("TINYINT") ||
348348 _str.toUpperCase().equals("SMALLINT")){
@@ -352,7 +352,7 @@ public class CmnUtils{
352352 }
353353 }
354354
355- public static boolean isColInt(String _str) throws Exception{
355+ protected static boolean isColInt(String _str) throws Exception{
356356 if(
357357 _str.toUpperCase().equals("INTEGER") ||
358358 _str.toUpperCase().equals("INT")){
@@ -362,7 +362,7 @@ public class CmnUtils{
362362 }
363363 }
364364
365- public static boolean isColFloat(String _str) throws Exception{
365+ protected static boolean isColFloat(String _str) throws Exception{
366366 if(
367367 _str.toUpperCase().equals("REAL") ||
368368 _str.toUpperCase().equals("SMALLFLT")){
@@ -372,7 +372,7 @@ public class CmnUtils{
372372 }
373373 }
374374
375- public static boolean isColDouble(String _str) throws Exception{
375+ protected static boolean isColDouble(String _str) throws Exception{
376376 if(
377377 _str.toUpperCase().equals("FLOAT") ||
378378 _str.toUpperCase().equals("DOUBLE PRECISION")){
@@ -382,7 +382,7 @@ public class CmnUtils{
382382 }
383383 }
384384
385- public static boolean isColBytes(String _str) throws Exception{
385+ protected static boolean isColBytes(String _str) throws Exception{
386386 if(
387387 _str.toUpperCase().equals("RAW") ||
388388 _str.toUpperCase().equals("BINARY")){
@@ -392,7 +392,7 @@ public class CmnUtils{
392392 }
393393 }
394394
395- public static boolean isColBlob(String _str) throws Exception{
395+ protected static boolean isColBlob(String _str) throws Exception{
396396 if(
397397 _str.toUpperCase().equals("BLOB") ||
398398 _str.toUpperCase().equals("VARBINARY") ||
@@ -404,7 +404,7 @@ public class CmnUtils{
404404 }
405405 }
406406
407- public static boolean isColClob(String _str) throws Exception{
407+ protected static boolean isColClob(String _str) throws Exception{
408408 if(
409409 _str.toUpperCase().equals("CLOB") ||
410410 _str.toUpperCase().equals("NCLOB")){
@@ -414,7 +414,7 @@ public class CmnUtils{
414414 }
415415 }
416416
417- public static boolean isLob(String _str) throws Exception{
417+ protected static boolean isLob(String _str) throws Exception{
418418 if(
419419 isColClob(_str) || isColBlob(_str)){
420420 return true;
@@ -423,7 +423,7 @@ public class CmnUtils{
423423 }
424424 }
425425
426- public static boolean isEmpty(String _str) throws Exception{
426+ protected static boolean isEmpty(String _str) throws Exception{
427427 if(_str == null || _str.equals("")){
428428 return true;
429429 } else {
@@ -431,7 +431,7 @@ public class CmnUtils{
431431 }
432432 }
433433
434- public static boolean isNumeric(String _str) {
434+ protected static boolean isNumeric(String _str) {
435435 boolean retVal = true;
436436 try {
437437 int val = Integer.parseInt(_str);
@@ -441,7 +441,7 @@ public class CmnUtils{
441441 return retVal;
442442 }
443443
444- public static String[] getSystemProperty(String _str) throws Exception{
444+ protected static String[] getSystemProperty(String _str) throws Exception{
445445 String [] retValue = null;
446446 if(System.getProperty(_str)!=null){
447447 retValue = splitCsv(System.getProperty(_str).toUpperCase());
@@ -449,7 +449,7 @@ public class CmnUtils{
449449 return retValue;
450450 }
451451
452- public static String getSystemProperty(String _str, String _strDefault) throws Exception{
452+ protected static String getSystemProperty(String _str, String _strDefault) throws Exception{
453453 String retValue = _strDefault;
454454 if(System.getProperty(_str)!=null){
455455 retValue = System.getProperty(_str).toUpperCase();
@@ -457,7 +457,7 @@ public class CmnUtils{
457457 return retValue;
458458 }
459459
460- public static char getSystemProperty(String _str, char _chrDefault) throws Exception{
460+ protected static char getSystemProperty(String _str, char _chrDefault) throws Exception{
461461 char retValue = _chrDefault;
462462 if(System.getProperty(_str)!=null){
463463 retValue = System.getProperty(_str).toUpperCase().charAt(0);
@@ -465,7 +465,7 @@ public class CmnUtils{
465465 return retValue;
466466 }
467467
468- public static boolean getSystemProperty(String _str, boolean _blnDefault) throws Exception{
468+ protected static boolean getSystemProperty(String _str, boolean _blnDefault) throws Exception{
469469 boolean retValue = _blnDefault;
470470 if(System.getProperty(_str)!=null){
471471 if(System.getProperty(_str).toUpperCase().equals("Y")){
@@ -479,7 +479,7 @@ public class CmnUtils{
479479 return retValue;
480480 }
481481
482- public static String getSeparator(String _str, String _strDefault) throws Exception{
482+ protected static String getSeparator(String _str, String _strDefault) throws Exception{
483483 String retValue = _strDefault;
484484 if(System.getProperty(_str)!=null){
485485 String _sprtr = System.getProperty(_str);
@@ -517,7 +517,7 @@ public class CmnUtils{
517517 return retValue;
518518 }
519519
520- public static String getDelimiter(String _str) throws Exception{
520+ protected static String getDelimiter(String _str) throws Exception{
521521 String retValue = _str;
522522 if(_str!=null){
523523 char [] chr = new char[_str.length()];
@@ -554,7 +554,7 @@ public class CmnUtils{
554554 return retValue;
555555 }
556556
557- public static String getLineSeparator(String _str, String _strDefault) throws Exception{
557+ protected static String getLineSeparator(String _str, String _strDefault) throws Exception{
558558 String retValue = _strDefault;
559559 if(System.getProperty(_str)!=null){
560560 String _sprtr = System.getProperty(_str);
@@ -587,7 +587,7 @@ public class CmnUtils{
587587 return retValue;
588588 }
589589
590- public static String getLineSeparator(String _str) throws Exception{
590+ protected static String getLineSeparator(String _str) throws Exception{
591591 String retValue = _str;
592592 if(_str!=null){
593593 char [] chr = new char[_str.length()];
Show on old repository browser