OSDN Git Service

20170615
[rapideact/rapideact.git] / com / rapide_act / CmnUtils.java
index 4f28d69..4734afc 100644 (file)
@@ -35,6 +35,17 @@ import java.nio.charset.Charset;
 
 public class CmnUtils{
        
+       protected static void emptyFile(String _file) throws Exception{
+               PrintWriter pw = null;
+               try {
+                       pw = new PrintWriter(new BufferedWriter(new FileWriter(new File(_file))));
+                       pw.close();
+               }
+               catch (Exception e){
+                       throw e;
+               }
+       }
+
        protected static void writeCsv(String _file, int _columnCount, ArrayList<String> _alData) throws Exception{
                PrintWriter pw = null;
                try {
@@ -573,6 +584,21 @@ public class CmnUtils{
                return retVal;
        }
 
+       protected static boolean isReserved(String _str) throws Exception{
+               if(
+                       _str.toUpperCase().equals("CURRENT_DATE") ||
+                       _str.toUpperCase().equals("CURRENT_TIME") ||
+                       _str.toUpperCase().equals("CURRENT_TIMESTAMP") ||
+                       _str.toUpperCase().equals("CURRENT_USER") ||
+                       _str.toUpperCase().equals("LOCALTIME") ||
+                       _str.toUpperCase().equals("LOCALTIMESTAMP") ||
+                       _str.toUpperCase().equals("NULL")){
+                       return true;
+               } else {
+                       return false;
+               }
+       }
+       
        protected static String[] getSystemProperty(String _str) throws Exception{
                String [] retValue = null;
                if(System.getProperty(_str)!=null){