package com.aspose.imaging.examples;

import java.io.File;

public class Utils {

    public static String getDataDir(Class c) {
        File dir = new File(System.getProperty("user.dir"));
        dir = new File(dir, "src");
        dir = new File(dir, "main");
        dir = new File(dir, "resources");

        for (String s : c.getName().split("\\.")) {
            dir = new File(dir, s);
        }

        System.out.println("Using data directory: " + dir.toString());
        return dir.toString() + File.separator;
    }

}

@@ -398,16 +398,48 @@
      %7D%0A%0A
+        if (dir.exists()) %7B%0A    
         
@@ -497,24 +497,155 @@
 oString());%0A
+        %7D else %7B%0A            dir.mkdirs();%0A            System.out.println(%22Creating data directory: %22 + dir.toString());%0A        %7D%0A
         retu

Create data directory, if required