Advertisement
Guest User

Untitled

a guest
Sep 21st, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.82 KB | None | 0 0
  1. package A.B.A.A;
  2.  
  3. import java.io.File;
  4. import java.io.FileNotFoundException;
  5. import java.io.FileReader;
  6. import java.io.IOException;
  7. import java.util.Properties;
  8. import javax.imageio.stream.FileImageInputStream;
  9. import javax.imageio.stream.FileImageOutputStream;
  10.  
  11. public class B
  12. {
  13.   public static final String a = System.getProperty("user.dir");
  14.   public static final String J = System.getProperty("file.separator");
  15.   public static String X = "Bla Reports";
  16.   public static String N = a + J + X;
  17.   public static String Q = N + J + "Results";
  18.   public static String Z = "util_files";
  19.   public static String O = N + J + Z;
  20.   public static String F = "CSS";
  21.   public static String S = O + J + F;
  22.   public static String P = "IMG";
  23.   public static String R = O + J + P;
  24.   public static String A = "JS";
  25.   public static String T = O + J + A;
  26.   public static String H = "Run_";
  27.   public static String U = Q + J + H;
  28.   public static String I = Q + J + "Settings.properties";
  29.   public static final char _ = ';';
  30.   public static final String B = "##@##@##";
  31.   public static final char V = ',';
  32.   public static final String G = "Run ";
  33.   public static final String E = "PNG";
  34.   public static final String D = ".PNG";
  35.   private static String C = null;
  36.   public static String M = "img";
  37.   public static boolean W = true;
  38.   public static boolean Y = false;
  39.   public static boolean L = false;
  40.   public static boolean K = false;
  41.  
  42.   public static void C()
  43.     throws A.B.A.B.A
  44.   {
  45.     if (B() != null)
  46.     {
  47.       Properties localProperties = new Properties();
  48.       try
  49.       {
  50.         localProperties.load(new FileReader(B()));
  51.         String str1 = localProperties.getProperty("reports.dir").trim();
  52.         String str2 = localProperties.getProperty("header.text").trim();
  53.         C = localProperties.getProperty("right.header.logo").trim();
  54.         String str3 = localProperties.getProperty("description").trim();
  55.         String str4 = localProperties.getProperty("takescreenshot").trim();
  56.         String str5 = localProperties.getProperty("generated.configurationreports").trim();
  57.         String str6 = localProperties.getProperty("continueExecutionAfterStepFailed").trim();
  58.         try
  59.         {
  60.           if ((str2 != null) && (str2.length() > 0))
  61.             A.B.A.E.B.F.A(str2);
  62.           if ((str4 != null) && (str4.length() > 0))
  63.             try
  64.             {
  65.               L = Boolean.parseBoolean(str4);
  66.             }
  67.             catch (Exception localException1)
  68.             {
  69.             }
  70.           if ((str5 != null) && (str5.length() > 0))
  71.             try
  72.             {
  73.               W = Boolean.parseBoolean(str5);
  74.             }
  75.             catch (Exception localException2)
  76.             {
  77.             }
  78.           if ((str6 != null) && (str6.length() > 0))
  79.             try
  80.             {
  81.               K = Boolean.parseBoolean(str6);
  82.             }
  83.             catch (Exception localException3)
  84.             {
  85.             }
  86.           if ((str3 != null) && (str3.length() > 0))
  87.             A.B.A.A.J = str3;
  88.           if ((str1 != null) && (str1.length() > 0))
  89.           {
  90.             N = str1;
  91.             X = new File(N).getName();
  92.             Q = N + J + "Results";
  93.             Z = "util_files";
  94.             O = N + J + Z;
  95.             F = "CSS";
  96.             S = O + J + F;
  97.             P = "IMG";
  98.             R = O + J + P;
  99.             A = "JS";
  100.             T = O + J + A;
  101.             H = "Run_";
  102.             U = Q + J + H;
  103.             I = Q + J + "Settings.properties";
  104.           }
  105.         }
  106.         catch (Exception localException4)
  107.         {
  108.           throw new A.B.A.B.A(localException4.toString());
  109.         }
  110.       }
  111.       catch (FileNotFoundException localFileNotFoundException)
  112.       {
  113.         throw new A.B.A.B.A("The Path for the properties file not found.");
  114.       }
  115.       catch (IOException localIOException)
  116.       {
  117.         throw new A.B.A.B.A("Problem with reading the report config file.");
  118.       }
  119.     }
  120.   }
  121.  
  122.   public static void C(String paramString)
  123.   {
  124.     File localFile = new File(paramString);
  125.     if (!localFile.exists())
  126.       localFile.mkdirs();
  127.   }
  128.  
  129.   public static boolean A(String paramString)
  130.   {
  131.     File localFile = new File(paramString);
  132.     return localFile.exists();
  133.   }
  134.  
  135.   public static void A()
  136.     throws A.B.A.B.A
  137.   {
  138.     C();
  139.     C(N);
  140.     if (!A(Q))
  141.     {
  142.       C(Q);
  143.       D.D();
  144.     }
  145.     if (!A(O))
  146.     {
  147.       C(O);
  148.       C(S);
  149.       C(T);
  150.       C(R);
  151.       A.B.A.C.A.B();
  152.       A.B.A.C.A.C();
  153.       A.B.A.C.A.A();
  154.     }
  155.     if ((C != null) && (C.length() > 0))
  156.     {
  157.       String str = new File(C).getName();
  158.       if (!new File(R + J + str).exists())
  159.         B(C);
  160.       A.B.A.E.B.J.A(str);
  161.     }
  162.   }
  163.  
  164.   private static void B(String paramString)
  165.     throws A.B.A.B.A
  166.   {
  167.     File localFile = new File(paramString);
  168.     if (!localFile.exists())
  169.       return;
  170.     FileImageInputStream localFileImageInputStream = null;
  171.     FileImageOutputStream localFileImageOutputStream = null;
  172.     try
  173.     {
  174.       localFileImageInputStream = new FileImageInputStream(new File(paramString));
  175.       localFileImageOutputStream = new FileImageOutputStream(new File(R + J + localFile.getName()));
  176.       int i = 0;
  177.       while ((i = localFileImageInputStream.read()) >= 0)
  178.         localFileImageOutputStream.write(i);
  179.       localFileImageOutputStream.close();
  180.     }
  181.     catch (Exception localException2)
  182.     {
  183.     }
  184.     finally
  185.     {
  186.       try
  187.       {
  188.         localFileImageInputStream.close();
  189.         localFileImageOutputStream.close();
  190.         localFile = null;
  191.       }
  192.       catch (Exception localException4)
  193.       {
  194.         localFileImageInputStream = null;
  195.         localFileImageOutputStream = null;
  196.         localFile = null;
  197.       }
  198.     }
  199.   }
  200.  
  201.   private static String B()
  202.   {
  203.     return System.getProperty("report.config");
  204.   }
  205. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement