Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package A.B.A.A;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- import java.util.Properties;
- import javax.imageio.stream.FileImageInputStream;
- import javax.imageio.stream.FileImageOutputStream;
- public class B
- {
- public static final String a = System.getProperty("user.dir");
- public static final String J = System.getProperty("file.separator");
- public static String X = "Bla Reports";
- public static String N = a + J + X;
- public static String Q = N + J + "Results";
- public static String Z = "util_files";
- public static String O = N + J + Z;
- public static String F = "CSS";
- public static String S = O + J + F;
- public static String P = "IMG";
- public static String R = O + J + P;
- public static String A = "JS";
- public static String T = O + J + A;
- public static String H = "Run_";
- public static String U = Q + J + H;
- public static String I = Q + J + "Settings.properties";
- public static final char _ = ';';
- public static final String B = "##@##@##";
- public static final char V = ',';
- public static final String G = "Run ";
- public static final String E = "PNG";
- public static final String D = ".PNG";
- private static String C = null;
- public static String M = "img";
- public static boolean W = true;
- public static boolean Y = false;
- public static boolean L = false;
- public static boolean K = false;
- public static void C()
- throws A.B.A.B.A
- {
- if (B() != null)
- {
- Properties localProperties = new Properties();
- try
- {
- localProperties.load(new FileReader(B()));
- String str1 = localProperties.getProperty("reports.dir").trim();
- String str2 = localProperties.getProperty("header.text").trim();
- C = localProperties.getProperty("right.header.logo").trim();
- String str3 = localProperties.getProperty("description").trim();
- String str4 = localProperties.getProperty("takescreenshot").trim();
- String str5 = localProperties.getProperty("generated.configurationreports").trim();
- String str6 = localProperties.getProperty("continueExecutionAfterStepFailed").trim();
- try
- {
- if ((str2 != null) && (str2.length() > 0))
- A.B.A.E.B.F.A(str2);
- if ((str4 != null) && (str4.length() > 0))
- try
- {
- L = Boolean.parseBoolean(str4);
- }
- catch (Exception localException1)
- {
- }
- if ((str5 != null) && (str5.length() > 0))
- try
- {
- W = Boolean.parseBoolean(str5);
- }
- catch (Exception localException2)
- {
- }
- if ((str6 != null) && (str6.length() > 0))
- try
- {
- K = Boolean.parseBoolean(str6);
- }
- catch (Exception localException3)
- {
- }
- if ((str3 != null) && (str3.length() > 0))
- A.B.A.A.J = str3;
- if ((str1 != null) && (str1.length() > 0))
- {
- N = str1;
- X = new File(N).getName();
- Q = N + J + "Results";
- Z = "util_files";
- O = N + J + Z;
- F = "CSS";
- S = O + J + F;
- P = "IMG";
- R = O + J + P;
- A = "JS";
- T = O + J + A;
- H = "Run_";
- U = Q + J + H;
- I = Q + J + "Settings.properties";
- }
- }
- catch (Exception localException4)
- {
- throw new A.B.A.B.A(localException4.toString());
- }
- }
- catch (FileNotFoundException localFileNotFoundException)
- {
- throw new A.B.A.B.A("The Path for the properties file not found.");
- }
- catch (IOException localIOException)
- {
- throw new A.B.A.B.A("Problem with reading the report config file.");
- }
- }
- }
- public static void C(String paramString)
- {
- File localFile = new File(paramString);
- if (!localFile.exists())
- localFile.mkdirs();
- }
- public static boolean A(String paramString)
- {
- File localFile = new File(paramString);
- return localFile.exists();
- }
- public static void A()
- throws A.B.A.B.A
- {
- C();
- C(N);
- if (!A(Q))
- {
- C(Q);
- D.D();
- }
- if (!A(O))
- {
- C(O);
- C(S);
- C(T);
- C(R);
- A.B.A.C.A.B();
- A.B.A.C.A.C();
- A.B.A.C.A.A();
- }
- if ((C != null) && (C.length() > 0))
- {
- String str = new File(C).getName();
- if (!new File(R + J + str).exists())
- B(C);
- A.B.A.E.B.J.A(str);
- }
- }
- private static void B(String paramString)
- throws A.B.A.B.A
- {
- File localFile = new File(paramString);
- if (!localFile.exists())
- return;
- FileImageInputStream localFileImageInputStream = null;
- FileImageOutputStream localFileImageOutputStream = null;
- try
- {
- localFileImageInputStream = new FileImageInputStream(new File(paramString));
- localFileImageOutputStream = new FileImageOutputStream(new File(R + J + localFile.getName()));
- int i = 0;
- while ((i = localFileImageInputStream.read()) >= 0)
- localFileImageOutputStream.write(i);
- localFileImageOutputStream.close();
- }
- catch (Exception localException2)
- {
- }
- finally
- {
- try
- {
- localFileImageInputStream.close();
- localFileImageOutputStream.close();
- localFile = null;
- }
- catch (Exception localException4)
- {
- localFileImageInputStream = null;
- localFileImageOutputStream = null;
- localFile = null;
- }
- }
- }
- private static String B()
- {
- return System.getProperty("report.config");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement