shjung 1 年之前
父節點
當前提交
377b371757

+ 20 - 0
Recover_text_document_ menus.reg

@@ -0,0 +1,20 @@
+Windows Registry Editor Version 5.00
+
+; txtfilelegacy 추가
+[HKEY_CLASSES_ROOT\.txt]
+@="txtfilelegacy"
+"Content Type"="text/plain"
+"PerceivedType"="text"
+
+; OpenWithProgids 추가
+[HKEY_CLASSES_ROOT\.txt\OpenWithProgids]
+"AppX4ztfk9wxr86nxmzzq47px0nh0e58b8fw"=hex(0)
+
+; PersistentHandler 추가
+[HKEY_CLASSES_ROOT\.txt\PersistentHandler]
+@="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
+
+; shellex 추가
+[HKEY_CLASSES_ROOT\.txt\shellex]
+[HKEY_CLASSES_ROOT\.txt\shellex\{8895b1c6-b41f-4c1c-a562-0d564250836f}]
+@="{afbd5a44-2520-4ae0-9224-6cfce8fe4400}"

+ 1 - 1
conf/debug.properties

@@ -1,5 +1,5 @@
 #system debug setting configuration...
-#Fri Jan 05 10:46:06 KST 2024
+#Fri Jan 05 17:27:06 KST 2024
 packet-info=x
 packet-dump=x
 system-debug=false

+ 59 - 0
proguard.cfg

@@ -0,0 +1,59 @@
+-target 1.8 ##Specify the java version number
+-dontshrink ##Default is enabled, here the shrink is turned off, that is, the unused classes/members are not deleted.
+-dontoptimize ##Default is enabled, here to turn off bytecode level optimization
+-useuniqueclassmembernames ## Take a unique strategy for confusing the naming of class members
+-adaptclassstrings ## After confusing the class name, replace it with a place like Class.forName('className')
+-ignorewarnings
+-keepdirectories
+-keepclasseswithmembers public class * { public static void main(java.lang.String[]);} ##Maintain the class of the main method and its method name
+-keepclassmembers enum * { *; }  ##Reserving enumeration members and methods
+-keepclassmembers class * {
+     @org.springframework.beans.factory.annotation.Autowired *;
+     @org.springframework.beans.factory.annotation.Qualifier *;
+     @org.springframework.beans.factory.annotation.Value *;
+     @org.springframework.beans.factory.annotation.Required *;
+     @org.springframework.context.annotation.Bean *;
+     @org.springframework.context.annotation.Primary *;
+     @org.springframework.boot.context.properties.ConfigurationProperties *;
+     @org.springframework.boot.context.properties.EnableConfigurationProperties *;
+     @javax.annotation.PostConstruct *;
+     @javax.annotation.PreDestroy *;
+}
+-keep @org.springframework.cache.annotation.EnableCaching class *
+-keep @org.springframework.context.annotation.Configuration class *
+-keep @org.springframework.boot.context.properties.ConfigurationProperties class *
+-keep @org.springframework.boot.autoconfigure.SpringBootApplication class *
+-allowaccessmodification
+-keepattributes *Annotation*
+-keepdirectories com.jayk.springboot.proguard.obfuscationdemo
+-keepdirectories org.springframework.boot.autoconfigure
+-keepclassmembers class * {
+    *** get*();
+    void set*(***);
+}
+-keepclassmembernames class * {
+     java.lang.Class class$(java.lang.String);
+     java.lang.Class class$(java.lang.String, boolean);
+}
+-keepclassmembers enum * {
+     public static **[] values();
+     public static ** valueOf(java.lang.String);
+     public static ** fromValue(java.lang.String);
+}
+-keepnames class * implements java.io.Serializable
+-keepclassmembers class * implements java.io.Serializable {
+     static final long serialVersionUID;
+     private static final java.io.ObjectStreamField[] serialPersistentFields;
+     !static !transient <fields>;
+     !private <fields>;
+     !private <methods>;
+     private void writeObject(java.io.ObjectOutputStream);
+     private void readObject(java.io.ObjectInputStream);
+     java.lang.Object writeReplace();
+     java.lang.Object readResolve();
+}
+-keepclassmembers class * {
+     @org.springframework.beans.factory.annotation.Autowired <fields>;
+     @org.springframework.beans.factory.annotation.Autowired <methods>;
+     @org.springframework.security.access.prepost.PreAuthorize <methods>;
+}

+ 0 - 39
src/main/java/com/its/app/utils/BcdConverter.java

@@ -1,39 +0,0 @@
-package com.its.app.utils;
-
-public class BcdConverter {
-
-    public static String bcdToString(byte bcd) {
-        StringBuilder sb = new StringBuilder();
-        byte high = (byte)(bcd & 0xf0);
-        high >>>= (byte)4;
-        high = (byte)(high & 0x0f);
-        byte low = (byte) (bcd & 0x0f);
-
-        sb.append(high);
-        sb.append(low);
-
-        return sb.toString();
-    }
-
-    public static String bcdToString(byte[] data) {
-        StringBuilder sb = new StringBuilder();
-
-        for (byte datum : data) {
-            sb.append(bcdToString(datum));
-        }
-        return sb.toString();
-    }
-
-    public static byte[] stringToBcd(String data) {
-        if ((data.length() % 2) != 0) {
-            data += "0";
-        }
-        byte[] temp = data.getBytes();
-        int length = temp.length;
-        byte[] result = new byte[length/2];
-        for (int ii = 0; ii < length; ii+=2) {
-            result[ii/2] = (byte)((temp[ii] - '0') << 4 | (temp[ii+1] - '0'));
-        }
-        return result;
-    }
-}

+ 0 - 312
src/main/java/com/its/app/utils/ByteUtils.java

@@ -1,312 +0,0 @@
-package com.its.app.utils;
-
-public class ByteUtils {
-
-	private static final int[] BYTE_MASKED_ARRAY = { 1, 2, 4, 8, 16, 32, 64, 128 };
-
-	public static int byteToInt(byte srcValue)
-	{
-		return srcValue & 0xFF;
-	}
-
-	public static int shortToInt(short srcValue)
-	{
-		return srcValue & 0xFFFF;
-	}
-
-	public static long intToLong(int srcValue)
-	{
-		return srcValue & 0xFFFFFFFF;
-	}
-
-	public static int longToInt(long srcValue)
-	{
-		return (int)(srcValue & 0xFFFFFFFF);
-	}
-
-	public static String byteToBitString(byte srcValue)
-	{
-		return String.format("%8s", Long.toBinaryString(srcValue & 0xFF)).replace(' ', '0');
-	}
-
-	public static String shortToBitString(short srcValue)
-	{
-		return String.format("%16s", Long.toBinaryString(srcValue & 0xFF)).replace(' ', '0');
-	}
-
-	public static String intToBitString(int srcValue)
-	{
-		return String.format("%32s", Integer.toBinaryString(srcValue & 0xFF)).replace(' ', '0');
-	}
-
-	public static String longToBitString(long srcValue)
-	{
-		return String.format("%64s", Long.toBinaryString(srcValue & 0xFF)).replace(' ', '0');
-	}
-
-	public static int extractBits(byte srcValue, int beginBitDigit, int endBitDigit)
-	{
-		int maskedValue = 0;
-		for (int idx = beginBitDigit; idx <= endBitDigit; idx++) {
-			maskedValue += BYTE_MASKED_ARRAY[idx];
-		}
-		return (srcValue & maskedValue) >> beginBitDigit;
-	}
-
-	public static int extractBit(byte srcValue, int bitDigit)
-	{
-		return (srcValue & BYTE_MASKED_ARRAY[bitDigit]) == BYTE_MASKED_ARRAY[bitDigit] ? 1 : 0;
-	}
-
-	public static int compareMaskedValue(byte srcValue, int maskValue, int compareValue)
-	{
-		int resultValue = byteToInt(srcValue) & maskValue;
-		return resultValue == compareValue ? 0 : resultValue > compareValue ? 1 : -1;
-	}
-
-	public static String convertCustomDateTime(String strDate)
-	{
-		String convertDate = strDate;
-		if (convertDate.lastIndexOf(".") != -1) {
-			convertDate = convertDate.substring(0, convertDate.lastIndexOf("."));
-		}
-		return convertDate.replaceAll("-", "").replaceAll(":", "").replaceAll(" ", "");
-	}
-
-	public static byte[] hexToByteArray(String hex)
-	{
-		if ((hex == null) || (hex.length() == 0)) {
-			return null;
-		}
-		byte[] ba = new byte[hex.length() / 2];
-		for (int i = 0; i < ba.length; i++) {
-			ba[i] = ((byte)Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16));
-		}
-		return ba;
-	}
-
-	public static String byteArrayToHex(byte[] ba)
-	{
-		return byteArrayToHex(ba, null);
-	}
-
-	public static byte[] intToShortBytes(int length)
-	{
-		byte[] b3 = new byte[2];
-		if (length > 255)
-		{
-			b3[0] = ((byte)(length / 256));
-			b3[1] = ((byte)(length % 256));
-		}
-		else
-		{
-			b3[0] = 0;
-			b3[1] = ((byte)length);
-		}
-		return b3;
-	}
-
-	public static int getIntOnBit(int n, int offset, int length)
-	{
-		return n >> 32 - offset - length & (-1 << length ^ 0xFFFFFFFF);
-	}
-
-	public static String byteArrayToHex(byte[] ba, String seperator)
-	{
-		if ((ba == null) || (ba.length == 0)) {
-			return null;
-		}
-
-		StringBuffer sb = new StringBuffer(ba.length * 2);
-		for (int x = 0; x < ba.length; x++)
-		{
-			String hexNumber = "0" + Integer.toHexString(0xFF & ba[x]).toUpperCase();
-
-			sb.append(hexNumber.substring(hexNumber.length() - 2));
-			//if (seperator != null && !seperator.isEmpty()) {
-				sb.append(seperator);
-			//}
-		}
-		return sb.toString();
-	}
-
-	static final char[] HEX_ARRAY = "0123456789ABCDEF".toCharArray();
-	public static final int BIT_1 = 1;
-	public static final int BIT_2 = 3;
-	public static final int BIT_3 = 7;
-	public static final int BIT_4 = 15;
-	public static final int BIT_5 = 31;
-	public static final int BIT_6 = 63;
-	public static final int BIT_7 = 127;
-	public static final int BIT_8 = 255;
-	public static final int BIT_9 = 511;
-	public static final int BIT_10 = 1023;
-	public static final int BIT_11 = 2047;
-	public static final int BIT_12 = 4095;
-	public static final int BIT_13 = 8191;
-	public static final int BIT_14 = 16383;
-	public static final int BIT_15 = 32767;
-	public static final int BIT_16 = 65535;
-
-	public static String bytesToHex(byte[] bytes, int bundleSize, char seperator)
-	{
-		char[] hexChars = new char[bytes.length * 2 + bytes.length / bundleSize];
-		int j = 0;
-		for (int k = 1; j < bytes.length; k++)
-		{
-			int v = bytes[j] & 0xFF;
-			int start = j * 2 + j / bundleSize;
-
-			hexChars[start] = HEX_ARRAY[(v >>> 4)];
-			hexChars[(start + 1)] = HEX_ARRAY[(v & 0xF)];
-			if (k % bundleSize == 0) {
-				hexChars[(start + 2)] = seperator;
-			}
-			j++;
-		}
-		return new String(hexChars).trim();
-	}
-
-	public static String bytesToHex(byte[] bytes, int bundleSize)
-	{
-	return bytesToHex(bytes, bundleSize, ' ');
-	}
-
-	public static String byteToHex(byte b)
-	{
-	String hexNumber = "0" + Integer.toHexString(0xFF & b).toUpperCase();
-	return hexNumber.substring(hexNumber.length() - 2);
-	}
-
-	public static int convertNotNullStringToInt(String data)
-	{
-		if (data == null || data.trim().length() == 0)
-			return 0;
-		return Long.valueOf(data).intValue();
-	}
-
-	public static double convertNotNullStringToDouble(String data)
-	{
-		if (data == null || data.trim().length() == 0)
-			return 0.0D;
-		return Double.valueOf(data).doubleValue();
-	}
-
-	public static String extractFilePath(String fullPath)
-	{
-		String resultPath = fullPath;
-		int lastPathIndex = resultPath.lastIndexOf("/") != -1 ? resultPath.lastIndexOf("/") : resultPath.lastIndexOf("\\");
-		return lastPathIndex != -1 ? resultPath.substring(0, lastPathIndex + 1) : resultPath;
-	}
-
-	public static String extractFileName(String fullPath)
-	{
-		String resultPath = fullPath;
-		int lastPathIndex = resultPath.lastIndexOf("/") != -1 ? resultPath.lastIndexOf("/") : resultPath.lastIndexOf("\\");
-		return lastPathIndex != -1 ? resultPath.substring(lastPathIndex + 1) : resultPath;
-	}
-
-	public static String lpad(String str, int len, String pad)
-	{
-		String result = str;
-		int templen = len - result.length();
-		for (int i = 0; i < templen; i++) {
-			result = pad + result;
-		}
-		return result;
-	}
-
-	public static int getBitField(byte b, int field)
-	{
-		return (b & 1 << field) > 0 ? 1 : 0;
-	}
-
-	public static int getBitField(byte b, int field, int count)
-	{
-		if (count == 1) {
-			count = 1;
-		} else if (count == 2) {
-			count = 3;
-		} else if (count == 3) {
-			count = 7;
-		} else if (count == 4) {
-			count = 15;
-		} else if (count == 5) {
-			count = 31;
-		} else if (count == 6) {
-			count = 63;
-		} else if (count == 7) {
-			count = 127;
-		} else if (count == 8) {
-			count = 255;
-		} else if (count == 9) {
-			count = 511;
-		} else if (count == 10) {
-			count = 1023;
-		} else if (count == 11) {
-			count = 2047;
-		} else if (count == 12) {
-			count = 4095;
-		} else if (count == 13) {
-			count = 8191;
-		} else if (count == 14) {
-			count = 16383;
-		} else if (count == 15) {
-			count = 32767;
-		} else if (count == 16) {
-			count = 65535;
-		}
-		return b >> field & count;
-	}
-
-	public static byte setBitField(byte b, int field, int value)
-	{
-		if ((value == 0) || (value == 1)) {
-			b = (byte)(b | value << field);
-		}
-		return b;
-	}
-
-	public static byte setBitField(byte b, int field, int count, int value)
-	{
-		if ((field + count <= 8) && (value < Math.pow(2.0D, count))) {
-			if (count == 1) {
-				count = 1;
-			} else if (count == 2) {
-				count = 3;
-			} else if (count == 3) {
-				count = 7;
-			} else if (count == 4) {
-				count = 15;
-			} else if (count == 5) {
-				count = 31;
-			} else if (count == 6) {
-				count = 63;
-			} else if (count == 7) {
-				count = 127;
-			} else if (count == 8) {
-				count = 255;
-			} else if (count == 9) {
-				count = 511;
-			} else if (count == 10) {
-				count = 1023;
-			} else if (count == 11) {
-				count = 2047;
-			} else if (count == 12) {
-				count = 4095;
-			} else if (count == 13) {
-				count = 8191;
-			} else if (count == 14) {
-				count = 16383;
-			} else if (count == 15) {
-				count = 32767;
-			} else if (count == 16) {
-				count = 65535;
-			}
-		}
-		b = (byte)(b & (count << field ^ 0xFFFFFFFF));
-		b = (byte)(b | (value & count) << field);
-
-		return b;
-	}
-}

+ 0 - 39
src/main/java/com/its/app/utils/Counter.java

@@ -1,39 +0,0 @@
-package com.its.app.utils;
-
-import java.util.concurrent.atomic.AtomicLong;
-
-public class Counter {
-    private AtomicLong counter = new AtomicLong(0L);
-
-    public Counter() {
-    }
-
-    public long reset() {
-        return this.counter.getAndSet(0L);
-    }
-
-    public long reset(long value) {
-        return this.counter.getAndSet(0L);
-    }
-
-    public long increment() {
-        return this.counter.incrementAndGet();
-    }
-
-    public long add(long value) {
-        return this.counter.addAndGet(value);
-    }
-
-    public long decrement() {
-        return this.counter.decrementAndGet();
-    }
-
-    public long get() {
-        return this.counter.get();
-    }
-
-    public String toString() {
-        return Converter.getSize(this.counter.doubleValue());
-    }
-
-}

+ 0 - 535
src/main/java/com/its/app/utils/FloodFill.java

@@ -1,535 +0,0 @@
-package com.its.app.utils;
-
-
-import java.awt.*;
-import java.awt.image.BufferedImage;
-import java.awt.image.DataBufferInt;
-import java.util.ArrayList;
-
-/**
- * Drawing class which provides flood fill functionality. Found 
- * on http://www.javagaming.org forum and adapted to be more generic. Antialiasing
- * and texture filling capability added.
- * 
- * @author kingaschi (Christph Aschwanden - king@kingx.com)
- * @author moogie (Javagaming Forum)
- * @author tom  (Javagaming Forum)
- * @since April 26, 2005
- */
-public final class FloodFill {
-
-  /** 
-   * Line info class for linear non-recursive fill.
-   * 
-   * @author king
-   * @since April 27, 2005
-   */
-  static class LineInfo {
-    
-    /** The left position. */
-    int left;
-    /** The right position. */
-    int right;
-    /** The y position. */
-    int y;  
-    
-    /**
-     * Sets the line info.
-     * 
-     * @param left  Previous left position.
-     * @param right  Previous right position.
-     * @param y  Y position.
-     */
-    void setInfo(int left, int right, int y) {
-      this.left = left;
-      this.right = right;
-      this.y = y;
-    }
-  }
-  /** The array used for fast flood fill. Instantiated only once to improve performance. */
-  private ArrayList<LineInfo> linearNRTodo = new ArrayList<LineInfo>();
-  /** The index into linear non-recursive fill. */
-  private int index;
-  
-  /** True, if antialised fill should be used. */
-  private boolean antialiased = true;
-  /** The raw image data to fill. */
-  private int[] image; 
-  /** The raw mask image data with the borders. */
-  private int[] maskImage; 
-  /** The start x position for the fill. */
-  private int startX;
-  /** The start y position for the fill. */
-  private int startY;
-  /** The fill color to use for the original image. */
-  private int fillColor; 
-  /** The fill color to use for the mask image. */
-  private int maskColor;
-  /** The pattern fill color to use. */
-  private int patternColor;
-  /** The width of the chessboard pattern. */
-  private int patternWidth;
-  /** The height of the chessboard pattern. */
-  private int patternHeight;
-  /** The color to replace with the fill color. */
-  private int startColor; 
-  /** The width of the image to fill. */
-  private int width; 
-  /** The height of the image to fill. */
-  private int height; 
-  
-  /** The result image. */
-  private BufferedImage bufferedImage;
-  /** The mask image used. */
-  private BufferedImage bufferedMaskImage;
-  
-  
-  /**
-   * Constructor for flood fill, requires the image for filling operation.
-   * 
-   * @param imageToFill  The image used for filling.
-   */
-  public FloodFill(Image imageToFill) {
-    this(imageToFill, null);
-  }
-  
-  /**
-   * Constructor for flood fill, requires the image and mask for filling operation.
-   * 
-   * @param imageToFill  The image used for filling.
-   * @param maskImage    The image containing the border lines.
-   */
-  public FloodFill(Image imageToFill, Image maskImage) {
-    // sets image to fill
-    setImage(imageToFill);
-    
-    // sets the mask
-    setMask(maskImage);
-  }
-  
-  /**
-   * Returns true, if antialiased filling is used.
-   * 
-   * @return  True, for antialiased filling.
-   */
-  public boolean isAntialiased() {
-    return this.antialiased;
-  }
-  
-  /**
-   * Sets if antialiased filling is used.
-   * 
-   * @param antialiased  True, for antialiased filling.
-   */
-  public void setAntialiased(boolean antialiased) {
-    this.antialiased = antialiased;
-  }
-   
-  /**
-   * Returns the width of the fill area.
-   * 
-   * @return  The width of the fill area.
-   */
-  public int getWidth() {
-    return this.width;
-  }
-  
-  /**
-   * Returns the height of the fill area.
-   * 
-   * @return  The height of the fill area.
-   */
-  public int getHeight() {
-    return this.height;
-  }
-  
-  /**
-   * Returns the image that was filled.
-   * 
-   * @return  The image that was filled.
-   */
-  public BufferedImage getImage() {
-    return bufferedImage;
-  }
-  
-  /**
-   * Sets the image to be filled. 
-   * 
-   * @param imageToFill  The image to be filled.
-   */
-  public void setImage(Image imageToFill) {
-    // copy image to fill into buffered image first 
-    width = imageToFill.getWidth(null); 
-    height = imageToFill.getHeight(null); 
-    bufferedImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-    Graphics g = bufferedImage.getGraphics();
-    g.drawImage(imageToFill, 0, 0, null);
-    
-    // get fill image
-    this.image = ((DataBufferInt)bufferedImage.getRaster().getDataBuffer()).getData();
-  }
-  
-  /**
-   * Returns the mask containing the fill borders.
-   * 
-   * @return  The mask with the fill borders.
-   */
-  public BufferedImage getMask() {
-    return bufferedMaskImage;
-  }
-  
-  /**
-   * Sets the mask image which contains the borders.
-   * 
-   * @param maskImage  The mask image to set. If null, the image to fill is used as
-   *                   the mask.
-   */
-  public void setMask(Image maskImage) {
-    this.bufferedMaskImage = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
-    Graphics g = this.bufferedMaskImage.getGraphics();
-
-    if (maskImage == null) {
-      // if no mask, use the original image to fill
-      g.drawImage(this.bufferedImage, 0, 0, null);
-    }
-    else {
-      // if mask, use it
-      g.drawImage(maskImage, 0, 0, null);
-    }
-    
-    this.maskImage = bufferedMaskImage.getRGB(0, 0, width, height, null, 0, width);      
-  }
-  /**
-   * Flood fills parts of an image. 
-   * 
-   * @param x  The x coordinate to start filling.
-   * @param y  The y coordinate to start filling.
-   * @param color  The new fill color.
-   */
-  public void fill(int x, int y, Color color) {
-    this.startX = x;
-    this.startY = y;
-    this.fillColor = color.getRGB();  
-    this.maskColor = color.getRGB();  // the fill color for the mask
-    this.startColor = this.maskImage[startY * width + startX]; 
-    if (fillColor != startColor) {
-      floodFill();
-    }
-  }
-  
-  /**
-   * Fills a bounded area of an image. Uses a chessboard pattern. The width in pixels
-   * of the chessboard pattern can be specified.
-   * 
-   * @param x  The x coordinate to start filling.
-   * @param y  The y coordinate to start filling.
-   * @param color  The new fill color.
-   * @param patternColor  The color of the pattern to use.
-   * @param patternWidth  The width of the chessboard pattern.
-   * @param patternHeight  The height of the chessboard pattern.
-   */
-  public void fill(int x, int y, Color color, Color patternColor, int patternWidth, int patternHeight) {
-    this.startX = x;
-    this.startY = y;
-    this.fillColor = color.getRGB();
-    this.patternColor = patternColor.getRGB();
-    this.patternWidth = (patternWidth > 0) ? patternWidth : Integer.MAX_VALUE;
-    this.patternHeight = (patternHeight > 0) ? patternHeight : Integer.MAX_VALUE;
-    this.startColor = this.maskImage[startY * width + startX]; 
-    
-    // the fill color for the mask
-    this.maskColor = ((this.fillColor >> 2) & 0x3F3F3F3F) 
-                   + ((this.patternColor >> 1) & 0x7F7F7F7F);      
-    
-    if (this.maskColor != this.startColor) {
-      // mask color ok (=different)
-      floodFill2();
-    }
-    else {
-      // create new mask color first
-      this.maskColor = ((this.fillColor >> 1) & 0x7F7F7F7F) 
-                     + ((this.patternColor >> 2) & 0x3F3F3F3F);      
-      floodFill2();
-    }
-  }
-  
-  /** 
-   * Fills the line at (x, y). Then fills the line above and below the current line. 
-   * The border is defined as any color except the start color. Non-recursive version,
-   * doesn't have JVM stack size limitations.
-   */ 
-  private void floodFill() { 
-    // init stack
-    linearNRTodo.clear();
-    index = 0;
-    floodFill(startX, startY); 
-
-    // loop through todo list
-    while (index < linearNRTodo.size()) {
-      // get loop data
-      LineInfo lineInfo = linearNRTodo.get(index);
-      index++;
-      int y = lineInfo.y;
-      int left = lineInfo.left;
-      int right = lineInfo.right;
-      
-      // check top
-      if (y > 0) {
-        int yOff = (y - 1) * width;
-        int x = left;
-        while (x <= right) {
-          if (maskImage[yOff + x] == startColor) {
-            x = floodFill(x, y - 1);
-          }
-          else {
-            // fill antialised if allowed
-            if (antialiased) {
-              int antialiasedColor = maskImage[yOff + x];
-              antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-              antialiasedColor = antialiasedColor + ((fillColor >> 1) & 0x7F7F7F7F);      
-              if (antialiasedColor != startColor) {
-                image[yOff + x] = antialiasedColor;
-              }
-            }
-          }
-          x++;
-        }
-      }
-
-      // check bottom
-      if (y < height - 1) {
-        int yOff = (y + 1) * width;
-        int x = left;
-        while (x <= right) {
-          if (maskImage[yOff + x] == startColor) {
-            x = floodFill(x, y + 1);
-          }
-          else {
-            // fill antialised if allowed
-            if (antialiased) {
-              int antialiasedColor = maskImage[yOff + x];
-              antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-              antialiasedColor = antialiasedColor + ((fillColor >> 1) & 0x7F7F7F7F);      
-              if (antialiasedColor != startColor) {
-                image[yOff + x] = antialiasedColor;
-              }
-            }
-          }
-          x++;
-        }
-      }
-    } 
-  } 
-  
-  /** 
-   * Fills the line at (x, y). And adds to the stack. 
-   * 
-   * @param x  The x-coordinate of the start position.
-   * @param y  The y-coordinate of the start position.
-   * @return Right.
-   */ 
-  private int floodFill(int x, int y) { 
-    int yOff = y * width;
-    
-    // fill left of (x,y) until border or edge of image
-    int left = x;
-    do {
-      image[yOff + left] = fillColor;
-      maskImage[yOff + left] = maskColor;
-      left--;
-    } 
-    while ((left >= 0) && (maskImage[yOff + left] == startColor));
-    // fill antialised if allowed
-    if ((antialiased) && (left >= 0)) {
-      int antialiasedColor = maskImage[yOff + left];
-      antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-      antialiasedColor = antialiasedColor + ((fillColor >> 1) & 0x7F7F7F7F);      
-      if (antialiasedColor != startColor) {
-        image[yOff + left] = antialiasedColor;
-      }
-    }
-    left++;
-    
-    // fill right of (x, y) until border or edge of image
-    int right = x;
-    do {
-      image[yOff + right] = fillColor;
-      maskImage[yOff + right] = maskColor;
-      right++;
-    } 
-    while ((right < width) && (maskImage[yOff + right] == startColor));
-    // fill antialised if allowed
-    if ((antialiased) && (right < width)) {
-      int antialiasedColor = maskImage[yOff + right];
-      antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-      antialiasedColor = antialiasedColor + ((fillColor >> 1) & 0x7F7F7F7F);      
-      if (antialiasedColor != startColor) {
-        image[yOff + right] = antialiasedColor;
-      }
-    }
-    right--;
-       
-    // add to stack
-    if (index == 0) {
-      LineInfo lineInfo = new LineInfo();
-      lineInfo.setInfo(left, right, y);
-      linearNRTodo.add(lineInfo);
-    }
-    else {
-      index--;
-      linearNRTodo.get(index).setInfo(left, right, y);
-    }
-    
-    // return right position
-    return right; 
-  }
-  
-  /** 
-   * Fills the line at (x, y). Then fills the line above and below the current line. 
-   * The border is defined as any color except the start color. Non-recursive version,
-   * doesn't have JVM stack size limitations.
-   */ 
-  private void floodFill2() { 
-    // init stack
-    linearNRTodo.clear();
-    index = 0;
-    floodFill2(startX, startY); 
-
-    // loop through todo list
-    while (index < linearNRTodo.size()) {
-      // get loop data
-      LineInfo lineInfo = linearNRTodo.get(index);
-      index++;
-      int y = lineInfo.y;
-      int left = lineInfo.left;
-      int right = lineInfo.right;
-      
-      // check top
-      if (y > 0) {
-        int yOff = (y - 1) * width;
-        int x = left;
-        while (x <= right) {
-          if (maskImage[yOff + x] == startColor) {
-            x = floodFill2(x, y - 1);
-          }
-          else {
-            // fill antialised if allowed
-            if (antialiased) {
-              int antialiasedColor = maskImage[yOff + x];
-              antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-              antialiasedColor = antialiasedColor + ((fillColor2(x, y - 1) >> 1) & 0x7F7F7F7F);      
-              if (antialiasedColor != startColor) {
-                image[yOff + x] = antialiasedColor;
-              }
-            }
-          }
-          x++;
-        }
-      }
-
-      // check bottom
-      if (y < height - 1) {
-        int yOff = (y + 1) * width;
-        int x = left;
-        while (x <= right) {
-          if (maskImage[yOff + x] == startColor) {
-            x = floodFill2(x, y + 1);
-          }
-          else {
-            // fill antialised if allowed
-            if (antialiased) {
-              int antialiasedColor = maskImage[yOff + x];
-              antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-              antialiasedColor = antialiasedColor + ((fillColor2(x, y + 1) >> 1) & 0x7F7F7F7F);      
-              if (antialiasedColor != startColor) {
-                image[yOff + x] = antialiasedColor;
-              }
-            }
-          }
-          x++;
-        }
-      }
-    } 
-  } 
-  
-  /** 
-   * Fills the line at (x, y). And adds to the stack. 
-   * 
-   * @param x  The x-coordinate of the start position.
-   * @param y  The y-coordinate of the start position.
-   * @return Right.
-   */ 
-  private int floodFill2(int x, int y) { 
-    int yOff = y * width;
-    
-    // fill left of (x,y) until border or edge of image
-    int left = x;
-    do {
-      image[yOff + left] = fillColor2(left, y);
-      maskImage[yOff + left] = maskColor;
-      left--;
-    } 
-    while ((left >= 0) && (maskImage[yOff + left] == startColor));
-    // fill antialised if allowed
-    if ((antialiased) && (left >= 0)) {
-      int antialiasedColor = maskImage[yOff + left];
-      antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-      antialiasedColor = antialiasedColor + ((fillColor2(left, y) >> 1) & 0x7F7F7F7F);      
-      if (antialiasedColor != startColor) {
-        image[yOff + left] = antialiasedColor;
-      }
-    }
-    left++;
-    
-    // fill right of (x, y) until border or edge of image
-    int right = x;
-    do {
-      image[yOff + right] = fillColor2(right, y);
-      maskImage[yOff + right] = maskColor;
-      right++;
-    } 
-    while ((right < width) && (maskImage[yOff + right] == startColor));
-    // fill antialised if allowed
-    if ((antialiased) && (right < width)) {
-      int antialiasedColor = maskImage[yOff + right];
-      antialiasedColor = (antialiasedColor >> 1) & 0x7F7F7F7F;
-      antialiasedColor = antialiasedColor + ((fillColor2(right, y) >> 1) & 0x7F7F7F7F);      
-      if (antialiasedColor != startColor) {
-        image[yOff + right] = antialiasedColor;
-      }
-    }
-    right--;
-       
-    // add to stack
-    if (index == 0) {
-      LineInfo lineInfo = new LineInfo();
-      lineInfo.setInfo(left, right, y);
-      linearNRTodo.add(lineInfo);
-    }
-    else {
-      index--;
-      linearNRTodo.get(index).setInfo(left, right, y);
-    }
-    
-    // return right position
-    return right; 
-  }  
-  
-  /** 
-   * Returns the fill color for a given x and y value.
-   *
-   * @param x  The x position to return the color for.
-   * @param y  The y position to return the color for.
-   * @return  The color for the given position.
-   */
-  private int fillColor2(int x, int y) {
-    x /= this.patternWidth;
-    y /= this.patternHeight;
-    if ((x + y) % 2 == 0) {
-      return this.fillColor;
-    }
-    else {
-      return this.patternColor;
-    }
-  }
-}  

+ 0 - 39
src/main/java/com/its/app/utils/IOUtils.java

@@ -1,39 +0,0 @@
-package com.its.app.utils;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-
-public class IOUtils {
-    private static final int DEFAULT_BUFFER_SIZE = 1024 * 4;
-
-    public static byte[] toByteArray(InputStream input) throws IOException {
-        ByteArrayOutputStream output = new ByteArrayOutputStream();
-        copy(input, output);
-        return output.toByteArray();
-    }
-
-    public static int copy(InputStream input, OutputStream output)
-            throws IOException {
-        long count = copyLarge(input, output);
-        if (count > Integer.MAX_VALUE) {
-            return -1;
-        }
-        return (int) count;
-    }
-
-    public static long copyLarge(InputStream input, OutputStream output)
-            throws IOException {
-        byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
-        long count = 0;
-        int n = 0;
-        while (-1 != (n = input.read(buffer))) {
-            output.write(buffer, 0, n);
-            count += n;
-        }
-
-        return count;
-
-    }
-}

+ 0 - 39
src/main/java/com/its/app/utils/ImageUtils.java

@@ -1,39 +0,0 @@
-package com.its.app.utils;
-
-import java.awt.*;
-import java.awt.image.BufferedImage;
-
-public class ImageUtils {
-
-    public static Color getRGB(int value)
-    {
-        int v = value;
-        int b = (v & 0xFF0000) >> 16;
-        int g = (v & 0xFF00) >> 8;
-        int r = v & 0xFF;
-
-        return new Color(r, g, b);
-    }
-
-    public static void floodFill(BufferedImage image, int x, int y, int oldColor, int newColor)
-    {
-        if (x < 0 || y < 0) {
-            return;
-        }
-
-        if (x >= image.getWidth() ||y >= image.getHeight()) {
-            return;
-        }
-
-        if (image.getRGB(x, y) != oldColor) {
-            return;
-        }
-        image.setRGB(x, y, newColor);
-
-        floodFill(image, x - 1, y, oldColor, newColor);
-        floodFill(image, x + 1, y, oldColor, newColor);
-        floodFill(image, x, y - 1, oldColor, newColor);
-        floodFill(image, x, y + 1, oldColor, newColor);
-    }
-
-}

+ 0 - 464
src/main/java/com/its/app/utils/ItsUtils.java

@@ -1,464 +0,0 @@
-package com.its.app.utils;
-
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.io.FileUtils;
-
-import javax.imageio.ImageIO;
-import javax.servlet.http.HttpServletRequest;
-import java.awt.image.BufferedImage;
-import java.io.*;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-@Slf4j
-public final class ItsUtils
-{
-	// 요일유형
-	public static final String UNKNOWN_WEEK = "DTW0";
-	public static final String MONDAY       = "DTW1";
-	public static final String TUESDAY      = "DTW2";
-	public static final String WEDNESDAY    = "DTW3";
-	public static final String THURSDAY     = "DTW4";
-	public static final String FRIDAY       = "DTW5";
-	public static final String SATURDAY     = "DTW6";
-	public static final String SUNDAY       = "DTW7";
-
-	public static String getCurrFiveMinString() {
-		Calendar cal = Calendar.getInstance();
-		cal.setTime(new Date());
-		cal.set(Calendar.SECOND, 0);
-		cal.set(Calendar.MILLISECOND, 0);
-		int min = cal.get(Calendar.MINUTE);
-		cal.add(Calendar.MINUTE, -(min % 5));
-		return new SimpleDateFormat("yyyyMMddHHmmss").format(cal.getTime());
-	}
-
-	public static Date getPrcsDt(String prcsDt) {
-		SimpleDateFormat transFormat = new SimpleDateFormat("yyyyMMddHHmmss");
-		Date to = null;
-		try {
-			to = transFormat.parse(prcsDt);
-		} catch (ParseException e) {
-			log.error("getPrcsDt: ParseException");
-		}
-		return to;
-	}
-
-	public static String getMissSttsYn(String prcsDt) {
-
-		if (prcsDt == null || prcsDt.length() != 14) {
-			return "Y";
-		}
-
-		Date startDateTime = getPrcsDt(prcsDt);
-		if (startDateTime == null) {
-			return "Y";
-		}
-		Calendar currDateTime = Calendar.getInstance();
-
-		GregorianCalendar gcStartDateTime = new GregorianCalendar();
-		GregorianCalendar gcEndDateTime = new GregorianCalendar();
-		gcStartDateTime.setTime(startDateTime);
-		gcEndDateTime.setTime(currDateTime.getTime());
-
-		long gap = gcEndDateTime.getTimeInMillis() - gcStartDateTime.getTimeInMillis();
-		long min = gap / 1000L / 60L;
-		return min > 10 ? "Y" : "N";
-	}
-
-	public static String getRseCommStts(String prcsDt) {
-
-		if (prcsDt == null || prcsDt.length() != 14) {
-			return "CMS1";
-		}
-
-		Date startDateTime = getPrcsDt(prcsDt);
-		if (startDateTime == null) {
-			return "CMS1";
-		}
-		Calendar currDateTime = Calendar.getInstance();
-
-		GregorianCalendar gcStartDateTime = new GregorianCalendar();
-		GregorianCalendar gcEndDateTime = new GregorianCalendar();
-		gcStartDateTime.setTime(startDateTime);
-		gcEndDateTime.setTime(currDateTime.getTime());
-
-		long gap = gcEndDateTime.getTimeInMillis() - gcStartDateTime.getTimeInMillis();
-		long min = gap / 1000L / 60L;
-		return min > 30 ? "CMS1" : "CMS0";
-	}
-
-	public static String getServiceYn(String prcsDt) {
-
-		if (prcsDt == null || prcsDt.length() != 14) {
-			return "N";
-		}
-
-		Date startDateTime = getPrcsDt(prcsDt);
-		if (startDateTime == null) {
-			return "N";
-		}
-		Calendar currDateTime = Calendar.getInstance();
-
-		GregorianCalendar gcStartDateTime = new GregorianCalendar();
-		GregorianCalendar gcEndDateTime = new GregorianCalendar();
-		gcStartDateTime.setTime(startDateTime);
-		gcEndDateTime.setTime(currDateTime.getTime());
-
-		long gap = gcEndDateTime.getTimeInMillis() - gcStartDateTime.getTimeInMillis();
-		long min = gap / 1000L / 60L;
-		return min > 10 ? "N" : "Y";
-	}
-
-	public static String getMissYn(String prcsDt, String CMTR_GRAD_CD) {
-
-		if (("LTC0").equals(CMTR_GRAD_CD)) {
-			return "Y";
-		}
-		if (prcsDt == null || prcsDt.length() != 14) {
-			return "Y";
-		}
-
-		Date startDateTime = getPrcsDt(prcsDt);
-		if (startDateTime == null) {
-			return "Y";
-		}
-		Calendar currDateTime = Calendar.getInstance();
-
-		GregorianCalendar gcStartDateTime = new GregorianCalendar();
-		GregorianCalendar gcEndDateTime = new GregorianCalendar();
-		gcStartDateTime.setTime(startDateTime);
-		gcEndDateTime.setTime(currDateTime.getTime());
-
-		long gap = gcEndDateTime.getTimeInMillis() - gcStartDateTime.getTimeInMillis();
-		long min = gap / 1000L / 60L;
-		return min > 10 ? "Y" : "N";
-	}
-	public static Date stringToDate(String paramTime) {
-		SimpleDateFormat transFormat = new SimpleDateFormat("yyyyMMddHHmmss");
-		Date to = null;
-		try {
-			to = transFormat.parse(paramTime);
-		} catch (ParseException e) {
-			log.error("stringToDate: ParseException");
-		}
-
-		return to;
-	}
-
-	public static int getDiffMinutes(String fromDt, String toDt) {
-		Date dtFrom = stringToDate(fromDt);
-		Date dtTo = stringToDate(toDt);
-		GregorianCalendar gcFromDt= new GregorianCalendar();
-		GregorianCalendar gcToDt = new GregorianCalendar();
-		gcFromDt.setTime(dtFrom);
-		gcToDt.setTime(dtTo);
-		long gap = gcToDt.getTimeInMillis() - gcFromDt.getTimeInMillis();
-		long min = gap / 1000L / 60L;
-		return (int)min;
-	}
-
-	// 0--6: Sunday = 0, C/C++ struct tm, tm_wday
-	// 1--7: oracle, SELECT TO_CHAR(SYSDATE, 'D') FROM DUAL;, 주중의 일을 1~7로 표시(일요일이 1)
-	//     : java, Calendar cal; cal.get(Calendar.DAY_OF_WEEK, sunday=1, monday=2, ...)
-	public static String getDayOfWeek() {
-		Date dtNow = new Date();
-		int week = getDayWeek(dtNow);
-		return getDayOfWeek(week);
-	}
-	public static String getDayOfWeek(int week) {
-
-		String sWeek = UNKNOWN_WEEK;
-		switch(week)
-		{
-			case 1: sWeek = SUNDAY; 	break;
-			case 2: sWeek = MONDAY; 	break;
-			case 3: sWeek = TUESDAY; 	break;
-			case 4: sWeek = WEDNESDAY; 	break;
-			case 5: sWeek = THURSDAY; 	break;
-			case 6: sWeek = FRIDAY; 	break;
-			case 7: sWeek = SATURDAY; 	break;
-		}
-		return sWeek;
-	}
-	public static int getDayWeek(String paramDt) {
-		return getDayWeek(stringToDate(paramDt));
-	}
-	public static int getDayWeek(Date paramDt) {
-		Calendar cal = Calendar.getInstance();
-		cal.setTime(paramDt);
-		return cal.get(Calendar.DAY_OF_WEEK);		/* DAY_OF_WEEK 리턴값이 일요일(1), 월요일(2), 화요일(3) ~~ 토요일(7)을 반환합니다. */
-	}
-
-	public static String getFromToday()
-	{
-		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMdd");
-		Date dtNow = new Date();
-		return sdfDate.format(dtNow)+"000000";
-	}
-
-	public static String getSysTime()
-	{
-		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMddHHmmss");
-		Date dtNow = new Date();
-		return sdfDate.format(dtNow);
-	}
-
-	public static String getSysTime(String format)
-	{
-		SimpleDateFormat sdfDate = new SimpleDateFormat(format);
-		Date dtNow = new Date();
-		return sdfDate.format(dtNow);
-	}
-	public static String getSysMonth()
-	{
-		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMM");
-		Date dtNow = new Date();
-		return sdfDate.format(dtNow);
-	}
-	public static String getSysDay()
-	{
-		SimpleDateFormat sdfDate = new SimpleDateFormat("yyyyMMdd");
-		Date dtNow = new Date();
-		return sdfDate.format(dtNow);
-	}
-	public static String getSysHourMin()
-	{
-		SimpleDateFormat sdfDate = new SimpleDateFormat("HHmm");
-		Date dtNow = new Date();
-		return sdfDate.format(dtNow);
-	}
-	/**
-	 * 월 마지막날 가져오기 * @param yyyyMM
-	 * @return : yyyyMMdd
-	 */
-	public static String getLastDayOfMonth(String yyyyMMdd) {
-
-		String year  = yyyyMMdd.substring(0, 4);
-		String month = yyyyMMdd.substring(4, 6);
-
-		Calendar cal = Calendar.getInstance();
-		cal.set(Integer.parseInt(year), Integer.parseInt(month) - 1, 1);
-		String lastDay = year + month + Integer.toString(cal.getActualMaximum(Calendar.DAY_OF_MONTH));
-
-		return lastDay;
-	}
-
-	public static boolean saveByteArrayToFile(String filePath, byte[] byteArrayData) {
-		boolean result = true;
-		try {
-			FileUtils.writeByteArrayToFile(new File(filePath), byteArrayData);
-		}
-		catch (IOException e) {
-			log.error("saveByteArrayToFile: IOException: {}, {}", filePath, e.getMessage());
-			result = false;
-		}
-		return result;
-	}
-
-	public static byte[] convertBmpToPng(byte[] bmpArrayData) {
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-		ByteArrayInputStream inStream = new ByteArrayInputStream(bmpArrayData);
-
-		try {
-			BufferedImage newImage = ImageIO.read(inStream);
-			ImageIO.write(newImage, "png", out);
-			return out.toByteArray();
-		}
-		catch (IOException e) {
-			log.error("saveByteArrayToFile: IOException");
-		}
-		finally {
-			try {
-				out.close();
-				inStream.close();
-			} catch (IOException e) {
-				log.error("saveByteArrayToFile: out close IOException");
-			}
-		}
-		return null;
-	}
-
-	public static String createUserDir(String userDir) {
-
-		final String sysDir = System.getProperty("user.dir");
-		String createdDir = sysDir + userDir;
-		try {
-			Path path = Paths.get(createdDir);
-			//java.nio.file.Files;
-			Files.createDirectories(path);
-
-		}
-		catch (IOException e) {
-			log.error("createUserDir: IOException");
-		}
-		return createdDir;
-	}
-	public static synchronized void saveImageFile(BufferedImage image, String extension, String fullPath)
-	{
-		try (
-			OutputStream out2 = new FileOutputStream(fullPath);
-		) {
-			ImageIO.write(image, extension, out2);
-			out2.close();
-			//RenderedImage rendImage = image;
-			//ImageIO.write(image, "bmp", new File(fullPath));
-		}
-		catch (IOException e) {
-			log.error("saveImageFile: IOException");
-		}
-	}
-
-/*
-	public static byte[] bitmapToByteArray( Bitmap bitmap ) {
-		ByteArrayOutputStream stream = new ByteArrayOutputStream() ;
-		bitmap.compress( Bitmap.CompressFormat.PNG, 100, stream) ;
-		byte[] byteArray = stream.toByteArray() ;
-		return byteArray ;
-	}
-	public static Bitmap byteArrayToBitmap(byte[] bytearr) {
-		return BitmapFactory.decodeByteArray(bytearr, 0, bytearr.length);
-	}*/
-
-/**
- * Bitmap bitmap;
- *
- * ByteBuffer buffer= ByteBuffer.Allocate(bitmap.ByteCount);
- * bitmap.copyPixelsToBuffer(buffer);
- * byte[] byteArray = buffer.ToArray<byte>();
- *
- * byte[] byteArray;
- * Bitmap bitmap;
- *
- * int width = 112;
- * int height = 112;
- *
- * bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
- * ByteBuffer buffer = ByteBuffer.wrap(byteArray);
- * buffer.rewind();
- * bitmap.copyPixelsFromBuffer(buffer);
- */
-
-	public static List<String> split(String value, String delim) {
-
-		List<String> list = new ArrayList<String>();
-
-		StringTokenizer stringTokenizer = new StringTokenizer(value, delim);
-		while (stringTokenizer.hasMoreTokens()) {
-			list.add(stringTokenizer.nextToken().trim());
-		}
-
-		return list;
-	}
-
-	public static int swapEndian(int x) {
-		return swapEndian((short)x) << 16 | swapEndian((short)(x >> 16)) & 0xFFFF;
-	}
-
-	public static short swapEndian(short x) {
-		return (short)(x << 8 | x >> 8 & 0xFF);
-	}
-
-
-	public static String getHttpServletRemoteIP(HttpServletRequest request) {
-		if (request == null) {
-			return "";
-		}
-
-		String ipAddress = request.getHeader("X-FORWARDED-FOR");
-		// proxy 환경일 경우
-		if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-			ipAddress = request.getHeader("Proxy-Client-IP");
-		}
-		// 웹로직 서버일 경우
-		if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-			ipAddress = request.getHeader("WL-Proxy-Client-IP");
-		}
-		if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-			ipAddress = request.getHeader("HTTP_CLIENT_IP");
-		}
-		if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-			ipAddress = request.getHeader("HTTP_X_FORWARDED_FOR");
-		}
-		// 기타
-		if (ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
-			ipAddress = request.getRemoteAddr() ;
-		}
-		//-Djava.net.preferIPv4Stack=true
-		if (ipAddress.equals("0:0:0:0:0:0:0:1"))   //==> ipv6 <== default
-		{
-			ipAddress = "127.0.0.1";   //==> localhost
-		}
-		return ipAddress;
-	}
-
-	public static int parseIntDef(String value, int defValue) {
-		if (value == null || value.length() == 0)
-			return defValue;
-
-		String strValue = value.trim();
-		for (int i = 0; i < strValue.length(); i++) {
-			if (!Character.isDigit(strValue.charAt(i)))
-				return defValue;
-		}
-		return Integer.parseInt(strValue);
-	}
-
-	/**
-	 * 바이너리 문자열을 short 크기에 맞춰 문자열을 처리한다.
-	 * @param binary
-	 * @return
-	 */
-	public static String shortToBinaryString(String binary) {
-		String result = binary;
-		if (result.length() > 16) {
-			return result.substring(16, 32);
-		}
-		if (binary.length() < 16) {
-			int cnt = 16 - binary.length();
-			String tmp = "";
-			for (int ii = 0; ii < cnt; ii++) {
-				tmp += "0";
-			}
-			return tmp + binary;
-		}
-		return binary;
-	}
-
-	/**
-	 * 주어진 값에 대한 2의 보수 값을 리턴한다.(2s complement)
-	 * @param value
-	 * @return
-	 */
-	public static short orgToTwoComplement(short value) {
-		/**
-		 * 원천값의 보수값을 구한다.(1s complement)
-		 */
-		short result = (short) ~value;
-
-		/**
-		 * 원천값의 보수값에 1의 값을 더한다.(2s complement)
-		 */
-		return (short) (result + 1);
-	}
-
-	/**
-	 * 2의 보수값(2s complement)을 원래의 값으로 변환한다.
-	 * @param value
-	 * @return
-	 */
-	public static short twoComplementToOrg(short value) {
-		/**
-		 * 원천값에서 1의 값을 뺀다
-		 */
-		short result = (short)(value - 1);
-		/**
-		 * 1의 값을 뺀값에 대한 보수값을 리턴한다.
-		 */
-		return (short) ~result;
-	}
-}

+ 0 - 245
src/main/java/com/its/app/utils/NettyUtils.java

@@ -1,245 +0,0 @@
-package com.its.app.utils;
-
-import io.netty.channel.Channel;
-import io.netty.channel.EventLoopGroup;
-import io.netty.channel.epoll.Epoll;
-import io.netty.channel.epoll.EpollEventLoopGroup;
-import io.netty.channel.epoll.EpollServerSocketChannel;
-import io.netty.channel.epoll.EpollSocketChannel;
-import io.netty.channel.nio.NioEventLoopGroup;
-import io.netty.channel.socket.ServerSocketChannel;
-import io.netty.channel.socket.SocketChannel;
-import io.netty.channel.socket.nio.NioServerSocketChannel;
-import io.netty.channel.socket.nio.NioSocketChannel;
-import io.netty.util.concurrent.DefaultThreadFactory;
-import lombok.extern.slf4j.Slf4j;
-
-import java.net.*;
-import java.util.ArrayList;
-import java.util.Enumeration;
-
-@Slf4j
-public final class NettyUtils {
-
-    public static String getTcpAddress(Channel ch) {
-        String localIp = "local-unknown";
-        String remoteIp = "remote-unknown";
-        int localPort = 0;
-        int remotePort = 0;
-        InetSocketAddress localAddr = (InetSocketAddress)ch.localAddress();
-        if (localAddr != null) {
-            localIp = localAddr.getAddress().getHostAddress();
-            localPort = localAddr.getPort();
-        }
-
-        InetSocketAddress remoteAddr = (InetSocketAddress)ch.remoteAddress();
-        if (remoteAddr != null) {
-            remoteIp = remoteAddr.getAddress().getHostAddress();
-            remotePort = remoteAddr.getPort();
-        }
-        return "[Local #(" + localIp + ":" + localPort + ") Remote #(" + remoteIp + ":" + remotePort + ")]";
-    }
-    public static String getRemoteAddress(Channel ch) {
-        String ip = getRemoteIpAddress(ch);
-        int  port = getRemotePort(ch);
-        return "[Remote #(" + ip + ":" + port + ")]";
-    }
-
-    public static String getLocalAddress(Channel ch) {
-        String ip = getLocalIpAddress(ch);
-        int  port = getLocalPort(ch);
-        return "[Local #(" + ip + ":" + port + ")]";
-    }
-
-    public static String getRemoteIpAddress(Channel ch) {
-        String ip = "unknown";
-        InetSocketAddress inetAddr = (InetSocketAddress)ch.remoteAddress();
-        if (inetAddr != null) {
-            ip = inetAddr.getAddress().getHostAddress();
-        }
-        return ip;
-    }
-
-    public static int getRemotePort(Channel ch) {
-        int port = 0;
-        InetSocketAddress inetAddr = (InetSocketAddress)ch.remoteAddress();
-        if (inetAddr != null)
-            port = inetAddr.getPort();
-        return port;
-    }
-
-    public static String getLocalIpAddress(Channel ch) {
-        String ip = "unknown";
-        InetSocketAddress inetAddr = (InetSocketAddress)ch.localAddress();
-        if (inetAddr != null) {
-            ip = inetAddr.getAddress().getHostAddress();
-        }
-        return ip;
-    }
-
-    public static int getLocalPort(Channel ch) {
-        int port = 0;
-        InetSocketAddress inetAddr = (InetSocketAddress)ch.localAddress();
-        if (inetAddr != null)
-            port = inetAddr.getPort();
-        return port;
-    }
-    public static boolean isEpollAvailable() {
-        // Netty epoll transport does not work with WSL (Windows Sybsystem for Linux) yet.
-/*
-        boolean HAS_WSLENV = System.getenv("WSLENV") != null;
-        return Epoll.isAvailable() && !HAS_WSLENV;
-*/
-        return Epoll.isAvailable();
-    }
-
-    public static EventLoopGroup newEventLoopGroup(int nThreads, String threadPoolName) {
-        if (isEpollAvailable()) {
-            if (threadPoolName.equals("")) {
-                return new EpollEventLoopGroup(nThreads);
-            }
-            else {
-                return new EpollEventLoopGroup(nThreads, new DefaultThreadFactory("epo"+threadPoolName));
-            }
-        } else {
-            if (threadPoolName.equals("")) {
-                return new NioEventLoopGroup(nThreads);
-            }
-            else {
-                return new NioEventLoopGroup(nThreads, new DefaultThreadFactory("nio" + threadPoolName));
-            }
-        }
-    }
-
-    public static Class<? extends SocketChannel> getSocketChannel() {
-        if (isEpollAvailable()) {
-            return EpollSocketChannel.class;
-        } else {
-            return NioSocketChannel.class;
-        }
-    }
-
-    public static Class<? extends ServerSocketChannel> getServerSocketChannel() {
-        if (isEpollAvailable()) {
-            return EpollServerSocketChannel.class;
-        } else {
-            return NioServerSocketChannel.class;
-        }
-    }
-
-    public static final String OS_NAME = System.getProperty("os.name");
-    private static boolean isLinuxPlatform = false;
-    private static boolean isWindowsPlatform = false;
-
-    static {
-        if (OS_NAME != null && OS_NAME.toLowerCase().contains("linux")) {
-            isLinuxPlatform = true;
-        }
-
-        if (OS_NAME != null && OS_NAME.toLowerCase().contains("windows")) {
-            isWindowsPlatform = true;
-        }
-    }
-
-    public static String getLocalAddress() {
-        // Traversal Network interface to get the first non-loopback and non-private address
-        Enumeration<NetworkInterface> enumeration = null;
-        try {
-            enumeration = NetworkInterface.getNetworkInterfaces();
-        } catch (SocketException e) {
-            log.error("getLocalAddress: getNetworkInterfaces");
-            return null;
-        }
-        ArrayList<String> ipv4Result = new ArrayList<String>();
-        ArrayList<String> ipv6Result = new ArrayList<String>();
-        while (enumeration.hasMoreElements()) {
-            final NetworkInterface networkInterface = enumeration.nextElement();
-            final Enumeration<InetAddress> en = networkInterface.getInetAddresses();
-            while (en.hasMoreElements()) {
-                final InetAddress address = en.nextElement();
-                if (!address.isLoopbackAddress()) {
-                    if (address instanceof Inet6Address) {
-                        ipv6Result.add(normalizeHostAddress(address));
-                    } else {
-                        ipv4Result.add(normalizeHostAddress(address));
-                    }
-                }
-            }
-        }
-
-        // prefer ipv4
-        if (!ipv4Result.isEmpty()) {
-            for (String ip : ipv4Result) {
-                if (ip.startsWith("127.0") || ip.startsWith("0.0")) {
-                    continue;
-                }
-                return ip;
-            }
-            return ipv4Result.get(ipv4Result.size() - 1);
-        } else if (!ipv6Result.isEmpty()) {
-            return ipv6Result.get(0);
-        }
-        //If failed to find,fall back to localhost
-        final InetAddress localHost;
-        try {
-            localHost = InetAddress.getLocalHost();
-        } catch (UnknownHostException e) {
-            log.error("getLocalAddress: UnknownHostException");
-            return null;
-        }
-        return normalizeHostAddress(localHost);
-    }
-
-    public static String normalizeHostAddress(final InetAddress localHost) {
-        if (localHost instanceof Inet6Address) {
-            return "[" + localHost.getHostAddress() + "]";
-        } else {
-            return localHost.getHostAddress();
-        }
-    }
-
-    public static SocketAddress string2SocketAddress(final String addr) {
-        String[] s = addr.split(":");
-        InetSocketAddress isa = new InetSocketAddress(s[0], Integer.parseInt(s[1]));
-        return isa;
-    }
-
-    public static String socketAddress2String(final SocketAddress addr) {
-        StringBuilder sb = new StringBuilder();
-        InetSocketAddress inetSocketAddress = (InetSocketAddress) addr;
-        sb.append(inetSocketAddress.getAddress().getHostAddress());
-        sb.append(":");
-        sb.append(inetSocketAddress.getPort());
-        return sb.toString();
-    }
-
-    public static String parseChannelRemoteAddr(final Channel channel) {
-        if (null == channel) {
-            return "";
-        }
-        SocketAddress remote = channel.remoteAddress();
-        final String addr = remote != null ? remote.toString() : "";
-
-        if (addr.length() > 0) {
-            int index = addr.lastIndexOf("/");
-            if (index >= 0) {
-                return addr.substring(index + 1);
-            }
-
-            return addr;
-        }
-
-        return "";
-    }
-
-    public static String parseSocketAddressAddr(SocketAddress socketAddress) {
-        if (socketAddress != null) {
-            final String addr = socketAddress.toString();
-
-            if (addr.length() > 0) {
-                return addr.startsWith("/") ? addr.substring(1) : addr;
-            }
-        }
-        return "";
-    }
-}

+ 0 - 26
src/main/java/com/its/app/utils/Ping.java

@@ -1,26 +0,0 @@
-package com.its.app.utils;
-
-import java.io.IOException;
-import java.net.InetAddress;
-
-public class Ping {
-    public static boolean isReachable(String host, int timeoutSec) throws IOException, InterruptedException {
-
-        if (OS.isWindows())
-            return Ping.winPing(host);
-
-        return Ping.unixPing(host, timeoutSec);
-    }
-
-    private static boolean winPing(String host) throws IOException, InterruptedException {
-        String cmd = "cmd /c ping -n 1 " + host + " | find \"TTL\"";
-        Process proc = Runtime.getRuntime().exec(cmd);
-        int exit = proc.waitFor();
-        return (exit == 0) ? true : false;
-    }
-
-    private static boolean unixPing(String host, int timeoutSec) throws IOException {
-        InetAddress targetIp = InetAddress.getByName(host);
-        return targetIp.isReachable(timeoutSec*1000);
-    }
-}

+ 0 - 301
src/main/java/com/its/app/utils/StatisticsTime.java

@@ -1,301 +0,0 @@
-package com.its.app.utils;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-public class StatisticsTime {
-
-	private final int processingTime_BEFORE  = 0;
-	//private final int processingTime_CURRENT = 1;
-
-	/*
-	 * 모든 시각은 'YYYYMMDDHH24MISS' 형태로 사용한다.
-	 */
-	private String prcsDayWeek;			/* 요일 유형 */
-	private String prcsDayQuater;		/* 분기 */
-
-	private String prcsCurrTime;		/* 20170718153504 - 현재시각 */
-	private String prcsCurrFiveMin;		/* 20170718153500 - 현재 정주기 5분 시각 */
-	private String prcsCurrFiveMinTo;   /* 20170718153459 - 현재 정주기 5분 시각 - 1초 */
-	private String prcsPrevFiveMin;		/* 20170718153000 - 이전 정주기 5분 시각 */
-
-	private String stat15MinTime;
-	private String stat15MinFrom;
-	private String stat15MinTo;
-	private String statHourTime;
-	private String statHourFrom;
-	private String statHourTo;
-	private String statDayFrom;
-	private String statDayTo;
-	private String statMonFrom;
-	private String statMonTo;
-	private String statYearFrom;
-	private String statYearTo;
-
-	private boolean isStat15Min = false;
-	private boolean isStatHour  = false;
-	private boolean isStatDay   = false;
-	private boolean isStatMon   = false;
-	private boolean isStatYear  = false;
-
-	private boolean isPatternUpdate = false;
-
-	private int analysisTime = processingTime_BEFORE;		/* 이전주기시각(0)/현재주기시각(1) */
-	private int month, hour, min;
-
-	private boolean isProcessing = false;
-	private Date    startDate;
-	private Date    endDate;
-
-	public StatisticsTime() {
-		startDate = new Date();
-		endDate   = new Date();
-	}
-
-	public void setProcessing(boolean isProcessing) {
-		this.isProcessing = isProcessing;
-		if (this.isProcessing) {
-			startDate = new Date();
-		}
-		else {
-			endDate = new Date();
-		}
-	}
-	public boolean IsProcessing() { return this.isProcessing; }
-	public Date    getStartDate() { return this.startDate; }
-	public Date    getEndDate()   { return this.endDate; }
-
-	public int getAnalysisTime() { return this.analysisTime; }
-	public void setAnalysisTime(int analysisTime) { this.analysisTime = analysisTime; }
-
-	public boolean isStat15Min() { return this.isStat15Min; }
-	public boolean isStatHour()  { return this.isStatHour; }
-	public boolean isStatDay()   { return this.isStatDay; }
-	public boolean isStatMon()   { return this.isStatMon; }
-	public boolean isStatYear()   { return this.isStatYear; }
-
-	public boolean isPatternUpdate() { return this.isPatternUpdate; }
-
-	public String getStat15MinTime() {
-		if (this.analysisTime == processingTime_BEFORE)
-			return this.stat15MinFrom;
-		return this.stat15MinTime;
-	}
-	public String getStat15MinFrom() { return this.stat15MinFrom; }
-	public String getStat15MinTo()   { return this.stat15MinTo; }
-	public String getStatHourTime() {
-		if (this.analysisTime == processingTime_BEFORE)
-			return this.statHourFrom;
-		return this.statHourTime;
-	}
-	public String getStatHourFrom()  { return this.statHourFrom; }
-	public String getStatHourTo()    { return this.statHourTo; }
-	public String getStatDayFrom()   { return this.statDayFrom; }
-	public String getStatDayTo()     { return this.statDayTo; }
-	public String getStatMonFrom()   { return this.statMonFrom; }
-	public String getStatMonTo()     { return this.statMonTo; }
-	public String getStatYearFrom()  { return this.statYearFrom; }
-	public String getStatYearTo()    { return this.statYearTo; }
-
-	public String getPrcsDayWeek()   { return this.prcsDayWeek; }
-	public String getPrcsDayQuater() { return this.prcsDayQuater; }
-
-	public String getCurrTime() { return this.prcsCurrTime;	 }
-	public String getPrcsFiveMin() {
-		/*
-		 * 정주기 5분 가공시각으로 DB에 저장하는 시각, 현재시각 이전정주기 5분 시각을 사용한다.
-		 * 만일, 현재정주기 5분 시각을 사용하려 한다면 prcsCurrFiveMin 를 사용한다.
-		 */
-		if (this.analysisTime == processingTime_BEFORE)
-			return this.prcsPrevFiveMin;
-
-		return this.prcsCurrFiveMin;
-	}
-
-	public String getCurrFiveMin()     { return this.prcsCurrFiveMin; }
-	public String getPrcsFiveMinFrom() { return this.prcsPrevFiveMin; }
-	public String getPrcsFiveMinTo()   { return this.prcsCurrFiveMinTo; }
-
-	public String calDate(String paramTm, int addSec/*초단위*/) {
-		String result = paramTm;
-		SimpleDateFormat transFormat = new SimpleDateFormat("yyyyMMddHHmmss");
-		try {
-			Date to = new Date();
-			addSec = addSec * 1000;	/* mili-second로 변환 */
-			to.setTime(transFormat.parse(paramTm).getTime() + addSec);
-			result = TimeUtils.dateToString(to, "yyyyMMddHHmmss");
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}
-		return result;
-	}
-
-	public String calDateFormat(String paramFmt, String paramTm, int addSec) {
-		String result = paramTm;
-		SimpleDateFormat transFormat = new SimpleDateFormat("yyyyMMddHHmmss");
-		try {
-			Date to = new Date();
-			addSec = addSec * 1000;	/* mili-second로 변환 */
-			to.setTime(transFormat.parse(paramTm).getTime() + addSec);
-			result = TimeUtils.dateToString(to, paramFmt);
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}
-		return result;
-	}
-
-	public String calLastDayFormat(String paramFmt, String paramTm) {
-		String result = paramTm;
-		SimpleDateFormat transFormat = new SimpleDateFormat("yyyyMMddHHmmss");
-		try {
-			Date to = new Date();
-			to.setTime(transFormat.parse(paramTm).getTime());
-			Calendar cal = Calendar.getInstance();
-			cal.setTime(to);
-			int day = cal.getActualMaximum(Calendar.DATE);
-
-			cal.set(Calendar.DAY_OF_MONTH, day);
-			return new SimpleDateFormat(paramFmt).format(cal.getTime());
-		} catch (ParseException e) {
-			e.printStackTrace();
-		}
-		return result;
-	}
-
-	public void setPrcsTimeInfo() {
-		Calendar cal = Calendar.getInstance();
-		try {
-			cal.setTime(TimeUtils.stringToDate(this.prcsCurrTime));
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		/* 년월일시분초는 현재시각 기준으로 계산 */
-		//this.year  = cal.get(Calendar.YEAR);
-		this.month = cal.get(Calendar.MONTH) + 1;
-		//this.day   = cal.get(Calendar.DAY_OF_MONTH);
-		this.hour  = cal.get(Calendar.HOUR_OF_DAY);
-		this.min   = cal.get(Calendar.MINUTE);
-		//this.sec   = cal.get(Calendar.SECOND);
-
-		/* 요일, 사사분기는 가공시각을 기준으로 계산 */
-		try {
-			cal.setTime(TimeUtils.stringToDate(getPrcsFiveMin()));
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-		//DAY_OF_WEEK 리턴값이 일요일(1), 월요일(2), 화요일(3) ~~ 토요일(7)을 반환합니다.
-		this.prcsDayWeek   = String.valueOf(cal.get(Calendar.DAY_OF_WEEK));
-		this.prcsDayQuater = String.valueOf((this.month/3)+1);
-	}
-
-	public void initValue() {
-		this.prcsDayWeek   = "";		/* 요일 유형 */
-		this.prcsDayQuater = "";		/* 분기 */
-
-		this.prcsCurrTime      = "";	/* 20170718153504 - 현재시각 */
-		this.prcsCurrFiveMin   = "";	/* 20170718153500 - 현재 정주기 5분 시각 */
-		this.prcsCurrFiveMinTo = "";    /* 20170718153459 - 현재 정주기 5분 시각 - 1초 */
-		this.prcsPrevFiveMin   = "";	/* 20170718153000 - 이전 정주기 5분 시각 */
-
-		this.stat15MinTime = "";
-		this.stat15MinFrom = "";
-		this.stat15MinTo   = "";
-		this.statHourTime  = "";
-		this.statHourFrom  = "";
-		this.statHourTo    = "";
-		this.statDayFrom   = "";
-		this.statDayTo     = "";
-		this.statMonFrom   = "";
-		this.statMonTo     = "";
-
-		this.isStat15Min = false;
-		this.isStatHour  = false;
-		this.isStatDay   = false;
-		this.isStatMon   = false;
-		this.isStatYear  = false;
-
-		this.isPatternUpdate = false;
-	}
-	public void init() {
-
-		initValue();
-
-		/*
-		 * 시간대 계산은 아직 안함(추후 시간대 계산이 필요하면 여기서 하면 됨)
-		 */
-		this.prcsCurrTime = TimeUtils.getCurrentTimeString();
-
-		Date dt = null;
-		try {
-			dt = TimeUtils.stringToDate(this.prcsCurrTime);
-		} catch (Exception e) {
-			e.printStackTrace();
-		}
-
-		this.prcsCurrFiveMin   = TimeUtils.getFiveMinString(dt);
-		this.prcsCurrFiveMinTo = calDate(this.prcsCurrFiveMin, -1);		/* 현재 정주기 시각에서 -1초 */
-		this.prcsPrevFiveMin   = calDate(this.prcsCurrFiveMin, -60*5); 	/* 20170718153000 - 이전 정주기 5분 시각 */
-
-		setPrcsTimeInfo();
-
-		/*
-		 * 5분 정주기 가공이 끝나고 15분 주기일 경우(00, 15, 30, 45 분 일경우 15분 통계 정보를 생성한다)
-		 */
-		if (this.min % 15 == 0) {
-			this.isStat15Min = true;
-		}
-		this.stat15MinFrom = calDate(this.prcsCurrFiveMin, -60*15);
-		this.stat15MinTo   = calDate(this.stat15MinFrom,   (60*15)-1);
-		this.stat15MinTime = calDate(this.stat15MinFrom,   (60*15));
-
-		/*
-		 * 매시 5분 가공이 끝나면 1시간 통계 정보를 생성한다.
-		 */
-		if (this.min == 5) {
-			this.isStatHour = true;
-		}
-		String statHour = calDateFormat("yyyyMMddHH", this.prcsCurrFiveMin, -60*60);
-		this.statHourFrom = statHour + "0000";
-		this.statHourTo   = statHour + "5959";
-		this.statHourTime = calDateFormat("yyyyMMddHH", this.prcsCurrFiveMin, 0) + "0000";
-
-		/*
-		 * 00시 10분 가공이 끝나면 이전일의 통계 정보를 가공.
-		 */
-		if (this.hour == 0 && this.min == 10) {
-			this.isStatDay = true;
-		}
-		String statDay = calDateFormat("yyyyMMdd", this.prcsCurrFiveMin, -60*60*24);
-		this.statDayFrom = statDay + "000000";
-		this.statDayTo   = statDay + "235959";
-
-		/*
-		 * 02시 10분 가공이 끝나면 이전일의 월통계 정보를 누적 가공.
-		 */
-		if (this.hour == 2 && this.min == 10) {
-			this.isStatMon = true;
-		}
-		this.statMonFrom = calDateFormat("yyyyMM", this.prcsCurrFiveMin, -60*60*24) + "01000000";
-		this.statMonTo   = calLastDayFormat("yyyyMMdd", this.statMonFrom)           +   "235959";
-
-		/*
-		 * 02시 35분 가공이 끝나면 이전일의 연통계 정보를 누적 가공.
-		 */
-		if (this.hour == 2 && this.min == 35) {
-			this.isStatYear = true;
-		}
-		this.statYearFrom = calDateFormat("yyyy", this.prcsCurrFiveMin, -60*60*24) + "0101000000";
-		this.statYearTo   = calLastDayFormat("yyyy", this.statMonFrom)           +   "1231235959";
-
-		/*
-		 * 패턴업데이트 시각 체크: 매일 새벽 3시 20분
-		 */
-		if (this.hour == 3 && this.min == 20) {
-			this.isPatternUpdate = true;
-		}
-	}
-
-}

+ 0 - 20
src/main/java/com/its/app/utils/StringUtils.java

@@ -1,20 +0,0 @@
-package com.its.app.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.StringTokenizer;
-
-public class StringUtils {
-
-    public static List<String> split(String value, String delim) {
-
-        List<String> list = new ArrayList<String>();
-
-        StringTokenizer stringTokenizer = new StringTokenizer(value, delim);
-        while (stringTokenizer.hasMoreTokens()) {
-            list.add(stringTokenizer.nextToken().trim());
-        }
-
-        return list;
-    }
-}

+ 0 - 87
src/main/java/com/its/app/utils/crc/AlgoParams.java

@@ -1,87 +0,0 @@
-package com.its.app.utils.crc;
-
-/**
- * Created by anthony on 11.05.2017.
- */
-    public class AlgoParams
-    {
-
-    public AlgoParams(String name, int hashSize, long poly, long init, boolean refIn, boolean refOut, long xorOut, long check)
-    {
-        Name = name;
-        Check = check;
-        Init = init;
-        Poly = poly;
-        RefIn = refIn;
-        RefOut = refOut;
-        XorOut = xorOut;
-        HashSize = hashSize;
-    }
-
-    /// <summary>
-    /// This field is not strictly part of the definition, and, in
-    /// the event of an inconsistency between this field and the other
-    /// field, the other fields take precedence.This field is a check
-    /// value that can be used as a weak validator of implementations of
-    /// the algorithm.The field contains the checksum obtained when the
-    /// ASCII string "123456789" is fed through the specified algorithm
-    /// (i.e. 313233... (hexadecimal)).
-    /// </summary>
-    public long Check;
-
-    /// <summary>
-    /// This is hash size.
-    /// </summary>
-    public int HashSize;
-
-    /// <summary>
-    /// This parameter specifies the initial value of the register
-    /// when the algorithm starts.This is the value that is to be assigned
-    /// to the register in the direct table algorithm. In the table
-    /// algorithm, we may think of the register always commencing with the
-    /// value zero, and this value being XORed into the register after the
-    /// N'th bit iteration. This parameter should be specified as a
-    /// hexadecimal number.
-    /// </summary>
-    public long Init;
-
-    /// <summary>
-    /// This is a name given to the algorithm. A string value.
-    /// </summary>
-    public String Name;
-
-    /// <summary>
-    /// This parameter is the poly. This is a binary value that
-    /// should be specified as a hexadecimal number.The top bit of the
-    /// poly should be omitted.For example, if the poly is 10110, you
-    /// should specify 06. An important aspect of this parameter is that it
-    /// represents the unreflected poly; the bottom bit of this parameter
-    /// is always the LSB of the divisor during the division regardless of
-    /// whether the algorithm being modelled is reflected.
-    /// </summary>
-    public long Poly;
-
-    /// <summary>
-    /// This is a boolean parameter. If it is FALSE, input bytes are
-    /// processed with bit 7 being treated as the most significant bit
-    /// (MSB) and bit 0 being treated as the least significant bit.If this
-    /// parameter is FALSE, each byte is reflected before being processed.
-    /// </summary>
-    public boolean RefIn;
-
-    /// <summary>
-    /// This is a boolean parameter. If it is set to FALSE, the
-    /// final value in the register is fed into the XOROUT stage directly,
-    /// otherwise, if this parameter is TRUE, the final register value is
-    /// reflected first.
-    /// </summary>
-    public boolean RefOut;
-
-    /// <summary>
-    /// This is an W-bit value that should be specified as a
-    /// hexadecimal number.It is XORed to the final register value (after
-    /// the REFOUT) stage before the value is returned as the official
-    /// checksum.
-    /// </summary>
-    public long XorOut;
-}

+ 0 - 57
src/main/java/com/its/app/utils/crc/Crc16.java

@@ -1,57 +0,0 @@
-package com.its.app.utils.crc;
-
-/**
- * Created by anthony on 15.05.2017.
- */
-public class Crc16 {
-    public static AlgoParams Crc16CcittFalse = new AlgoParams("CRC-16/CCITT-FALSE", 16, 0x1021, 0xFFFF, false, false, 0x0, 0x29B1);
-    public static AlgoParams Crc16Arc = new AlgoParams("CRC-16/ARC", 16, 0x8005, 0x0, true, true, 0x0, 0xBB3D);
-    public static AlgoParams Crc16AugCcitt = new AlgoParams("CRC-16/AUG-CCITT", 16, 0x1021, 0x1D0F, false, false, 0x0, 0xE5CC);
-    public static AlgoParams Crc16Buypass = new AlgoParams("CRC-16/BUYPASS", 16, 0x8005, 0x0, false, false, 0x0, 0xFEE8);
-    public static AlgoParams Crc16Cdma2000 = new AlgoParams("CRC-16/CDMA2000", 16, 0xC867, 0xFFFF, false, false, 0x0, 0x4C06);
-    public static AlgoParams Crc16Dds110 = new AlgoParams("CRC-16/DDS-110", 16, 0x8005, 0x800D, false, false, 0x0, 0x9ECF);
-    public static AlgoParams Crc16DectR = new AlgoParams("CRC-16/DECT-R", 16, 0x589, 0x0, false, false, 0x1, 0x7E);
-    public static AlgoParams Crc16DectX = new AlgoParams("CRC-16/DECT-X", 16, 0x589, 0x0, false, false, 0x0, 0x7F);
-    public static AlgoParams Crc16Dnp = new AlgoParams("CRC-16/DNP", 16, 0x3D65, 0x0, true, true, 0xFFFF, 0xEA82);
-    public static AlgoParams Crc16En13757 = new AlgoParams("CRC-16/EN-13757", 16, 0x3D65, 0x0, false, false, 0xFFFF, 0xC2B7);
-    public static AlgoParams Crc16Genibus = new AlgoParams("CRC-16/GENIBUS", 16, 0x1021, 0xFFFF, false, false, 0xFFFF, 0xD64E);
-    public static AlgoParams Crc16Maxim = new AlgoParams("CRC-16/MAXIM", 16, 0x8005, 0x0, true, true, 0xFFFF, 0x44C2);
-    public static AlgoParams Crc16Mcrf4Xx = new AlgoParams("CRC-16/MCRF4XX", 16, 0x1021, 0xFFFF, true, true, 0x0, 0x6F91);
-    public static AlgoParams Crc16Riello = new AlgoParams("CRC-16/RIELLO", 16, 0x1021, 0xB2AA, true, true, 0x0, 0x63D0);
-    public static AlgoParams Crc16T10Dif = new AlgoParams("CRC-16/T10-DIF", 16, 0x8BB7, 0x0, false, false, 0x0, 0xD0DB);
-    public static AlgoParams Crc16Teledisk = new AlgoParams("CRC-16/TELEDISK", 16, 0xA097, 0x0, false, false, 0x0, 0xFB3);
-    public static AlgoParams Crc16Tms37157 = new AlgoParams("CRC-16/TMS37157", 16, 0x1021, 0x89EC, true, true, 0x0, 0x26B1);
-    public static AlgoParams Crc16Usb = new AlgoParams("CRC-16/USB", 16, 0x8005, 0xFFFF, true, true, 0xFFFF, 0xB4C8);
-    public static AlgoParams CrcA = new AlgoParams("CRC-A", 16, 0x1021, 0xc6c6, true, true, 0x0, 0xBF05);
-    public static AlgoParams Crc16Kermit = new AlgoParams("CRC-16/KERMIT", 16, 0x1021, 0x0, true, true, 0x0, 0x2189);
-    public static AlgoParams Crc16Modbus = new AlgoParams("CRC-16/MODBUS", 16, 0x8005, 0xFFFF, true, true, 0x0, 0x4B37);
-    public static AlgoParams Crc16X25 = new AlgoParams("CRC-16/X-25", 16, 0x1021, 0xFFFF, true, true, 0xFFFF, 0x906E);
-    public static AlgoParams Crc16Xmodem = new AlgoParams("CRC-16/XMODEM", 16, 0x1021, 0x0, false, false, 0x0, 0x31C3);
-
-    public static final AlgoParams[] Params = new AlgoParams[]
-            {
-                    Crc16CcittFalse,
-                    Crc16Arc,
-                    Crc16AugCcitt,
-                    Crc16Buypass,
-                    Crc16Cdma2000,
-                    Crc16Dds110,
-                    Crc16DectR,
-                    Crc16DectX,
-                    Crc16Dnp,
-                    Crc16En13757,
-                    Crc16Genibus,
-                    Crc16Maxim,
-                    Crc16Mcrf4Xx,
-                    Crc16Riello,
-                    Crc16T10Dif,
-                    Crc16Teledisk,
-                    Crc16Tms37157,
-                    Crc16Usb,
-                    CrcA,
-                    Crc16Kermit,
-                    Crc16Modbus,
-                    Crc16X25,
-                    Crc16Xmodem,
-            };
-}

+ 0 - 20
src/main/java/com/its/app/utils/crc/Crc32.java

@@ -1,20 +0,0 @@
-package com.its.app.utils.crc;
-
-/**
- * Created by anthony on 15.05.2017.
- */
-public class Crc32 {
-    public static AlgoParams Crc32 = new AlgoParams("CRC-32", 32, 0x04C11DB7L, 0xFFFFFFFFL, true, true, 0xFFFFFFFFL, 0xCBF43926L);
-    public static AlgoParams Crc32Bzip2 = new AlgoParams("CRC-32/BZIP2", 32, 0x04C11DB7L, 0xFFFFFFFFL, false, false, 0xFFFFFFFFL, 0xFC891918L);
-    public static AlgoParams Crc32C = new AlgoParams("CRC-32C", 32, 0x1EDC6F41L, 0xFFFFFFFFL, true, true, 0xFFFFFFFFL, 0xE3069283L);
-    public static AlgoParams Crc32D = new AlgoParams("CRC-32D", 32, 0xA833982BL, 0xFFFFFFFFL, true, true, 0xFFFFFFFFL, 0x87315576L);
-    public static AlgoParams Crc32Jamcrc = new AlgoParams("CRC-32/JAMCRC", 32, 0x04C11DB7L, 0xFFFFFFFFL, true, true, 0x00000000L, 0x340BC6D9L);
-    public static AlgoParams Crc32Mpeg2 = new AlgoParams("CRC-32/MPEG-2", 32, 0x04C11DB7L, 0xFFFFFFFFL, false, false, 0x00000000L, 0x0376E6E7L);
-    public static AlgoParams Crc32Posix = new AlgoParams("CRC-32/POSIX", 32, 0x04C11DB7L, 0x00000000L, false, false, 0xFFFFFFFFL, 0x765E7680L);
-    public static AlgoParams Crc32Q = new AlgoParams("CRC-32Q", 32, 0x814141ABL, 0x00000000L, false, false, 0x00000000L, 0x3010BF7FL);
-    public static AlgoParams Crc32Xfer = new AlgoParams("CRC-32/XFER", 32, 0x000000AFL, 0x00000000L, false, false, 0x00000000L, 0xBD0BE338L);
-
-    public static final AlgoParams[] Params = new AlgoParams[]{
-            Crc32, Crc32Bzip2, Crc32C, Crc32D, Crc32Jamcrc, Crc32Mpeg2, Crc32Posix, Crc32Q, Crc32Xfer
-    };
-}

+ 0 - 12
src/main/java/com/its/app/utils/crc/Crc64.java

@@ -1,12 +0,0 @@
-package com.its.app.utils.crc;
-
-public class Crc64 {
-    public static AlgoParams Crc64 = new AlgoParams("CRC-64",64, 0x42F0E1EBA9EA3693L, 0x00000000L, false, false, 0x00000000L, 0x6C40DF5F0B497347L);
-    public static AlgoParams Crc64We = new AlgoParams("CRC-64/WE", 64, 0x42F0E1EBA9EA3693L, 0xFFFFFFFFFFFFFFFFL, false, false, 0xFFFFFFFFFFFFFFFFL,0x62EC59E3F1A4F00AL);
-    public static AlgoParams Crc64Xz = new AlgoParams("CRC-64/XZ", 64, 0x42F0E1EBA9EA3693L, 0xFFFFFFFFFFFFFFFFL, true, true, 0xFFFFFFFFFFFFFFFFL,0x995DC9BBDF1939FAL);
-
-
-    public static final AlgoParams[] Params = new AlgoParams[]{
-            Crc64, Crc64We, Crc64Xz
-    };
-}

+ 0 - 21
src/main/java/com/its/app/utils/crc/Crc8.java

@@ -1,21 +0,0 @@
-package com.its.app.utils.crc;
-
-/**
- * Created by anthony on 15.05.2017.
- */
-public class Crc8 {
-    public static AlgoParams Crc8 = new AlgoParams("CRC-8", 8, 0x7, 0x0, false, false, 0x0, 0xF4);
-    public static AlgoParams Crc8Cdma2000 = new AlgoParams("CRC-8/CDMA2000", 8, 0x9B, 0xFF, false, false, 0x0, 0xDA);
-    public static AlgoParams Crc8Darc = new AlgoParams("CRC-8/DARC", 8, 0x39, 0x0, true, true, 0x0, 0x15);
-    public static AlgoParams Crc8DvbS2 = new AlgoParams("CRC-8/DVB-S2", 8, 0xD5, 0x0, false, false, 0x0, 0xBC);
-    public static AlgoParams Crc8Ebu = new AlgoParams("CRC-8/EBU", 8, 0x1D, 0xFF, true, true, 0x0, 0x97);
-    public static AlgoParams Crc8ICode = new AlgoParams("CRC-8/I-CODE", 8, 0x1D, 0xFD, false, false, 0x0, 0x7E);
-    public static AlgoParams Crc8Itu = new AlgoParams("CRC-8/ITU", 8, 0x7, 0x0, false, false, 0x55, 0xA1);
-    public static AlgoParams Crc8Maxim = new AlgoParams("CRC-8/MAXIM", 8, 0x31, 0x0, true, true, 0x0, 0xA1);
-    public static AlgoParams Crc8Rohc = new AlgoParams("CRC-8/ROHC", 8, 0x7, 0xFF, true, true, 0x0, 0xD0);
-    public static AlgoParams Crc8Wcdma = new AlgoParams("CRC-8/WCDMA", 8, 0x9B, 0x0, true, true, 0x0, 0x25);
-
-    public static final AlgoParams[] Params = new AlgoParams[]{
-            Crc8, Crc8Cdma2000, Crc8Darc, Crc8DvbS2, Crc8Ebu, Crc8ICode, Crc8Itu, Crc8Maxim, Crc8Rohc, Crc8Wcdma
-    };
-}

+ 0 - 91
src/main/java/com/its/app/utils/crc/CrcCalculator.java

@@ -1,91 +0,0 @@
-package com.its.app.utils.crc;
-
-/**
- * Created by anthony on 11.05.2017.
- */
-public class CrcCalculator {
-
-    public AlgoParams Parameters;
-    public byte HashSize = 8;
-    private long _mask = 0xFFFFFFFFFFFFFFFFL;
-    private long[] _table = new long[256];
-
-    public static final byte[] TestBytes = new byte[]{49,50,51,52,53,54,55,56,57};
-
-    public CrcCalculator(AlgoParams params)
-    {
-        Parameters = params;
-
-        HashSize = (byte) params.HashSize;
-        if (HashSize < 64)
-        {
-            _mask = (1L << HashSize) - 1;
-        }
-
-        CreateTable();
-    }
-
-    public long Calc(byte[] data, int offset, int length)
-    {
-        long init = Parameters.RefOut ? CrcHelper.ReverseBits(Parameters.Init, HashSize) : Parameters.Init;
-        long hash = ComputeCrc(init, data, offset, length);
-        return (hash ^ Parameters.XorOut) & _mask;
-    }
-
-    private long ComputeCrc(long init, byte[] data, int offset, int length)
-    {
-        long crc = init;
-
-        if (Parameters.RefOut)
-        {
-            for (int i = offset; i < offset + length; i++)
-            {
-                crc = (_table[(int)((crc ^ data[i]) & 0xFF)] ^ (crc >>> 8));
-                crc &= _mask;
-            }
-        }
-        else
-        {
-            int toRight = (HashSize - 8);
-            toRight = toRight < 0 ? 0 : toRight;
-            for (int i = offset; i < offset + length; i++)
-            {
-                crc = (_table[(int)(((crc >> toRight) ^ data[i]) & 0xFF)] ^ (crc << 8));
-                crc &= _mask;
-            }
-        }
-
-        return crc;
-    }
-
-    private void CreateTable()
-    {
-        for (int i = 0; i < _table.length; i++)
-            _table[i] = CreateTableEntry(i);
-    }
-
-    private long CreateTableEntry(int index)
-    {
-        long r = (long)index;
-
-        if (Parameters.RefIn)
-            r = CrcHelper.ReverseBits(r, HashSize);
-        else if (HashSize > 8)
-            r <<= (HashSize - 8);
-
-        long lastBit = (1L << (HashSize - 1));
-
-        for (int i = 0; i < 8; i++)
-        {
-            if ((r & lastBit) != 0)
-                r = ((r << 1) ^ Parameters.Poly);
-            else
-                r <<= 1;
-        }
-
-        if (Parameters.RefOut)
-            r = CrcHelper.ReverseBits(r, HashSize);
-
-        return r & _mask;
-    }
-}

+ 0 - 20
src/main/java/com/its/app/utils/crc/CrcHelper.java

@@ -1,20 +0,0 @@
-package com.its.app.utils.crc;
-
-/**
- * Created by anthony on 13.05.2017.
- */
-public class CrcHelper {
-
-    static long ReverseBits(long ul, int valueLength)
-    {
-        long newValue = 0;
-
-        for (int i = valueLength - 1; i >= 0; i--)
-        {
-            newValue |= (ul & 1) << i;
-            ul >>= 1;
-        }
-
-        return newValue;
-    }
-}

+ 0 - 42
src/main/java/com/its/app/utils/crc/Main.java

@@ -1,42 +0,0 @@
-package com.its.app.utils.crc;
-
-import static java.lang.System.out;
-
-public class Main {
-
-    public static void main(String[] args) {
-        boolean allRight = true;
-
-        out.println("Checking CRC-8...");
-        allRight &= Check(Crc8.Params);
-
-        out.println("Checking CRC-16...");
-        allRight &= Check(Crc16.Params);
-
-        out.println("Checking CRC-32...");
-        allRight &= Check(Crc32.Params);
-
-        out.println("Checking CRC-64...");
-        allRight &= Check(Crc64.Params);
-
-        if (allRight)
-            out.println("All right!");
-    }
-
-    private static boolean Check(AlgoParams[] params)
-    {
-        out.println(params.length + " algos");
-        boolean allRight = true;
-        for (int i = 0; i < params.length; i++) {
-            CrcCalculator calculator = new CrcCalculator(params[i]);
-            long result = calculator.Calc(CrcCalculator.TestBytes, 0, CrcCalculator.TestBytes.length);
-            if (result != calculator.Parameters.Check){
-                out.println(calculator.Parameters.Name + " - BAD ALGO!!! " + Long.toHexString(result).toUpperCase());
-                allRight = false;
-            }
-        }
-        out.println("done");
-        out.println();
-        return allRight;
-    }
-}